FFmpeg
ffmpeg.h
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #ifndef FFTOOLS_FFMPEG_H
20 #define FFTOOLS_FFMPEG_H
21 
22 #include "config.h"
23 
24 #include <stdatomic.h>
25 #include <stdint.h>
26 #include <stdio.h>
27 #include <signal.h>
28 
29 #include "cmdutils.h"
30 #include "ffmpeg_sched.h"
31 #include "sync_queue.h"
32 
33 #include "libavformat/avformat.h"
34 #include "libavformat/avio.h"
35 
36 #include "libavcodec/avcodec.h"
37 #include "libavcodec/bsf.h"
38 
39 #include "libavfilter/avfilter.h"
40 
41 #include "libavutil/avutil.h"
42 #include "libavutil/bprint.h"
43 #include "libavutil/dict.h"
44 #include "libavutil/eval.h"
45 #include "libavutil/fifo.h"
46 #include "libavutil/hwcontext.h"
47 #include "libavutil/pixfmt.h"
48 #include "libavutil/rational.h"
49 #include "libavutil/thread.h"
51 
53 
54 // deprecated features
55 #define FFMPEG_OPT_QPHIST 1
56 #define FFMPEG_OPT_ADRIFT_THRESHOLD 1
57 #define FFMPEG_OPT_ENC_TIME_BASE_NUM 1
58 #define FFMPEG_OPT_TOP 1
59 #define FFMPEG_OPT_FORCE_KF_SOURCE_NO_DROP 1
60 #define FFMPEG_OPT_VSYNC_DROP 1
61 #define FFMPEG_OPT_VSYNC 1
62 #define FFMPEG_OPT_FILTER_SCRIPT 1
63 
64 #define FFMPEG_ERROR_RATE_EXCEEDED FFERRTAG('E', 'R', 'E', 'D')
65 
67  VSYNC_AUTO = -1,
72 #if FFMPEG_OPT_VSYNC_DROP
74 #endif
75 };
76 
80 };
81 
82 enum HWAccelID {
86 };
87 
92 };
93 
97 };
98 
108 };
109 
110 typedef struct HWDevice {
111  const char *name;
114 } HWDevice;
115 
117  // no specifier given
119  // val is view index
121  // val is view ID
123  // specify view by its position, val is AV_STEREO3D_VIEW_LEFT/RIGHT
125  // use all views, val is ignored
127 };
128 
129 typedef struct ViewSpecifier {
131  unsigned val;
132 } ViewSpecifier;
133 
134 /* select an input stream for an output stream */
135 typedef struct StreamMap {
136  int disabled; /* 1 is this mapping is disabled by a negative map */
139  char *linklabel; /* name of an output link, for mapping lavfi outputs */
140 
142 } StreamMap;
143 
144 typedef struct OptionsContext {
146 
147  /* input/output options */
151  const char *format;
152 
161 
162  /* input options */
164  int loop;
165  int rate_emu;
166  float readrate;
173 
181 
182  /* output options */
185  const char **attachments;
187 
189 
193  float mux_preload;
196  int shortest;
197  int bitexact;
198 
203 
204  // keys are stream indices
206 
224 #if FFMPEG_OPT_TOP
226 #endif
232 #if FFMPEG_OPT_FILTER_SCRIPT
234 #endif
261 
265  IFILTER_FLAG_CFR = (1 << 2),
266  IFILTER_FLAG_CROP = (1 << 3),
268 };
269 
270 typedef struct InputFilterOptions {
273 
274  uint8_t *name;
275 
276  /* When IFILTER_FLAG_CFR is set, the stream is guaranteed to be CFR with
277  * this framerate.
278  *
279  * Otherwise, this is an estimate that should not be relied upon to be
280  * accurate */
282 
283  unsigned crop_top;
284  unsigned crop_bottom;
285  unsigned crop_left;
286  unsigned crop_right;
287 
290 
291  // a combination of IFILTER_FLAG_*
292  unsigned flags;
293 
296 
299  // produce 24-bit audio
302 };
303 
304 typedef struct OutputFilterOptions {
305  // Caller-provided name for this output
306  char *name;
307 
308  // Codec used for encoding, may be NULL
309  const AVCodec *enc;
310 
314 
315  /* Desired output timebase.
316  * Numerator can be one of EncTimeBase values, or 0 when no preference.
317  */
319 
322 
324 
325  // A combination of OFilterFlags.
326  unsigned flags;
327 
328  int format;
329  int width;
330  int height;
334 
338 
341 
342  const int *formats;
343  const int *sample_rates;
349 
350  // for simple filtergraphs only, view specifier passed
351  // along to the decoder
354 
355 typedef struct InputFilter {
357  uint8_t *name;
358  int index;
359 
360  // filter data type
362 
364 
365  char *input_name;
366 
367  /* for filters that are not yet bound to an input stream,
368  * this stores the input linklabel, if any */
369  uint8_t *linklabel;
370 } InputFilter;
371 
372 typedef struct OutputFilter {
373  const AVClass *class;
374 
376  uint8_t *name;
377  int index;
378 
380 
381  char *output_name;
382 
383  /* for filters that are not yet bound to an output stream,
384  * this stores the output linklabel, if any */
385  int bound;
386  uint8_t *linklabel;
387 
388  char *apad;
389 
391 
394 } OutputFilter;
395 
396 typedef struct FilterGraph {
397  const AVClass *class;
398  int index;
399 
404 
405  const char *graph_desc;
406  struct AVBPrint graph_print_buf;
407 } FilterGraph;
408 
411  // input timestamps are unreliable (guessed by demuxer)
413  // decoder should override timestamps by fixed framerate
414  // from DecoderOpts.framerate
416 #if FFMPEG_OPT_TOP
418 #endif
420  // force bitexact decoding
422 };
423 
424 typedef struct DecoderOpts {
425  int flags;
426 
427  char *name;
428  void *log_parent;
429 
430  const AVCodec *codec;
432 
433  /* hwaccel options */
438 
440 
441  // Either forced (when DECODER_FLAG_FRAMERATE_FORCED is set) or
442  // estimated (otherwise) video framerate.
444 } DecoderOpts;
445 
446 typedef struct Decoder {
447  const AVClass *class;
448 
450 
451  const uint8_t *subtitle_header;
453 
454  // number of frames/samples retrieved from the decoder
455  uint64_t frames_decoded;
456  uint64_t samples_decoded;
457  uint64_t decode_errors;
458 } Decoder;
459 
460 typedef struct InputStream {
461  const AVClass *class;
462 
463  /* parent source */
464  struct InputFile *file;
465 
466  int index;
467 
470 
471  /**
472  * Codec parameters - to be used by the decoding/streamcopy code.
473  * st->codecpar should not be accessed, because it may be modified
474  * concurrently by the demuxing thread.
475  */
478  const AVCodec *dec;
479 
480  /* framerate forced with -r */
482 #if FFMPEG_OPT_TOP
484 #endif
485 
487 
488  /* decoded data from this stream goes into all those filters
489  * currently video and audio only */
492 } InputStream;
493 
494 typedef struct InputFile {
495  const AVClass *class;
496 
497  int index;
498 
502  /**
503  * Effective format start time based on enabled streams.
504  */
507  /* user-specified start time in AV_TIME_BASE or AV_NOPTS_VALUE */
509 
510  /* streams that ffmpeg is aware of;
511  * there may be extra streams in ctx that are not mapped to an InputStream
512  * if new streams appear dynamically during demuxing */
515 } InputFile;
516 
524 };
525 
526 #define ABORT_ON_FLAG_EMPTY_OUTPUT (1 << 0)
527 #define ABORT_ON_FLAG_EMPTY_OUTPUT_STREAM (1 << 1)
528 
549 };
550 
551 typedef struct EncStatsComponent {
553 
554  uint8_t *str;
555  size_t str_len;
557 
558 typedef struct EncStats {
561 
563 
566 } EncStats;
567 
568 enum {
570 #if FFMPEG_OPT_FORCE_KF_SOURCE_NO_DROP
572 #endif
573 };
574 
575 typedef struct KeyframeForceCtx {
576  int type;
577 
579 
580  // timestamps of the forced keyframes, in AV_TIME_BASE_Q
582  int nb_pts;
583  int index;
584 
587 
590 
591 typedef struct Encoder {
592  const AVClass *class;
593 
595 
596  // number of frames/samples sent to the encoder
597  uint64_t frames_encoded;
598  uint64_t samples_encoded;
599 } Encoder;
600 
606 };
607 
608 typedef struct OutputStream {
609  const AVClass *class;
610 
612 
613  /* parent muxer */
614  struct OutputFile *file;
615 
616  int index; /* stream index in the output file */
617 
618  /* input stream that is the source for this output stream;
619  * may be NULL for streams with no well-defined source, e.g.
620  * attachments or outputs from complex filtergraphs */
622 
623  AVStream *st; /* stream in the output file */
624 
626 
627  /* video only */
628 #if FFMPEG_OPT_TOP
630 #endif
631  int bitexact;
633 
635 
637 
638  const char *logfile_prefix;
639  FILE *logfile;
640 
641  // simple filtergraph feeding this stream, if any
644 
646 
647  /* stats */
648  // number of packets send to the muxer
650 
651  /* packet quality factor */
653 
656 
657  /*
658  * bool on whether this stream should be utilized for splitting
659  * subtitles utilizing fix_sub_duration at random access points.
660  */
662 } OutputStream;
663 
664 typedef struct OutputFile {
665  const AVClass *class;
666 
667  int index;
668 
669  const char *url;
670 
673 
674  int64_t recording_time; ///< desired length of the resulting file in microseconds == AV_TIME_BASE units
675  int64_t start_time; ///< start time in microseconds == AV_TIME_BASE units
676 
677  int bitexact;
678 } OutputFile;
679 
680 // optionally attached as opaque_ref to decoded AVFrames
681 typedef struct FrameData {
682  // demuxer-estimated dts in AV_TIME_BASE_Q,
683  // to be used when real dts is missing
685 
686  // properties that come from the decoder
687  struct {
688  uint64_t frame_num;
689 
692  } dec;
693 
695 
697 
699 
701 } FrameData;
702 
703 extern InputFile **input_files;
704 extern int nb_input_files;
705 
706 extern OutputFile **output_files;
707 extern int nb_output_files;
708 
709 // complex filtergraphs
710 extern FilterGraph **filtergraphs;
711 extern int nb_filtergraphs;
712 
713 // standalone decoders (not tied to demuxed streams)
714 extern Decoder **decoders;
715 extern int nb_decoders;
716 
717 extern char *vstats_filename;
718 
719 extern float dts_delta_threshold;
720 extern float dts_error_threshold;
721 
723 extern float frame_drop_threshold;
724 extern int do_benchmark;
725 extern int do_benchmark_all;
726 extern int do_hex_dump;
727 extern int do_pkt_dump;
728 extern int copy_ts;
729 extern int start_at_zero;
730 extern int copy_tb;
731 extern int debug_ts;
732 extern int exit_on_error;
733 extern int abort_on_flags;
734 extern int print_stats;
735 extern int64_t stats_period;
736 extern int stdin_interaction;
737 extern AVIOContext *progress_avio;
738 extern float max_error_rate;
739 
740 extern char *filter_nbthreads;
741 extern int filter_complex_nbthreads;
742 extern int filter_buffered_frames;
743 extern int vstats_version;
744 extern int print_graphs;
745 extern char *print_graphs_file;
746 extern char *print_graphs_format;
747 extern int auto_conversion_filters;
748 
749 extern const AVIOInterruptCB int_cb;
750 
751 extern const OptionDef options[];
752 extern HWDevice *filter_hw_device;
753 
755 
756 extern int ignore_unknown_streams;
757 extern int copy_unknown_streams;
758 
759 extern int recast_media;
760 
761 extern FILE *vstats_file;
762 
763 void term_init(void);
764 void term_exit(void);
765 
766 void show_usage(void);
767 
768 int check_avoptions_used(const AVDictionary *opts, const AVDictionary *opts_used,
769  void *logctx, int decode);
770 
771 int assert_file_overwrite(const char *filename);
772 int find_codec(void *logctx, const char *name,
773  enum AVMediaType type, int encoder, const AVCodec **codec);
774 int parse_and_set_vsync(const char *arg, int *vsync_var, int file_idx, int st_idx, int is_global);
775 
776 int filtergraph_is_simple(const FilterGraph *fg);
777 int fg_create_simple(FilterGraph **pfg,
778  InputStream *ist,
779  char *graph_desc,
780  Scheduler *sch, unsigned sched_idx_enc,
781  const OutputFilterOptions *opts);
782 int fg_finalise_bindings(void);
783 
784 /**
785  * Get our axiliary frame data attached to the frame, allocating it
786  * if needed.
787  */
789 
791 
794 
795 int ofilter_bind_enc(OutputFilter *ofilter,
796  unsigned sched_idx_enc,
797  const OutputFilterOptions *opts);
798 
799 /**
800  * Create a new filtergraph in the global filtergraph list.
801  *
802  * @param graph_desc Graph description; an av_malloc()ed string, filtergraph
803  * takes ownership of it.
804  */
805 int fg_create(FilterGraph **pfg, char *graph_desc, Scheduler *sch);
806 
807 void fg_free(FilterGraph **pfg);
808 
809 void fg_send_command(FilterGraph *fg, double time, const char *target,
810  const char *command, const char *arg, int all_filters);
811 
812 int ffmpeg_parse_options(int argc, char **argv, Scheduler *sch);
813 
815  const AVFrame *frame, const AVPacket *pkt,
816  uint64_t frame_num);
817 
818 HWDevice *hw_device_get_by_name(const char *name);
820 int hw_device_init_from_string(const char *arg, HWDevice **dev);
822  const char *device,
823  HWDevice **dev_out);
824 void hw_device_free_all(void);
825 
826 /**
827  * Get a hardware device to be used with this filtergraph.
828  * The returned reference is owned by the callee, the caller
829  * must ref it explicitly for long-term use.
830  */
832 
833 /**
834  * Create a standalone decoder.
835  */
836 int dec_create(const OptionsContext *o, const char *arg, Scheduler *sch);
837 
838 /**
839  * @param dec_opts Dictionary filled with decoder options. Its ownership
840  * is transferred to the decoder.
841  * @param param_out If non-NULL, media properties after opening the decoder
842  * are written here.
843  *
844  * @retval ">=0" non-negative scheduler index on success
845  * @retval "<0" an error code on failure
846  */
847 int dec_init(Decoder **pdec, Scheduler *sch,
848  AVDictionary **dec_opts, const DecoderOpts *o,
849  AVFrame *param_out);
850 void dec_free(Decoder **pdec);
851 
852 /*
853  * Called by filters to connect decoder's output to given filtergraph input.
854  *
855  * @param opts filtergraph input options, to be filled by this function
856  */
858  const ViewSpecifier *vs, SchedulerNode *src);
859 
860 /*
861  * For multiview video, request output of the view(s) determined by vs.
862  * May be called multiple times.
863  *
864  * If this function is never called, only the base view is output. If it is
865  * called at least once, only the views requested are output.
866  *
867  * @param src scheduler node from which the frames corresponding vs
868  * will originate
869  */
870 int dec_request_view(Decoder *dec, const ViewSpecifier *vs,
871  SchedulerNode *src);
872 
873 int enc_alloc(Encoder **penc, const AVCodec *codec,
874  Scheduler *sch, unsigned sch_idx, void *log_parent);
875 void enc_free(Encoder **penc);
876 
877 int enc_open(void *opaque, const AVFrame *frame);
878 
879 int enc_loopback(Encoder *enc);
880 
881 /*
882  * Initialize muxing state for the given stream, should be called
883  * after the codec/streamcopy setup has been done.
884  *
885  * Open the muxer once all the streams have been initialized.
886  */
888  const AVCodecContext *enc_ctx);
890 int of_open(const OptionsContext *o, const char *filename, Scheduler *sch);
891 void of_free(OutputFile **pof);
892 
893 void of_enc_stats_close(void);
894 
896 
897 int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch);
898 void ifile_close(InputFile **f);
899 
900 int ist_use(InputStream *ist, int decoding_needed,
901  const ViewSpecifier *vs, SchedulerNode *src);
902 int ist_filter_add(InputStream *ist, InputFilter *ifilter, int is_simple,
904  SchedulerNode *src);
905 
906 /**
907  * Find an unused input stream of given type.
908  */
910 
911 /* iterate over all input streams in all input files;
912  * pass NULL to start iteration */
914 
915 /* iterate over all output streams in all output files;
916  * pass NULL to start iteration */
918 
919 void update_benchmark(const char *fmt, ...);
920 
921 const char *opt_match_per_type_str(const SpecifierOptList *sol,
922  char mediatype);
923 void opt_match_per_stream_str(void *logctx, const SpecifierOptList *sol,
924  AVFormatContext *fc, AVStream *st, const char **out);
925 void opt_match_per_stream_int(void *logctx, const SpecifierOptList *sol,
926  AVFormatContext *fc, AVStream *st, int *out);
927 void opt_match_per_stream_int64(void *logctx, const SpecifierOptList *sol,
929 void opt_match_per_stream_dbl(void *logctx, const SpecifierOptList *sol,
930  AVFormatContext *fc, AVStream *st, double *out);
931 
932 int view_specifier_parse(const char **pspec, ViewSpecifier *vs);
933 
934 int muxer_thread(void *arg);
935 int encoder_thread(void *arg);
936 
937 #endif /* FFTOOLS_FFMPEG_H */
OptionsContext::readrate
float readrate
Definition: ffmpeg.h:166
KeyframeForceCtx::pts
int64_t * pts
Definition: ffmpeg.h:581
Decoder::subtitle_header
const uint8_t * subtitle_header
Definition: ffmpeg.h:451
pthread_mutex_t
_fmutex pthread_mutex_t
Definition: os2threads.h:53
fg_create_simple
int fg_create_simple(FilterGraph **pfg, InputStream *ist, char *graph_desc, Scheduler *sch, unsigned sched_idx_enc, const OutputFilterOptions *opts)
Definition: ffmpeg_filter.c:1210
FrameData::par_enc
AVCodecParameters * par_enc
Definition: ffmpeg.h:700
AVCodec
AVCodec.
Definition: codec.h:172
OptionsContext::input_ts_offset
int64_t input_ts_offset
Definition: ffmpeg.h:163
InputFile::start_time
int64_t start_time
Definition: ffmpeg.h:508
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
OptionsContext::stop_time
int64_t stop_time
Definition: ffmpeg.h:191
StreamMap::file_index
int file_index
Definition: ffmpeg.h:137
KeyframeForceCtx::dropped_keyframe
int dropped_keyframe
Definition: ffmpeg.h:588
OutputFilter::graph
struct FilterGraph * graph
Definition: ffmpeg.h:375
FKF_PREV_FORCED_T
@ FKF_PREV_FORCED_T
Definition: ffmpeg.h:521
OptionsContext::force_fps
SpecifierOptList force_fps
Definition: ffmpeg.h:215
OptionsContext::forced_key_frames
SpecifierOptList forced_key_frames
Definition: ffmpeg.h:213
ist_use
int ist_use(InputStream *ist, int decoding_needed, const ViewSpecifier *vs, SchedulerNode *src)
Definition: ffmpeg_demux.c:911
view_specifier_parse
int view_specifier_parse(const char **pspec, ViewSpecifier *vs)
Definition: ffmpeg_opt.c:245
OutputFilterOptions::nb_threads
int64_t nb_threads
Definition: ffmpeg.h:323
VSYNC_VFR
@ VSYNC_VFR
Definition: ffmpeg.h:70
EncStatsComponent::type
enum EncStatsType type
Definition: ffmpeg.h:552
OutputFilterOptions::ch_layout
AVChannelLayout ch_layout
Definition: ffmpeg.h:340
Encoder::samples_encoded
uint64_t samples_encoded
Definition: ffmpeg.h:598
nb_filtergraphs
int nb_filtergraphs
Definition: ffmpeg.c:112
FrameData
Definition: ffmpeg.h:681
ENC_STATS_PTS
@ ENC_STATS_PTS
Definition: ffmpeg.h:537
InputFilterOptions::crop_right
unsigned crop_right
Definition: ffmpeg.h:286
OutputFilter::apad
char * apad
Definition: ffmpeg.h:388
out
FILE * out
Definition: movenc.c:55
ENC_STATS_FRAME_NUM_IN
@ ENC_STATS_FRAME_NUM_IN
Definition: ffmpeg.h:534
FKF_PREV_FORCED_N
@ FKF_PREV_FORCED_N
Definition: ffmpeg.h:520
DecoderOpts
Definition: ffmpeg.h:424
FilterGraph::graph_desc
const char * graph_desc
Definition: ffmpeg.h:405
AVCodecParameters
This struct describes the properties of an encoded stream.
Definition: codec_par.h:47
DECODER_FLAG_SEND_END_TS
@ DECODER_FLAG_SEND_END_TS
Definition: ffmpeg.h:419
thread.h
enc_open
int enc_open(void *opaque, const AVFrame *frame)
Definition: ffmpeg_enc.c:184
FilterGraph::inputs
InputFilter ** inputs
Definition: ffmpeg.h:400
ENC_STATS_DTS
@ ENC_STATS_DTS
Definition: ffmpeg.h:541
InputFilterOptions::crop_bottom
unsigned crop_bottom
Definition: ffmpeg.h:284
fg_free
void fg_free(FilterGraph **pfg)
Definition: ffmpeg_filter.c:1002
FrameData::dts_est
int64_t dts_est
Definition: ffmpeg.h:684
LATENCY_PROBE_DEC_POST
@ LATENCY_PROBE_DEC_POST
Definition: ffmpeg.h:102
vstats_file
FILE * vstats_file
Definition: ffmpeg.c:89
KeyframeForceCtx::nb_pts
int nb_pts
Definition: ffmpeg.h:582
frame_drop_threshold
float frame_drop_threshold
Definition: ffmpeg_opt.c:62
rational.h
OutputFilterOptions::frame_rates
const AVRational * frame_rates
Definition: ffmpeg.h:345
ist_filter_add
int ist_filter_add(InputStream *ist, InputFilter *ifilter, int is_simple, const ViewSpecifier *vs, InputFilterOptions *opts, SchedulerNode *src)
Definition: ffmpeg_demux.c:1021
int64_t
long long int64_t
Definition: coverity.c:34
InputStream::user_set_discard
int user_set_discard
Definition: ffmpeg.h:469
OutputStream::packets_written
atomic_uint_least64_t packets_written
Definition: ffmpeg.h:649
dec_filter_add
int dec_filter_add(Decoder *dec, InputFilter *ifilter, InputFilterOptions *opts, const ViewSpecifier *vs, SchedulerNode *src)
Definition: ffmpeg_dec.c:1753
OptionsContext::bits_per_raw_sample
SpecifierOptList bits_per_raw_sample
Definition: ffmpeg.h:253
ENC_STATS_AVG_BITRATE
@ ENC_STATS_AVG_BITRATE
Definition: ffmpeg.h:547
OptionsContext::audio_ch_layouts
SpecifierOptList audio_ch_layouts
Definition: ffmpeg.h:154
OptionsContext::qscale
SpecifierOptList qscale
Definition: ffmpeg.h:212
parse_and_set_vsync
int parse_and_set_vsync(const char *arg, int *vsync_var, int file_idx, int st_idx, int is_global)
Definition: ffmpeg_opt.c:298
OptionsContext::nb_attachments
int nb_attachments
Definition: ffmpeg.h:186
OutputFile::start_time
int64_t start_time
start time in microseconds == AV_TIME_BASE units
Definition: ffmpeg.h:675
progress_avio
AVIOContext * progress_avio
Definition: ffmpeg.c:103
InputFile::index
int index
Definition: ffmpeg.h:497
OutputFilterOptions::flags
unsigned flags
Definition: ffmpeg.h:326
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:427
OptionsContext::presets
SpecifierOptList presets
Definition: ffmpeg.h:228
DECODER_FLAG_FRAMERATE_FORCED
@ DECODER_FLAG_FRAMERATE_FORCED
Definition: ffmpeg.h:415
of_filesize
int64_t of_filesize(OutputFile *of)
Definition: ffmpeg_mux.c:888
OptionsContext::mux_max_delay
float mux_max_delay
Definition: ffmpeg.h:194
OptionsContext::display_hflips
SpecifierOptList display_hflips
Definition: ffmpeg.h:218
DecoderOpts::par
const AVCodecParameters * par
Definition: ffmpeg.h:431
FKF_T
@ FKF_T
Definition: ffmpeg.h:522
sync_queue.h
ENC_STATS_LITERAL
@ ENC_STATS_LITERAL
Definition: ffmpeg.h:530
OptionsContext::subtitle_disable
int subtitle_disable
Definition: ffmpeg.h:201
OptionsContext::readrate_catchup
float readrate_catchup
Definition: ffmpeg.h:167
OptionsContext::passlogfiles
SpecifierOptList passlogfiles
Definition: ffmpeg.h:241
OutputStream::index
int index
Definition: ffmpeg.h:616
ofilter_bind_enc
int ofilter_bind_enc(OutputFilter *ofilter, unsigned sched_idx_enc, const OutputFilterOptions *opts)
Definition: ffmpeg_filter.c:801
FilterGraph::index
int index
Definition: ffmpeg.h:398
OutputFilter::index
int index
Definition: ffmpeg.h:377
KeyframeForceCtx::type
int type
Definition: ffmpeg.h:576
InputFilter::index
int index
Definition: ffmpeg.h:358
OutputFilterOptions::sws_opts
AVDictionary * sws_opts
Definition: ffmpeg.h:320
DecoderOpts::hwaccel_id
enum HWAccelID hwaccel_id
Definition: ffmpeg.h:434
InputStream::nb_filters
int nb_filters
Definition: ffmpeg.h:491
int_cb
const AVIOInterruptCB int_cb
Definition: ffmpeg.c:308
atomic_int
intptr_t atomic_int
Definition: stdatomic.h:55
nb_output_files
int nb_output_files
Definition: ffmpeg.c:109
show_usage
void show_usage(void)
Definition: ffmpeg_opt.c:1327
fg_create
int fg_create(FilterGraph **pfg, char *graph_desc, Scheduler *sch)
Create a new filtergraph in the global filtergraph list.
Definition: ffmpeg_filter.c:1074
FilterGraph::nb_inputs
int nb_inputs
Definition: ffmpeg.h:401
OptionsContext::bitexact
int bitexact
Definition: ffmpeg.h:197
ViewSpecifier
Definition: ffmpeg.h:129
AVDictionary
Definition: dict.c:32
HWDevice
Definition: ffmpeg.h:110
hw_device_init_from_string
int hw_device_init_from_string(const char *arg, HWDevice **dev)
Definition: ffmpeg_hw.c:92
VIEW_SPECIFIER_TYPE_ALL
@ VIEW_SPECIFIER_TYPE_ALL
Definition: ffmpeg.h:126
nb_input_files
int nb_input_files
Definition: ffmpeg.c:106
OutputFilterOptions::sample_rate
int sample_rate
Definition: ffmpeg.h:339
enc_stats_write
void enc_stats_write(OutputStream *ost, EncStats *es, const AVFrame *frame, const AVPacket *pkt, uint64_t frame_num)
Definition: ffmpeg_enc.c:476
IFILTER_FLAG_AUTOROTATE
@ IFILTER_FLAG_AUTOROTATE
Definition: ffmpeg.h:263
LATENCY_PROBE_ENC_POST
@ LATENCY_PROBE_ENC_POST
Definition: ffmpeg.h:106
OptionsContext::format
const char * format
Definition: ffmpeg.h:151
InputFile::input_sync_ref
int input_sync_ref
Definition: ffmpeg.h:501
DECODER_FLAG_BITEXACT
@ DECODER_FLAG_BITEXACT
Definition: ffmpeg.h:421
ost
static AVStream * ost
Definition: vaapi_transcode.c:42
OutputStream::fix_sub_duration_heartbeat
unsigned int fix_sub_duration_heartbeat
Definition: ffmpeg.h:661
OutputFilterOptions::sample_rates
const int * sample_rates
Definition: ffmpeg.h:343
enc_loopback
int enc_loopback(Encoder *enc)
Definition: ffmpeg_enc.c:948
OutputStream::ist
InputStream * ist
Definition: ffmpeg.h:621
OptionsContext::frame_pix_fmts
SpecifierOptList frame_pix_fmts
Definition: ffmpeg.h:160
OutputStream::file
struct OutputFile * file
Definition: ffmpeg.h:614
OptionsContext::canvas_sizes
SpecifierOptList canvas_sizes
Definition: ffmpeg.h:239
ENC_STATS_TIMEBASE_IN
@ ENC_STATS_TIMEBASE_IN
Definition: ffmpeg.h:536
AVIOInterruptCB
Callback for checking whether to abort blocking functions.
Definition: avio.h:59
OptionDef
Definition: cmdutils.h:191
FrameData::frame_num
uint64_t frame_num
Definition: ffmpeg.h:688
OutputFile::nb_streams
int nb_streams
Definition: ffmpeg.h:672
InputStream
Definition: ffmpeg.h:460
filter_nbthreads
char * filter_nbthreads
Definition: ffmpeg_opt.c:76
OptionsContext::chapters_input_file
int chapters_input_file
Definition: ffmpeg.h:188
DecoderOpts::hwaccel_output_format
enum AVPixelFormat hwaccel_output_format
Definition: ffmpeg.h:437
debug_ts
int debug_ts
Definition: ffmpeg_opt.c:70
OutputFilterOptions
Definition: ffmpeg.h:304
stats_period
int64_t stats_period
Definition: ffmpeg_opt.c:84
InputFilterOptions::trim_start_us
int64_t trim_start_us
Definition: ffmpeg.h:271
OptionsContext::rate_emu
int rate_emu
Definition: ffmpeg.h:165
CROP_CODEC
@ CROP_CODEC
Definition: ffmpeg.h:604
InputFilterOptions::flags
unsigned flags
Definition: ffmpeg.h:292
OptionsContext::max_frame_rates
SpecifierOptList max_frame_rates
Definition: ffmpeg.h:158
dts_delta_threshold
float dts_delta_threshold
Definition: ffmpeg_opt.c:56
fifo.h
bsf.h
vstats_version
int vstats_version
Definition: ffmpeg_opt.c:79
FRAME_OPAQUE_SUB_HEARTBEAT
@ FRAME_OPAQUE_SUB_HEARTBEAT
Definition: ffmpeg.h:89
OptionsContext::g
OptionGroup * g
Definition: ffmpeg.h:145
Decoder::frames_decoded
uint64_t frames_decoded
Definition: ffmpeg.h:455
opt_match_per_stream_int
void opt_match_per_stream_int(void *logctx, const SpecifierOptList *sol, AVFormatContext *fc, AVStream *st, int *out)
OptionsContext::enc_stats_pre_fmt
SpecifierOptList enc_stats_pre_fmt
Definition: ffmpeg.h:257
InputFilter::type
enum AVMediaType type
Definition: ffmpeg.h:361
StreamMap::disabled
int disabled
Definition: ffmpeg.h:136
OptionsContext::mux_stats_fmt
SpecifierOptList mux_stats_fmt
Definition: ffmpeg.h:259
EncStatsComponent::str_len
size_t str_len
Definition: ffmpeg.h:555
VIEW_SPECIFIER_TYPE_POS
@ VIEW_SPECIFIER_TYPE_POS
Definition: ffmpeg.h:124
ifile_open
int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch)
Definition: ffmpeg_demux.c:1656
DecoderOpts::log_parent
void * log_parent
Definition: ffmpeg.h:428
LatencyProbe
LatencyProbe
Definition: ffmpeg.h:99
KeyframeForceCtx::ref_pts
int64_t ref_pts
Definition: ffmpeg.h:578
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
OptionsContext
Definition: ffmpeg.h:144
FrameData::tb
AVRational tb
Definition: ffmpeg.h:691
do_pkt_dump
int do_pkt_dump
Definition: ffmpeg_opt.c:66
OutputFilter::bound
int bound
Definition: ffmpeg.h:385
fg_send_command
void fg_send_command(FilterGraph *fg, double time, const char *target, const char *command, const char *arg, int all_filters)
Definition: ffmpeg_filter.c:3205
LATENCY_PROBE_FILTER_PRE
@ LATENCY_PROBE_FILTER_PRE
Definition: ffmpeg.h:103
Decoder::samples_decoded
uint64_t samples_decoded
Definition: ffmpeg.h:456
InputFilterOptions::trim_end_us
int64_t trim_end_us
Definition: ffmpeg.h:272
InputFile
Definition: ffmpeg.h:494
OutputFilterOptions::frame_rate
AVRational frame_rate
Definition: ffmpeg.h:336
OptionsContext::recording_time
int64_t recording_time
Definition: ffmpeg.h:190
input_files
InputFile ** input_files
Definition: ffmpeg.c:105
LATENCY_PROBE_DEMUX
@ LATENCY_PROBE_DEMUX
Definition: ffmpeg.h:100
OptionsContext::nb_stream_maps
int nb_stream_maps
Definition: ffmpeg.h:184
OptionsContext::audio_disable
int audio_disable
Definition: ffmpeg.h:200
opt_match_per_stream_int64
void opt_match_per_stream_int64(void *logctx, const SpecifierOptList *sol, AVFormatContext *fc, AVStream *st, int64_t *out)
FrameData::frame_rate_filter
AVRational frame_rate_filter
Definition: ffmpeg.h:694
pkt
AVPacket * pkt
Definition: movenc.c:60
OutputStream::enc
Encoder * enc
Definition: ffmpeg.h:625
OptionsContext::hwaccel_output_formats
SpecifierOptList hwaccel_output_formats
Definition: ffmpeg.h:178
ENC_STATS_PTS_IN
@ ENC_STATS_PTS_IN
Definition: ffmpeg.h:539
OptionsContext::metadata
SpecifierOptList metadata
Definition: ffmpeg.h:207
StreamMap::vs
ViewSpecifier vs
Definition: ffmpeg.h:141
CROP_DISABLED
@ CROP_DISABLED
Definition: ffmpeg.h:602
OptionsContext::filters
SpecifierOptList filters
Definition: ffmpeg.h:231
OutputFilterOptions::ch_layouts
const AVChannelLayout * ch_layouts
Definition: ffmpeg.h:344
nb_output_dumped
atomic_uint nb_output_dumped
Definition: ffmpeg.c:100
ViewSpecifierType
ViewSpecifierType
Definition: ffmpeg.h:116
term_init
void term_init(void)
Definition: ffmpeg.c:202
StreamMap::linklabel
char * linklabel
Definition: ffmpeg.h:139
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:72
of_free
void of_free(OutputFile **pof)
Definition: ffmpeg_mux.c:861
HWACCEL_GENERIC
@ HWACCEL_GENERIC
Definition: ffmpeg.h:85
OutputStream::fg_simple
FilterGraph * fg_simple
Definition: ffmpeg.h:642
VSYNC_VSCFR
@ VSYNC_VSCFR
Definition: ffmpeg.h:71
EncStats::components
EncStatsComponent * components
Definition: ffmpeg.h:559
assert_file_overwrite
int assert_file_overwrite(const char *filename)
Definition: ffmpeg_opt.c:748
OptionsContext::intra_matrices
SpecifierOptList intra_matrices
Definition: ffmpeg.h:221
OptionsContext::stream_groups
SpecifierOptList stream_groups
Definition: ffmpeg.h:249
FilterGraph::outputs
OutputFilter ** outputs
Definition: ffmpeg.h:402
vstats_filename
char * vstats_filename
Definition: ffmpeg_opt.c:54
OutputStream::frame_aspect_ratio
AVRational frame_aspect_ratio
Definition: ffmpeg.h:634
InputStream::framerate
AVRational framerate
Definition: ffmpeg.h:481
OutputStream::quality
atomic_int quality
Definition: ffmpeg.h:652
KF_FORCE_SOURCE_NO_DROP
@ KF_FORCE_SOURCE_NO_DROP
Definition: ffmpeg.h:571
dec_init
int dec_init(Decoder **pdec, Scheduler *sch, AVDictionary **dec_opts, const DecoderOpts *o, AVFrame *param_out)
Definition: ffmpeg_dec.c:1652
ENC_STATS_FILE_IDX
@ ENC_STATS_FILE_IDX
Definition: ffmpeg.h:531
OptionsContext::limit_filesize
int64_t limit_filesize
Definition: ffmpeg.h:192
OptionsContext::hwaccel_devices
SpecifierOptList hwaccel_devices
Definition: ffmpeg.h:177
VIEW_SPECIFIER_TYPE_NONE
@ VIEW_SPECIFIER_TYPE_NONE
Definition: ffmpeg.h:118
OptionsContext::autoscale
SpecifierOptList autoscale
Definition: ffmpeg.h:252
OutputFilter::linklabel
uint8_t * linklabel
Definition: ffmpeg.h:386
InputFilter
Definition: ffmpeg.h:355
fc
#define fc(width, name, range_min, range_max)
Definition: cbs_av1.c:494
ENC_STATS_BITRATE
@ ENC_STATS_BITRATE
Definition: ffmpeg.h:546
Encoder::frames_encoded
uint64_t frames_encoded
Definition: ffmpeg.h:597
AVHWDeviceType
AVHWDeviceType
Definition: hwcontext.h:27
OptionsContext::sample_fmts
SpecifierOptList sample_fmts
Definition: ffmpeg.h:211
LATENCY_PROBE_ENC_PRE
@ LATENCY_PROBE_ENC_PRE
Definition: ffmpeg.h:105
forced_keyframes_const
forced_keyframes_const
Definition: ffmpeg.h:517
ignore_unknown_streams
int ignore_unknown_streams
Definition: ffmpeg_opt.c:89
FrameData::dec
struct FrameData::@4 dec
InputStream::filters
InputFilter ** filters
Definition: ffmpeg.h:490
OFILTER_FLAG_AUTOSCALE
@ OFILTER_FLAG_AUTOSCALE
Definition: ffmpeg.h:301
print_graphs_file
char * print_graphs_file
Definition: ffmpeg_opt.c:81
InputFilter::linklabel
uint8_t * linklabel
Definition: ffmpeg.h:369
max_error_rate
float max_error_rate
Definition: ffmpeg_opt.c:75
KF_FORCE_SOURCE
@ KF_FORCE_SOURCE
Definition: ffmpeg.h:569
AVExpr
Definition: eval.c:158
Encoder::enc_ctx
AVCodecContext * enc_ctx
Definition: ffmpeg.h:594
OutputFilterOptions::swr_opts
AVDictionary * swr_opts
Definition: ffmpeg.h:321
encoder_thread
int encoder_thread(void *arg)
Definition: ffmpeg_enc.c:866
OptionsContext::fix_sub_duration
SpecifierOptList fix_sub_duration
Definition: ffmpeg.h:237
DecoderOpts::hwaccel_device
char * hwaccel_device
Definition: ffmpeg.h:436
InputFilterOptions::name
uint8_t * name
Definition: ffmpeg.h:274
OptionsContext::shortest
int shortest
Definition: ffmpeg.h:196
InputFilterOptions::crop_top
unsigned crop_top
Definition: ffmpeg.h:283
InputFilter::graph
struct FilterGraph * graph
Definition: ffmpeg.h:356
OptionsContext::accurate_seek
int accurate_seek
Definition: ffmpeg.h:169
OutputFilterOptions::width
int width
Definition: ffmpeg.h:329
OutputStream::enc_stats_pre
EncStats enc_stats_pre
Definition: ffmpeg.h:654
command
static int command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Definition: vf_drawtext.c:1187
OutputStream::bitexact
int bitexact
Definition: ffmpeg.h:631
CroppingType
CroppingType
Definition: ffmpeg.h:601
arg
const char * arg
Definition: jacosubdec.c:67
KeyframeForceCtx::expr_const_values
double expr_const_values[FKF_NB]
Definition: ffmpeg.h:586
of_enc_stats_close
void of_enc_stats_close(void)
Definition: ffmpeg_mux_init.c:197
OutputFilterOptions::format
int format
Definition: ffmpeg.h:328
InputFilterOptions::crop_left
unsigned crop_left
Definition: ffmpeg.h:285
OptionsContext::start_time
int64_t start_time
Definition: ffmpeg.h:148
AVFormatContext
Format I/O context.
Definition: avformat.h:1264
ENC_STATS_KEYFRAME
@ ENC_STATS_KEYFRAME
Definition: ffmpeg.h:548
opts
AVDictionary * opts
Definition: movenc.c:51
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:76
dec_create
int dec_create(const OptionsContext *o, const char *arg, Scheduler *sch)
Create a standalone decoder.
Definition: ffmpeg_dec.c:1679
OutputFilter::name
uint8_t * name
Definition: ffmpeg.h:376
OutputFilterOptions::alpha_mode
enum AVAlphaMode alpha_mode
Definition: ffmpeg.h:333
dec_request_view
int dec_request_view(Decoder *dec, const ViewSpecifier *vs, SchedulerNode *src)
Definition: ffmpeg_dec.c:1025
Decoder::decode_errors
uint64_t decode_errors
Definition: ffmpeg.h:457
InputStream::top_field_first
int top_field_first
Definition: ffmpeg.h:483
InputStream::st
AVStream * st
Definition: ffmpeg.h:468
OptionsContext::audio_channels
SpecifierOptList audio_channels
Definition: ffmpeg.h:155
InputFile::start_time_effective
int64_t start_time_effective
Effective format start time based on enabled streams.
Definition: ffmpeg.h:505
Decoder
Definition: ffmpeg.h:446
ENC_STATS_PTS_TIME
@ ENC_STATS_PTS_TIME
Definition: ffmpeg.h:538
OptionsContext::fix_sub_duration_heartbeat
SpecifierOptList fix_sub_duration_heartbeat
Definition: ffmpeg.h:238
hw_device_init_from_type
int hw_device_init_from_type(enum AVHWDeviceType type, const char *device, HWDevice **dev_out)
Definition: ffmpeg_hw.c:243
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
OFILTER_FLAG_AUDIO_24BIT
@ OFILTER_FLAG_AUDIO_24BIT
Definition: ffmpeg.h:300
EncStats::lock
pthread_mutex_t lock
Definition: ffmpeg.h:564
OutputFilterOptions::color_spaces
enum AVColorSpace * color_spaces
Definition: ffmpeg.h:346
OptionsContext::copy_prior_start
SpecifierOptList copy_prior_start
Definition: ffmpeg.h:230
EncStats
Definition: ffmpeg.h:558
OptionsContext::program
SpecifierOptList program
Definition: ffmpeg.h:248
copy_unknown_streams
int copy_unknown_streams
Definition: ffmpeg_opt.c:90
options
Definition: swscale.c:43
ViewSpecifier::val
unsigned val
Definition: ffmpeg.h:131
OptionsContext::frame_aspect_ratios
SpecifierOptList frame_aspect_ratios
Definition: ffmpeg.h:216
OptionsContext::reinit_filters
SpecifierOptList reinit_filters
Definition: ffmpeg.h:235
OptionsContext::dump_attachment
SpecifierOptList dump_attachment
Definition: ffmpeg.h:175
InputStream::fix_sub_duration
int fix_sub_duration
Definition: ffmpeg.h:486
OutputStream::top_field_first
int top_field_first
Definition: ffmpeg.h:629
FrameData::wallclock
int64_t wallclock[LATENCY_PROBE_NB]
Definition: ffmpeg.h:698
packet_data_c
const FrameData * packet_data_c(AVPacket *pkt)
Definition: ffmpeg.c:478
of_stream_init
int of_stream_init(OutputFile *of, OutputStream *ost, const AVCodecContext *enc_ctx)
Definition: ffmpeg_mux.c:611
update_benchmark
void update_benchmark(const char *fmt,...)
Definition: ffmpeg.c:534
OptionsContext::display_vflips
SpecifierOptList display_vflips
Definition: ffmpeg.h:219
OutputStream::logfile_prefix
const char * logfile_prefix
Definition: ffmpeg.h:638
OptionsContext::max_frames
SpecifierOptList max_frames
Definition: ffmpeg.h:208
do_benchmark_all
int do_benchmark_all
Definition: ffmpeg_opt.c:64
filtergraphs
FilterGraph ** filtergraphs
Definition: ffmpeg.c:111
InputFilterOptions
Definition: ffmpeg.h:270
OptionsContext::input_sync_ref
int input_sync_ref
Definition: ffmpeg.h:171
OutputFile::index
int index
Definition: ffmpeg.h:667
OptionGroup
Definition: cmdutils.h:336
DECODER_FLAG_FIX_SUB_DURATION
@ DECODER_FLAG_FIX_SUB_DURATION
Definition: ffmpeg.h:410
ENC_STATS_PTS_TIME_IN
@ ENC_STATS_PTS_TIME_IN
Definition: ffmpeg.h:540
FilterGraph::nb_outputs
int nb_outputs
Definition: ffmpeg.h:403
OutputStream::logfile
FILE * logfile
Definition: ffmpeg.h:639
OutputFilterOptions::vsync_method
enum VideoSyncMethod vsync_method
Definition: ffmpeg.h:335
swresample.h
find_codec
int find_codec(void *logctx, const char *name, enum AVMediaType type, int encoder, const AVCodec **codec)
Definition: ffmpeg_opt.c:715
InputStream::par
AVCodecParameters * par
Codec parameters - to be used by the decoding/streamcopy code.
Definition: ffmpeg.h:476
print_graphs_format
char * print_graphs_format
Definition: ffmpeg_opt.c:82
OutputFile::streams
OutputStream ** streams
Definition: ffmpeg.h:671
OutputFilterOptions::color_ranges
enum AVColorRange * color_ranges
Definition: ffmpeg.h:347
Scheduler
Definition: ffmpeg_sched.c:275
recast_media
int recast_media
Definition: ffmpeg_opt.c:91
FilterGraph
Definition: ffmpeg.h:396
print_stats
int print_stats
Definition: ffmpeg_opt.c:73
OutputFilterOptions::vs
const ViewSpecifier * vs
Definition: ffmpeg.h:352
ENC_TIME_BASE_DEMUX
@ ENC_TIME_BASE_DEMUX
Definition: ffmpeg.h:78
InputFilterOptions::sub2video_width
int sub2video_width
Definition: ffmpeg.h:288
InputFilter::filter
AVFilterContext * filter
Definition: ffmpeg.h:363
AVAlphaMode
AVAlphaMode
Correlation between the alpha channel and color values.
Definition: pixfmt.h:800
OutputFilterOptions::name
char * name
Definition: ffmpeg.h:306
VideoSyncMethod
VideoSyncMethod
Definition: ffmpeg.h:66
eval.h
OptionsContext::discard
SpecifierOptList discard
Definition: ffmpeg.h:246
OptionsContext::apad
SpecifierOptList apad
Definition: ffmpeg.h:245
OptionsContext::enc_stats_post_fmt
SpecifierOptList enc_stats_post_fmt
Definition: ffmpeg.h:258
OutputStream::filter
OutputFilter * filter
Definition: ffmpeg.h:643
IFILTER_FLAG_REINIT
@ IFILTER_FLAG_REINIT
Definition: ffmpeg.h:264
f
f
Definition: af_crystalizer.c:122
OutputFilter::output_name
char * output_name
Definition: ffmpeg.h:381
AVIOContext
Bytestream IO Context.
Definition: avio.h:160
OptionsContext::thread_queue_size
int thread_queue_size
Definition: ffmpeg.h:170
AVMediaType
AVMediaType
Definition: avutil.h:198
FRAME_OPAQUE_SEND_COMMAND
@ FRAME_OPAQUE_SEND_COMMAND
Definition: ffmpeg.h:91
SpecifierOptList
Definition: cmdutils.h:179
AVChannelLayout
An AVChannelLayout holds information about the channel layout of audio data.
Definition: channel_layout.h:319
threadmessage.h
OptionsContext::enc_stats_pre
SpecifierOptList enc_stats_pre
Definition: ffmpeg.h:254
FFMPEG_OPT_TOP
#define FFMPEG_OPT_TOP
Definition: ffmpeg.h:58
filtergraph_is_simple
int filtergraph_is_simple(const FilterGraph *fg)
Definition: ffmpeg_filter.c:2158
EncStatsType
EncStatsType
Definition: ffmpeg.h:529
OptionsContext::apply_cropping
SpecifierOptList apply_cropping
Definition: ffmpeg.h:180
StreamMap
Definition: ffmpeg.h:135
ENC_STATS_NB_SAMPLES
@ ENC_STATS_NB_SAMPLES
Definition: ffmpeg.h:544
copy_ts
int copy_ts
Definition: ffmpeg_opt.c:67
avio.h
copy_tb
int copy_tb
Definition: ffmpeg_opt.c:69
OptionsContext::seek_timestamp
int seek_timestamp
Definition: ffmpeg.h:150
OutputFilterOptions::max_frame_rate
AVRational max_frame_rate
Definition: ffmpeg.h:337
LATENCY_PROBE_NB
@ LATENCY_PROBE_NB
Definition: ffmpeg.h:107
OptionsContext::streamid
AVDictionary * streamid
Definition: ffmpeg.h:205
enc_alloc
int enc_alloc(Encoder **penc, const AVCodec *codec, Scheduler *sch, unsigned sch_idx, void *log_parent)
Definition: ffmpeg_enc.c:99
nb_decoders
int nb_decoders
Definition: ffmpeg.c:115
OptionsContext::pass
SpecifierOptList pass
Definition: ffmpeg.h:240
HWDevice::device_ref
AVBufferRef * device_ref
Definition: ffmpeg.h:113
OutputStream::type
enum AVMediaType type
Definition: ffmpeg.h:611
OutputFile::url
const char * url
Definition: ffmpeg.h:669
hw_device_get_by_type
HWDevice * hw_device_get_by_type(enum AVHWDeviceType type)
Definition: ffmpeg_hw.c:28
IFilterFlags
IFilterFlags
Definition: ffmpeg.h:262
OutputFilterOptions::color_space
enum AVColorSpace color_space
Definition: ffmpeg.h:331
OptionsContext::disposition
SpecifierOptList disposition
Definition: ffmpeg.h:247
fg_finalise_bindings
int fg_finalise_bindings(void)
Definition: ffmpeg_filter.c:1417
LATENCY_PROBE_DEC_PRE
@ LATENCY_PROBE_DEC_PRE
Definition: ffmpeg.h:101
OptionsContext::readrate_initial_burst
double readrate_initial_burst
Definition: ffmpeg.h:168
FilterGraph::graph_print_buf
struct AVBPrint graph_print_buf
Definition: ffmpeg.h:406
OutputFilter::filter
AVFilterContext * filter
Definition: ffmpeg.h:379
FrameData::pts
int64_t pts
Definition: ffmpeg.h:690
OptionsContext::find_stream_info
int find_stream_info
Definition: ffmpeg.h:172
OptionsContext::display_rotations
SpecifierOptList display_rotations
Definition: ffmpeg.h:217
OutputFilterOptions::enc
const AVCodec * enc
Definition: ffmpeg.h:309
opt_match_per_stream_dbl
void opt_match_per_stream_dbl(void *logctx, const SpecifierOptList *sol, AVFormatContext *fc, AVStream *st, double *out)
OutputStream::kf
KeyframeForceCtx kf
Definition: ffmpeg.h:636
do_benchmark
int do_benchmark
Definition: ffmpeg_opt.c:63
InputFilterOptions::sub2video_height
int sub2video_height
Definition: ffmpeg.h:289
Encoder
Definition: ffmpeg.h:591
OptionsContext::ts_scale
SpecifierOptList ts_scale
Definition: ffmpeg.h:174
ENC_STATS_FRAME_NUM
@ ENC_STATS_FRAME_NUM
Definition: ffmpeg.h:533
KeyframeForceCtx
Definition: ffmpeg.h:575
OutputFilter::type
enum AVMediaType type
Definition: ffmpeg.h:390
OptionsContext::chroma_intra_matrices
SpecifierOptList chroma_intra_matrices
Definition: ffmpeg.h:223
CROP_CONTAINER
@ CROP_CONTAINER
Definition: ffmpeg.h:605
HWACCEL_AUTO
@ HWACCEL_AUTO
Definition: ffmpeg.h:84
PacketOpaque
PacketOpaque
Definition: ffmpeg.h:94
CROP_ALL
@ CROP_ALL
Definition: ffmpeg.h:603
bprint.h
filter_buffered_frames
int filter_buffered_frames
Definition: ffmpeg_opt.c:78
FrameData::bits_per_raw_sample
int bits_per_raw_sample
Definition: ffmpeg.h:696
OptionsContext::frame_rates
SpecifierOptList frame_rates
Definition: ffmpeg.h:157
StreamMap::stream_index
int stream_index
Definition: ffmpeg.h:138
decoders
Decoder ** decoders
Definition: ffmpeg.c:114
OptionsContext::codec_names
SpecifierOptList codec_names
Definition: ffmpeg.h:153
OptionsContext::stream_maps
StreamMap * stream_maps
Definition: ffmpeg.h:183
OptionsContext::autorotate
SpecifierOptList autorotate
Definition: ffmpeg.h:179
OptionsContext::fps_mode
SpecifierOptList fps_mode
Definition: ffmpeg.h:214
DecoderOpts::time_base
AVRational time_base
Definition: ffmpeg.h:439
InputFilterOptions::fallback
AVFrame * fallback
Definition: ffmpeg.h:294
OptionsContext::start_time_eof
int64_t start_time_eof
Definition: ffmpeg.h:149
VSYNC_CFR
@ VSYNC_CFR
Definition: ffmpeg.h:69
OptionsContext::shortest_buf_duration
float shortest_buf_duration
Definition: ffmpeg.h:195
AVColorSpace
AVColorSpace
YUV colorspace type.
Definition: pixfmt.h:690
OutputFile::bitexact
int bitexact
Definition: ffmpeg.h:677
exit_on_error
int exit_on_error
Definition: ffmpeg_opt.c:71
OptionsContext::mux_stats
SpecifierOptList mux_stats
Definition: ffmpeg.h:256
output_files
OutputFile ** output_files
Definition: ffmpeg.c:108
OptionsContext::muxing_queue_data_threshold
SpecifierOptList muxing_queue_data_threshold
Definition: ffmpeg.h:243
print_graphs
int print_graphs
Definition: ffmpeg_opt.c:80
FRAME_OPAQUE_EOF
@ FRAME_OPAQUE_EOF
Definition: ffmpeg.h:90
InputFile::ctx
AVFormatContext * ctx
Definition: ffmpeg.h:499
OptionsContext::hwaccels
SpecifierOptList hwaccels
Definition: ffmpeg.h:176
ost_iter
OutputStream * ost_iter(OutputStream *prev)
Definition: ffmpeg.c:367
OptionsContext::enc_stats_post
SpecifierOptList enc_stats_post
Definition: ffmpeg.h:255
OutputStream::attachment_filename
char * attachment_filename
Definition: ffmpeg.h:645
IFILTER_FLAG_DROPCHANGED
@ IFILTER_FLAG_DROPCHANGED
Definition: ffmpeg.h:267
SchedulerNode
Definition: ffmpeg_sched.h:103
ENC_STATS_STREAM_IDX
@ ENC_STATS_STREAM_IDX
Definition: ffmpeg.h:532
ENC_STATS_SAMPLE_NUM
@ ENC_STATS_SAMPLE_NUM
Definition: ffmpeg.h:543
OFilterFlags
OFilterFlags
Definition: ffmpeg.h:297
avcodec.h
InputStream::decoder
Decoder * decoder
Definition: ffmpeg.h:477
OptionsContext::metadata_map
SpecifierOptList metadata_map
Definition: ffmpeg.h:227
AVStream
Stream structure.
Definition: avformat.h:744
dec_free
void dec_free(Decoder **pdec)
Definition: ffmpeg_dec.c:118
OutputFilterOptions::trim_start_us
int64_t trim_start_us
Definition: ffmpeg.h:311
enc_free
void enc_free(Encoder **penc)
Definition: ffmpeg_enc.c:71
pixfmt.h
abort_on_flags
int abort_on_flags
Definition: ffmpeg_opt.c:72
frame
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
Definition: filter_design.txt:265
InputFilter::name
uint8_t * name
Definition: ffmpeg.h:357
VIEW_SPECIFIER_TYPE_IDX
@ VIEW_SPECIFIER_TYPE_IDX
Definition: ffmpeg.h:120
VSYNC_DROP
@ VSYNC_DROP
Definition: ffmpeg.h:73
packet_data
FrameData * packet_data(AVPacket *pkt)
Definition: ffmpeg.c:472
InputFile::streams
InputStream ** streams
Definition: ffmpeg.h:513
DECODER_FLAG_TOP_FIELD_FIRST
@ DECODER_FLAG_TOP_FIELD_FIRST
Definition: ffmpeg.h:417
hw_device_free_all
void hw_device_free_all(void)
Definition: ffmpeg_hw.c:286
avformat.h
HWAccelID
HWAccelID
Definition: ffmpeg.h:82
dict.h
OptionsContext::drop_changed
SpecifierOptList drop_changed
Definition: ffmpeg.h:236
ifile_close
void ifile_close(InputFile **f)
Definition: ffmpeg_demux.c:889
OptionsContext::max_muxing_queue_size
SpecifierOptList max_muxing_queue_size
Definition: ffmpeg.h:242
FrameOpaque
FrameOpaque
Definition: ffmpeg.h:88
filter_hw_device
HWDevice * filter_hw_device
Definition: ffmpeg_opt.c:52
AVCodecContext
main external API structure.
Definition: avcodec.h:431
OptionsContext::inter_matrices
SpecifierOptList inter_matrices
Definition: ffmpeg.h:222
IFILTER_FLAG_CROP
@ IFILTER_FLAG_CROP
Definition: ffmpeg.h:266
OptionsContext::audio_sample_rate
SpecifierOptList audio_sample_rate
Definition: ffmpeg.h:156
OptionsContext::mux_preload
float mux_preload
Definition: ffmpeg.h:193
PKT_OPAQUE_SUB_HEARTBEAT
@ PKT_OPAQUE_SUB_HEARTBEAT
Definition: ffmpeg.h:95
HWDevice::name
const char * name
Definition: ffmpeg.h:111
KeyframeForceCtx::index
int index
Definition: ffmpeg.h:583
frame_data_c
const FrameData * frame_data_c(AVFrame *frame)
Definition: ffmpeg.c:466
InputStream::file
struct InputFile * file
Definition: ffmpeg.h:464
avfilter.h
IFILTER_FLAG_CFR
@ IFILTER_FLAG_CFR
Definition: ffmpeg.h:265
OptionsContext::frame_sizes
SpecifierOptList frame_sizes
Definition: ffmpeg.h:159
OptionsContext::video_disable
int video_disable
Definition: ffmpeg.h:199
atomic_uint
intptr_t atomic_uint
Definition: stdatomic.h:56
OutputStream::bits_per_raw_sample
int bits_per_raw_sample
Definition: ffmpeg.h:632
OutputStream::enc_stats_post
EncStats enc_stats_post
Definition: ffmpeg.h:655
Decoder::subtitle_header_size
int subtitle_header_size
Definition: ffmpeg.h:452
frame_data
FrameData * frame_data(AVFrame *frame)
Get our axiliary frame data attached to the frame, allocating it if needed.
Definition: ffmpeg.c:460
ffmpeg_parse_options
int ffmpeg_parse_options(int argc, char **argv, Scheduler *sch)
EncStats::lock_initialized
int lock_initialized
Definition: ffmpeg.h:565
video_sync_method
enum VideoSyncMethod video_sync_method
Definition: ffmpeg_opt.c:60
HWACCEL_NONE
@ HWACCEL_NONE
Definition: ffmpeg.h:83
InputFile::ts_offset
int64_t ts_offset
Definition: ffmpeg.h:506
AVFilterContext
An instance of a filter.
Definition: avfilter.h:274
VSYNC_AUTO
@ VSYNC_AUTO
Definition: ffmpeg.h:67
OutputFilterOptions::formats
const int * formats
Definition: ffmpeg.h:342
OutputFilter
Definition: ffmpeg.h:372
OptionsContext::codec_tags
SpecifierOptList codec_tags
Definition: ffmpeg.h:210
OptionsContext::filter_scripts
SpecifierOptList filter_scripts
Definition: ffmpeg.h:233
DecoderOpts::flags
int flags
Definition: ffmpeg.h:425
OptionsContext::time_bases
SpecifierOptList time_bases
Definition: ffmpeg.h:250
avutil.h
ViewSpecifier::type
enum ViewSpecifierType type
Definition: ffmpeg.h:130
start_at_zero
int start_at_zero
Definition: ffmpeg_opt.c:68
AVBufferRef
A reference to a data buffer.
Definition: buffer.h:82
OutputFilterOptions::height
int height
Definition: ffmpeg.h:330
EncTimeBase
EncTimeBase
Definition: ffmpeg.h:77
ist_iter
InputStream * ist_iter(InputStream *prev)
Definition: ffmpeg.c:383
DECODER_FLAG_TS_UNRELIABLE
@ DECODER_FLAG_TS_UNRELIABLE
Definition: ffmpeg.h:412
OutputFilter::nb_frames_drop
atomic_uint_least64_t nb_frames_drop
Definition: ffmpeg.h:393
auto_conversion_filters
int auto_conversion_filters
Definition: ffmpeg_opt.c:83
OptionsContext::rc_overrides
SpecifierOptList rc_overrides
Definition: ffmpeg.h:220
of_open
int of_open(const OptionsContext *o, const char *filename, Scheduler *sch)
Definition: ffmpeg_mux_init.c:3268
DecoderOpts::codec
const AVCodec * codec
Definition: ffmpeg.h:430
KeyframeForceCtx::pexpr
AVExpr * pexpr
Definition: ffmpeg.h:585
InputStream::index
int index
Definition: ffmpeg.h:466
ffmpeg_sched.h
OptionsContext::copy_initial_nonkeyframes
SpecifierOptList copy_initial_nonkeyframes
Definition: ffmpeg.h:229
FKF_N_FORCED
@ FKF_N_FORCED
Definition: ffmpeg.h:519
OptionsContext::attachments
const char ** attachments
Definition: ffmpeg.h:185
ENC_TIME_BASE_FILTER
@ ENC_TIME_BASE_FILTER
Definition: ffmpeg.h:79
stdin_interaction
int stdin_interaction
Definition: ffmpeg_opt.c:74
do_hex_dump
int do_hex_dump
Definition: ffmpeg_opt.c:65
AVPacket
This structure stores compressed data.
Definition: packet.h:535
VIEW_SPECIFIER_TYPE_ID
@ VIEW_SPECIFIER_TYPE_ID
Definition: ffmpeg.h:122
EncStatsComponent
Definition: ffmpeg.h:551
OutputFilterOptions::trim_duration_us
int64_t trim_duration_us
Definition: ffmpeg.h:312
HWDevice::type
enum AVHWDeviceType type
Definition: ffmpeg.h:112
OutputFilterOptions::ts_offset
int64_t ts_offset
Definition: ffmpeg.h:313
OFILTER_FLAG_DISABLE_CONVERT
@ OFILTER_FLAG_DISABLE_CONVERT
Definition: ffmpeg.h:298
Decoder::type
enum AVMediaType type
Definition: ffmpeg.h:449
cmdutils.h
InputFile::input_ts_offset
int64_t input_ts_offset
Definition: ffmpeg.h:500
EncStats::nb_components
int nb_components
Definition: ffmpeg.h:560
OptionsContext::data_disable
int data_disable
Definition: ffmpeg.h:202
OutputFilterOptions::color_range
enum AVColorRange color_range
Definition: ffmpeg.h:332
muxer_thread
int muxer_thread(void *arg)
Definition: ffmpeg_mux.c:407
FKF_NB
@ FKF_NB
Definition: ffmpeg.h:523
ENC_STATS_PKT_SIZE
@ ENC_STATS_PKT_SIZE
Definition: ffmpeg.h:545
check_avoptions_used
int check_avoptions_used(const AVDictionary *opts, const AVDictionary *opts_used, void *logctx, int decode)
Definition: ffmpeg.c:484
OutputStream
Definition: mux.c:53
hwcontext.h
OutputStream::st
AVStream * st
Definition: mux.c:54
DecoderOpts::framerate
AVRational framerate
Definition: ffmpeg.h:443
EncStatsComponent::str
uint8_t * str
Definition: ffmpeg.h:554
dts_error_threshold
float dts_error_threshold
Definition: ffmpeg_opt.c:57
hw_device_for_filter
AVBufferRef * hw_device_for_filter(void)
Get a hardware device to be used with this filtergraph.
Definition: ffmpeg_hw.c:298
OutputFilterOptions::output_tb
AVRational output_tb
Definition: ffmpeg.h:318
opt_match_per_type_str
const char * opt_match_per_type_str(const SpecifierOptList *sol, char mediatype)
Definition: ffmpeg_opt.c:168
opt_match_per_stream_str
void opt_match_per_stream_str(void *logctx, const SpecifierOptList *sol, AVFormatContext *fc, AVStream *st, const char **out)
InputFile::nb_streams
int nb_streams
Definition: ffmpeg.h:514
FKF_N
@ FKF_N
Definition: ffmpeg.h:518
OptionsContext::guess_layout_max
SpecifierOptList guess_layout_max
Definition: ffmpeg.h:244
AVColorRange
AVColorRange
Visual content value range.
Definition: pixfmt.h:732
ENC_STATS_DTS_TIME
@ ENC_STATS_DTS_TIME
Definition: ffmpeg.h:542
OutputFile::recording_time
int64_t recording_time
desired length of the resulting file in microseconds == AV_TIME_BASE units
Definition: ffmpeg.h:674
hw_device_get_by_name
HWDevice * hw_device_get_by_name(const char *name)
Definition: ffmpeg_hw.c:42
VSYNC_PASSTHROUGH
@ VSYNC_PASSTHROUGH
Definition: ffmpeg.h:68
InputStream::dec
const AVCodec * dec
Definition: ffmpeg.h:478
PKT_OPAQUE_FIX_SUB_DURATION
@ PKT_OPAQUE_FIX_SUB_DURATION
Definition: ffmpeg.h:96
EncStats::io
AVIOContext * io
Definition: ffmpeg.h:562
DecoderOpts::hwaccel_device_type
enum AVHWDeviceType hwaccel_device_type
Definition: ffmpeg.h:435
of_write_trailer
int of_write_trailer(OutputFile *of)
Definition: ffmpeg_mux.c:757
ist_find_unused
InputStream * ist_find_unused(enum AVMediaType type)
Find an unused input stream of given type.
Definition: ffmpeg_demux.c:166
OptionsContext::bitstream_filters
SpecifierOptList bitstream_filters
Definition: ffmpeg.h:209
src
#define src
Definition: vp8dsp.c:248
atomic_uint_least64_t
intptr_t atomic_uint_least64_t
Definition: stdatomic.h:69
OptionsContext::enc_time_bases
SpecifierOptList enc_time_bases
Definition: ffmpeg.h:251
ENC_STATS_TIMEBASE
@ ENC_STATS_TIMEBASE
Definition: ffmpeg.h:535
DecoderFlags
DecoderFlags
Definition: ffmpeg.h:409
OptionsContext::top_field_first
SpecifierOptList top_field_first
Definition: ffmpeg.h:225
term_exit
void term_exit(void)
Definition: ffmpeg.c:132
OutputFilter::nb_frames_dup
atomic_uint_least64_t nb_frames_dup
Definition: ffmpeg.h:392
filter_complex_nbthreads
int filter_complex_nbthreads
Definition: ffmpeg_opt.c:77
OutputFile
Definition: ffmpeg.h:664
InputFilterOptions::framerate
AVRational framerate
Definition: ffmpeg.h:281
OptionsContext::loop
int loop
Definition: ffmpeg.h:164
InputFilter::input_name
char * input_name
Definition: ffmpeg.h:365
LATENCY_PROBE_FILTER_POST
@ LATENCY_PROBE_FILTER_POST
Definition: ffmpeg.h:104
OutputFilterOptions::alpha_modes
enum AVAlphaMode * alpha_modes
Definition: ffmpeg.h:348
DecoderOpts::name
char * name
Definition: ffmpeg.h:427