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