FFmpegKit iOS / macOS / tvOS API 4.5
fftools_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/*
20 * CHANGES 06.2020
21 * - cancel_operation() method signature updated with id
22 *
23 * CHANGES 01.2020
24 * - ffprobe support changes
25 *
26 * CHANGES 12.2019
27 * - Concurrent execution support
28 *
29 * CHANGES 03.2019
30 * --------------------------------------------------------
31 * - config.h include removed
32 *
33 * CHANGES 08.2018
34 * --------------------------------------------------------
35 * - fftools_ prefix added to file name and include guards
36 * - set_report_callback() method declared
37 * - cancel_operation() method declared
38 *
39 * CHANGES 07.2018
40 * --------------------------------------------------------
41 * - Include guards renamed
42 */
43
44#ifndef FFTOOLS_FFMPEG_H
45#define FFTOOLS_FFMPEG_H
46
47#include <stdint.h>
48#include <stdio.h>
49#include <signal.h>
50
51#include "fftools_cmdutils.h"
52
53#include "libavformat/avformat.h"
54#include "libavformat/avio.h"
55
56#include "libavcodec/avcodec.h"
57#include "libavcodec/bsf.h"
58
59#include "libavfilter/avfilter.h"
60
61#include "libavutil/avutil.h"
62#include "libavutil/dict.h"
63#include "libavutil/eval.h"
64#include "libavutil/fifo.h"
65#include "libavutil/hwcontext.h"
66#include "libavutil/pixfmt.h"
67#include "libavutil/rational.h"
68#include "libavutil/thread.h"
69#include "libavutil/threadmessage.h"
70
71#include "libswresample/swresample.h"
72
73#define VSYNC_AUTO -1
74#define VSYNC_PASSTHROUGH 0
75#define VSYNC_CFR 1
76#define VSYNC_VFR 2
77#define VSYNC_VSCFR 0xfe
78#define VSYNC_DROP 0xff
79
80#define MAX_STREAMS 1024 /* arbitrary sanity check value */
81
87};
88
89typedef struct HWAccel {
90 const char *name;
91 int (*init)(AVCodecContext *s);
93 enum AVPixelFormat pix_fmt;
95
96typedef struct HWDevice {
97 const char *name;
98 enum AVHWDeviceType type;
99 AVBufferRef *device_ref;
101
102/* select an input stream for an output stream */
103typedef struct StreamMap {
104 int disabled; /* 1 is this mapping is disabled by a negative map */
109 char *linklabel; /* name of an output link, for mapping lavfi outputs */
111
112typedef struct {
113 int file_idx, stream_idx, channel_idx; // input
114 int ofile_idx, ostream_idx; // output
116
117typedef struct OptionsContext {
119
120 /* input/output options */
121 int64_t start_time;
124 const char *format;
125
140
141 /* input options */
143 int loop;
145 float readrate;
148
161
162 /* output options */
165 AudioChannelMap *audio_channel_maps; /* one info entry per -map_channel */
166 int nb_audio_channel_maps; /* number of (valid) -map_channel settings */
170 const char **attachments;
172
174
176 int64_t stop_time;
182
187
188 /* indexed by output file stream index */
191
263
264typedef struct InputFilter {
265 AVFilterContext *filter;
268 uint8_t *name;
269 enum AVMediaType type; // AVMEDIA_TYPE_SUBTITLE for sub2video
270
271 AVFifoBuffer *frame_queue;
272
273 // parameters configured for this input
275
278
282
283 AVBufferRef *hw_frames_ctx;
284
285 int eof;
287
288typedef struct OutputFilter {
289 AVFilterContext *filter;
292 uint8_t *name;
293
294 /* temporary storage until stream maps are processed */
295 AVFilterInOut *out_tmp;
296 enum AVMediaType type;
297
298 /* desired output stream properties */
300 AVRational frame_rate;
304
305 // those are only set if no format is specified and the encoder gives us multiple options
310
311typedef struct FilterGraph {
312 int index;
313 const char *graph_desc;
314
315 AVFilterGraph *graph;
317
323
324typedef struct InputStream {
326 AVStream *st;
327 int discard; /* true if stream data should be discarded */
329 int decoding_needed; /* non zero if the packets must be decoded in 'raw_fifo', see DECODING_FOR_* */
330#define DECODING_FOR_OST 1
331#define DECODING_FOR_FILTER 2
332
333 AVCodecContext *dec_ctx;
334 const AVCodec *dec;
336 AVFrame *filter_frame; /* a ref of decoded_frame, to be sent to filters */
337 AVPacket *pkt;
338
339 int64_t start; /* time when read started */
340 /* predicted dts of the next packet read for this stream or (when there are
341 * several frames in a packet) of the next frame in current packet (in AV_TIME_BASE units) */
342 int64_t next_dts;
343 int64_t first_dts;
344 int64_t dts;
345
346 int64_t next_pts;
347 int64_t pts;
349
351
352 int64_t min_pts; /* pts with the smallest value in a current stream */
353 int64_t max_pts; /* pts with the higher value in a current stream */
354
355 // when forcing constant input framerate through -r,
356 // this contains the pts that will be given to the next decoded frame
358
359 int64_t nb_samples; /* number of samples in the last decoded audio frame before looping */
360
361 double ts_scale;
363 AVDictionary *decoder_opts;
364 AVRational framerate; /* framerate forced with -r */
367
369
371 struct { /* previous decoded subtitle and related variables */
373 int ret;
374 AVSubtitle subtitle;
376
377 struct sub2video {
378 int64_t last_pts;
379 int64_t end_pts;
380 AVFifoBuffer *sub_queue;
381 AVFrame *frame;
382 int w, h;
383 unsigned int initialize;
385
386 int dr1;
387
388 /* decoded data from this stream goes into all those filters
389 * currently video and audio only */
392
394
395 /* hwaccel options */
397 enum AVHWDeviceType hwaccel_device_type;
399 enum AVPixelFormat hwaccel_output_format;
400
401 /* hwaccel context */
403 void (*hwaccel_uninit)(AVCodecContext *s);
404 int (*hwaccel_get_buffer)(AVCodecContext *s, AVFrame *frame, int flags);
405 int (*hwaccel_retrieve_data)(AVCodecContext *s, AVFrame *frame);
406 enum AVPixelFormat hwaccel_pix_fmt;
407 enum AVPixelFormat hwaccel_retrieved_pix_fmt;
408 AVBufferRef *hw_frames_ctx;
409
410 /* stats */
411 // combined size of all the packets read
412 uint64_t data_size;
413 /* number of packets successfully read for this stream */
414 uint64_t nb_packets;
415 // number of frames/samples retrieved from the decoder
418
419 int64_t *dts_buffer;
421
422 int got_output;
424
425typedef struct InputFile {
426 AVFormatContext *ctx;
427 int eof_reached; /* true if eof reached */
428 int eagain; /* true if last read attempt returned EAGAIN */
429 int ist_index; /* index of first stream in input_streams */
430 int loop; /* set number of times input stream should be looped */
431 int64_t duration; /* actual duration of the longest stream in a file
432 at the moment when looping happens */
433 AVRational time_base; /* time base of the duration */
435
436 int64_t ts_offset;
437 int64_t last_ts;
438 int64_t start_time; /* user-specified start time in AV_TIME_BASE or AV_NOPTS_VALUE */
441 int nb_streams; /* number of stream that ffmpeg is aware of; may be different
442 from ctx.nb_streams if new streams appear during av_read_frame() */
443 int nb_streams_warn; /* number of streams that the user was warned of */
445 float readrate;
447
448 AVPacket *pkt;
449
450#if HAVE_THREADS
451 AVThreadMessageQueue *in_thread_queue;
452 pthread_t thread; /* thread reading from this file */
453 int non_blocking; /* reading packets from the thread should not block */
454 int joined; /* the thread has been joined */
455 int thread_queue_size; /* maximum number of queued packets */
456#endif
458
465 FKF_NB
467
468#define ABORT_ON_FLAG_EMPTY_OUTPUT (1 << 0)
469#define ABORT_ON_FLAG_EMPTY_OUTPUT_STREAM (1 << 1)
470
471extern const char *const forced_keyframes_const_names[];
472
473typedef enum {
476} OSTFinished ;
477
478typedef struct OutputStream {
479 int file_index; /* file index */
480 int index; /* stream index in the output file */
481 int source_index; /* InputStream index */
482 AVStream *st; /* stream in the output file */
483 int encoding_needed; /* true if encoding needed for this stream */
485 /* input pts and corresponding output pts
486 for A/V sync */
487 struct InputStream *sync_ist; /* input stream to sync against */
488 int64_t sync_opts; /* output frame counter, could be changed to some true timestamp */ // FIXME look at frame_number
489 /* pts of the first frame encoded for this stream, used for limiting
490 * recording time */
491 int64_t first_pts;
492 /* dts of the last packet sent to the muxer */
494 // the timebase of the packets sent to the muxer
495 AVRational mux_timebase;
496 AVRational enc_timebase;
497
498 AVBSFContext *bsf_ctx;
499
500 AVCodecContext *enc_ctx;
501 AVCodecParameters *ref_par; /* associated input codec parameters with encoders options applied */
502 const AVCodec *enc;
503 int64_t max_frames;
505 AVFrame *last_frame;
506 AVPacket *pkt;
509
511
512 /* video only */
513 AVRational frame_rate;
514 AVRational max_frame_rate;
521
523
524 /* forced key frames */
533
534 /* audio only */
535 int *audio_channels_map; /* list of the channels id to pick from the source stream */
536 int audio_channels_mapped; /* number of channels in audio_channels_map */
537
539 FILE *logfile;
540
542 char *avfilter;
543 char *filters;
545
546 AVDictionary *encoder_opts;
547 AVDictionary *sws_dict;
548 AVDictionary *swr_opts;
549 AVDictionary *resample_opts;
550 char *apad;
551 OSTFinished finished; /* no more packets should be written for this stream */
552 int unavailable; /* true if the steram is unavailable (possibly temporarily) */
554
555 // init_output_stream() has been called for this stream
556 // The encoder and the bitstream filters have been initialized and the stream
557 // parameters are set in the AVStream.
559
561
566
568
569 /* stats */
570 // combined size of all the packets written
571 uint64_t data_size;
572 // number of packets send to the muxer
574 // number of frames/samples sent to the encoder
577
578 /* packet quality factor */
580
582
583 /* the packets are buffered here until the muxer is ready to be initialized */
584 AVFifoBuffer *muxing_queue;
585
586 /*
587 * The size of the AVPackets' buffers in queue.
588 * Updated when a packet is either pushed or pulled from the queue.
589 */
591
592 /* Threshold after which max_muxing_queue_size will be in effect */
594
595 /* packet picture type */
597
598 /* frame encode sum of squared error values */
599 int64_t error[4];
601
602typedef struct OutputFile {
603 AVFormatContext *ctx;
604 AVDictionary *opts;
605 int ost_index; /* index of the first stream in output_streams */
607 int64_t start_time;
608 uint64_t limit_filesize; /* filesize limit expressed in bytes */
609
611
614
615extern __thread InputStream **input_streams;
616extern __thread int nb_input_streams;
617extern __thread InputFile **input_files;
618extern __thread int nb_input_files;
619
620extern __thread OutputStream **output_streams;
621extern __thread int nb_output_streams;
622extern __thread OutputFile **output_files;
623extern __thread int nb_output_files;
624
625extern __thread FilterGraph **filtergraphs;
626extern __thread int nb_filtergraphs;
627
628extern __thread char *vstats_filename;
629extern __thread char *sdp_filename;
630
631extern __thread float audio_drift_threshold;
632extern __thread float dts_delta_threshold;
633extern __thread float dts_error_threshold;
634
635extern __thread int audio_volume;
636extern __thread int audio_sync_method;
637extern __thread int video_sync_method;
638extern __thread float frame_drop_threshold;
639extern __thread int do_benchmark;
640extern __thread int do_benchmark_all;
641extern __thread int do_deinterlace;
642extern __thread int do_hex_dump;
643extern __thread int do_pkt_dump;
644extern __thread int copy_ts;
645extern __thread int start_at_zero;
646extern __thread int copy_tb;
647extern __thread int debug_ts;
648extern __thread int exit_on_error;
649extern __thread int abort_on_flags;
650extern __thread int print_stats;
651extern __thread int64_t stats_period;
652extern __thread int qp_hist;
653extern __thread int stdin_interaction;
654extern __thread int frame_bits_per_raw_sample;
655extern __thread AVIOContext *progress_avio;
656extern __thread float max_error_rate;
657extern __thread char *videotoolbox_pixfmt;
658
659extern __thread int filter_nbthreads;
660extern __thread int filter_complex_nbthreads;
661extern __thread int vstats_version;
662extern __thread int auto_conversion_filters;
663
664extern __thread const AVIOInterruptCB int_cb;
665
666extern const HWAccel hwaccels[];
667#if CONFIG_QSV
668extern __thread char *qsv_device;
669#endif
670extern __thread HWDevice *filter_hw_device;
671
672void term_init(void);
673void term_exit(void);
674
675void reset_options(OptionsContext *o, int is_input);
676void show_usage(void);
677
678void opt_output_file(void *optctx, const char *filename);
679
680void remove_avoptions(AVDictionary **a, AVDictionary *b);
681void assert_avoptions(AVDictionary *m);
682
684
685enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *avctx, const AVCodec *codec, enum AVPixelFormat target);
686void choose_sample_fmt(AVStream *st, const AVCodec *codec);
687
689int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out);
690void check_filter_outputs(void);
695
696void sub2video_update(InputStream *ist, int64_t heartbeat_pts, AVSubtitle *sub);
697
698int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame);
699
700int ffmpeg_parse_options(int argc, char **argv);
701
702int videotoolbox_init(AVCodecContext *s);
703int qsv_init(AVCodecContext *s);
704
705HWDevice *hw_device_get_by_name(const char *name);
706int hw_device_init_from_string(const char *arg, HWDevice **dev);
707void hw_device_free_all(void);
708
712
713int hwaccel_decode_init(AVCodecContext *avctx);
714
715void set_report_callback(void (*callback)(int, float, float, int64_t, int, double, double));
716
717void cancel_operation(long id);
718
719int opt_map(void *optctx, const char *opt, const char *arg);
720int opt_map_channel(void *optctx, const char *opt, const char *arg);
721int opt_recording_timestamp(void *optctx, const char *opt, const char *arg);
722int opt_data_frames(void *optctx, const char *opt, const char *arg);
723int opt_progress(void *optctx, const char *opt, const char *arg);
724int opt_target(void *optctx, const char *opt, const char *arg);
725int opt_vsync(void *optctx, const char *opt, const char *arg);
726int opt_abort_on(void *optctx, const char *opt, const char *arg);
727int opt_stats_period(void *optctx, const char *opt, const char *arg);
728int opt_qscale(void *optctx, const char *opt, const char *arg);
729int opt_profile(void *optctx, const char *opt, const char *arg);
730int opt_filter_complex(void *optctx, const char *opt, const char *arg);
731int opt_filter_complex_script(void *optctx, const char *opt, const char *arg);
732int opt_attach(void *optctx, const char *opt, const char *arg);
733int opt_video_frames(void *optctx, const char *opt, const char *arg);
734int opt_video_codec(void *optctx, const char *opt, const char *arg);
735int opt_sameq(void *optctx, const char *opt, const char *arg);
736int opt_timecode(void *optctx, const char *opt, const char *arg);
737
738int opt_vstats_file(void *optctx, const char *opt, const char *arg);
739int opt_vstats(void *optctx, const char *opt, const char *arg);
740int opt_video_frames(void *optctx, const char *opt, const char *arg);
741int opt_old2new(void *optctx, const char *opt, const char *arg);
742int opt_streamid(void *optctx, const char *opt, const char *arg);
743int opt_bitrate(void *optctx, const char *opt, const char *arg);
744int show_hwaccels(void *optctx, const char *opt, const char *arg);
745int opt_video_filters(void *optctx, const char *opt, const char *arg);
746int opt_audio_frames(void *optctx, const char *opt, const char *arg);
747int opt_audio_qscale(void *optctx, const char *opt, const char *arg);
748int opt_audio_codec(void *optctx, const char *opt, const char *arg);
749int opt_channel_layout(void *optctx, const char *opt, const char *arg);
750int opt_preset(void *optctx, const char *opt, const char *arg);
751int opt_audio_filters(void *optctx, const char *opt, const char *arg);
752int opt_subtitle_codec(void *optctx, const char *opt, const char *arg);
753int opt_video_channel(void *optctx, const char *opt, const char *arg);
754int opt_video_standard(void *optctx, const char *opt, const char *arg);
755int opt_sdp_file(void *optctx, const char *opt, const char *arg);
756int opt_data_codec(void *optctx, const char *opt, const char *arg);
757int opt_init_hw_device(void *optctx, const char *opt, const char *arg);
758int opt_filter_hw_device(void *optctx, const char *opt, const char *arg);
759void add_input_streams(OptionsContext *o, AVFormatContext *ic);
760void assert_file_overwrite(const char *filename);
761void dump_attachment(AVStream *st, const char *filename);
762uint8_t *get_line(AVIOContext *s);
765AVDictionary *strip_specifiers(AVDictionary *dict);
766void parse_meta_type(char *arg, char *type, int *index, const char **stream_spec);
767int fftools_copy_metadata(char *outspec, char *inspec, AVFormatContext *oc, AVFormatContext *ic, OptionsContext *o);
768const AVCodec *find_codec_or_die(const char *name, enum AVMediaType type, int encoder);
769const AVCodec *choose_decoder(OptionsContext *o, AVFormatContext *s, AVStream *st);
770int open_input_file(OptionsContext *o, const char *filename);
771int get_preset_file_2(const char *preset_name, const char *codec_name, AVIOContext **s);
772int choose_encoder(OptionsContext *o, AVFormatContext *s, OutputStream *ost);
773OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, enum AVMediaType type, int source_index);
774void parse_matrix_coeffs(uint16_t *dest, const char *str);
775uint8_t *fftools_read_file(const char *filename);
776char *get_ost_filters(OptionsContext *o, AVFormatContext *oc, OutputStream *ost);
777void check_streamcopy_filters(OptionsContext *o, AVFormatContext *oc, const OutputStream *ost, enum AVMediaType type);
778OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, int source_index);
779OutputStream *new_audio_stream(OptionsContext *o, AVFormatContext *oc, int source_index);
780OutputStream *new_data_stream(OptionsContext *o, AVFormatContext *oc, int source_index);
781OutputStream *new_unknown_stream(OptionsContext *o, AVFormatContext *oc, int source_index);
782OutputStream *new_attachment_stream(OptionsContext *o, AVFormatContext *oc, int source_index);
783OutputStream *new_subtitle_stream(OptionsContext *o, AVFormatContext *oc, int source_index);
784int copy_chapters(InputFile *ifile, OutputFile *ofile, int copy_metadata);
785void init_output_filter(OutputFilter *ofilter, OptionsContext *o, AVFormatContext *oc);
786int init_complex_filters(void);
787int open_output_file(OptionsContext *o, const char *filename);
788int opt_default_new(OptionsContext *o, const char *opt, const char *arg);
789int open_files(OptionGroupList *l, const char *inout, int (*open_file)(OptionsContext*, const char*));
790
791#endif /* FFTOOLS_FFMPEG_H */
__thread float dts_delta_threshold
int hw_device_setup_for_encode(OutputStream *ost)
int opt_channel_layout(void *optctx, const char *opt, const char *arg)
void uninit_options(OptionsContext *o)
int choose_encoder(OptionsContext *o, AVFormatContext *s, OutputStream *ost)
int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
struct InputFile InputFile
__thread int copy_tb
HWAccelID
@ HWACCEL_NONE
@ HWACCEL_GENERIC
@ HWACCEL_AUTO
@ HWACCEL_VIDEOTOOLBOX
int opt_sdp_file(void *optctx, const char *opt, const char *arg)
__thread int frame_bits_per_raw_sample
int opt_timecode(void *optctx, const char *opt, const char *arg)
OutputStream * new_unknown_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame)
int opt_vstats_file(void *optctx, const char *opt, const char *arg)
__thread InputStream ** input_streams
void parse_meta_type(char *arg, char *type, int *index, const char **stream_spec)
int copy_chapters(InputFile *ifile, OutputFile *ofile, int copy_metadata)
__thread const AVIOInterruptCB int_cb
void reset_options(OptionsContext *o, int is_input)
__thread int64_t stats_period
int opt_data_codec(void *optctx, const char *opt, const char *arg)
int opt_streamid(void *optctx, const char *opt, const char *arg)
uint8_t * fftools_read_file(const char *filename)
__thread int nb_input_streams
void term_exit(void)
const char *const forced_keyframes_const_names[]
int opt_qscale(void *optctx, const char *opt, const char *arg)
int opt_sameq(void *optctx, const char *opt, const char *arg)
__thread OutputStream ** output_streams
__thread OutputFile ** output_files
int opt_filter_complex_script(void *optctx, const char *opt, const char *arg)
__thread char * sdp_filename
AVDictionary * strip_specifiers(AVDictionary *dict)
int opt_filter_complex(void *optctx, const char *opt, const char *arg)
int videotoolbox_init(AVCodecContext *s)
int opt_vsync(void *optctx, const char *opt, const char *arg)
__thread int nb_output_streams
int guess_input_channel_layout(InputStream *ist)
void opt_output_file(void *optctx, const char *filename)
__thread int print_stats
__thread int video_sync_method
__thread int filter_complex_nbthreads
__thread int abort_on_flags
OutputStream * new_output_stream(OptionsContext *o, AVFormatContext *oc, enum AVMediaType type, int source_index)
__thread int nb_input_files
__thread int audio_volume
__thread float max_error_rate
__thread int nb_output_files
OutputStream * new_video_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
__thread int copy_ts
__thread int stdin_interaction
int opt_subtitle_codec(void *optctx, const char *opt, const char *arg)
__thread float dts_error_threshold
int opt_video_standard(void *optctx, const char *opt, const char *arg)
void set_report_callback(void(*callback)(int, float, float, int64_t, int, double, double))
OutputStream * new_audio_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
int hwaccel_decode_init(AVCodecContext *avctx)
HWDevice * hw_device_get_by_name(const char *name)
int open_input_file(OptionsContext *o, const char *filename)
int opt_profile(void *optctx, const char *opt, const char *arg)
OSTFinished
@ ENCODER_FINISHED
@ MUXER_FINISHED
__thread int filter_nbthreads
int opt_abort_on(void *optctx, const char *opt, const char *arg)
void show_usage(void)
enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *avctx, const AVCodec *codec, enum AVPixelFormat target)
int opt_video_codec(void *optctx, const char *opt, const char *arg)
struct OutputFile OutputFile
int opt_data_frames(void *optctx, const char *opt, const char *arg)
int opt_video_filters(void *optctx, const char *opt, const char *arg)
struct FilterGraph FilterGraph
int opt_attach(void *optctx, const char *opt, const char *arg)
__thread int do_benchmark
int opt_filter_hw_device(void *optctx, const char *opt, const char *arg)
__thread float frame_drop_threshold
__thread int vstats_version
__thread char * vstats_filename
OutputStream * new_attachment_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
__thread int do_deinterlace
int opt_audio_frames(void *optctx, const char *opt, const char *arg)
int hw_device_setup_for_decode(InputStream *ist)
void hw_device_free_all(void)
int opt_target(void *optctx, const char *opt, const char *arg)
void check_streamcopy_filters(OptionsContext *o, AVFormatContext *oc, const OutputStream *ost, enum AVMediaType type)
__thread int audio_sync_method
uint8_t * get_line(AVIOContext *s)
int init_complex_filters(void)
int hw_device_setup_for_filter(FilterGraph *fg)
int init_simple_filtergraph(InputStream *ist, OutputStream *ost)
int opt_map(void *optctx, const char *opt, const char *arg)
__thread float audio_drift_threshold
void cancel_operation(long id)
__thread AVIOContext * progress_avio
__thread InputFile ** input_files
void sub2video_update(InputStream *ist, int64_t heartbeat_pts, AVSubtitle *sub)
struct OutputStream OutputStream
__thread int do_benchmark_all
int opt_vstats(void *optctx, const char *opt, const char *arg)
int opt_video_channel(void *optctx, const char *opt, const char *arg)
__thread FilterGraph ** filtergraphs
int ist_in_filtergraph(FilterGraph *fg, InputStream *ist)
__thread int start_at_zero
void parse_matrix_coeffs(uint16_t *dest, const char *str)
int open_files(OptionGroupList *l, const char *inout, int(*open_file)(OptionsContext *, const char *))
int opt_video_frames(void *optctx, const char *opt, const char *arg)
const AVCodec * find_codec_or_die(const char *name, enum AVMediaType type, int encoder)
void assert_file_overwrite(const char *filename)
struct InputFilter InputFilter
int opt_audio_filters(void *optctx, const char *opt, const char *arg)
char * get_ost_filters(OptionsContext *o, AVFormatContext *oc, OutputStream *ost)
forced_keyframes_const
@ FKF_NB
@ FKF_PREV_FORCED_N
@ FKF_T
@ FKF_PREV_FORCED_T
@ FKF_N_FORCED
@ FKF_N
__thread int exit_on_error
void remove_avoptions(AVDictionary **a, AVDictionary *b)
void choose_sample_fmt(AVStream *st, const AVCodec *codec)
int opt_audio_qscale(void *optctx, const char *opt, const char *arg)
int get_preset_file_2(const char *preset_name, const char *codec_name, AVIOContext **s)
int ffmpeg_parse_options(int argc, char **argv)
void init_output_filter(OutputFilter *ofilter, OptionsContext *o, AVFormatContext *oc)
struct StreamMap StreamMap
int show_hwaccels(void *optctx, const char *opt, const char *arg)
__thread HWDevice * filter_hw_device
int opt_preset(void *optctx, const char *opt, const char *arg)
OutputStream * new_data_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
OutputStream * new_subtitle_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
int qsv_init(AVCodecContext *s)
struct OutputFilter OutputFilter
int opt_old2new(void *optctx, const char *opt, const char *arg)
__thread int nb_filtergraphs
void term_init(void)
int opt_stats_period(void *optctx, const char *opt, const char *arg)
void add_input_streams(OptionsContext *o, AVFormatContext *ic)
__thread int qp_hist
struct OptionsContext OptionsContext
int opt_bitrate(void *optctx, const char *opt, const char *arg)
int filtergraph_is_simple(FilterGraph *fg)
int hw_device_init_from_string(const char *arg, HWDevice **dev)
void check_filter_outputs(void)
int fftools_copy_metadata(char *outspec, char *inspec, AVFormatContext *oc, AVFormatContext *ic, OptionsContext *o)
struct HWAccel HWAccel
int opt_default_new(OptionsContext *o, const char *opt, const char *arg)
struct HWDevice HWDevice
int configure_filtergraph(FilterGraph *fg)
__thread int do_hex_dump
__thread int do_pkt_dump
const HWAccel hwaccels[]
void dump_attachment(AVStream *st, const char *filename)
void init_options(OptionsContext *o)
__thread int debug_ts
int opt_map_channel(void *optctx, const char *opt, const char *arg)
const AVCodec * choose_decoder(OptionsContext *o, AVFormatContext *s, AVStream *st)
int opt_progress(void *optctx, const char *opt, const char *arg)
__thread char * videotoolbox_pixfmt
int open_output_file(OptionsContext *o, const char *filename)
int opt_audio_codec(void *optctx, const char *opt, const char *arg)
int opt_recording_timestamp(void *optctx, const char *opt, const char *arg)
__thread int auto_conversion_filters
void assert_avoptions(AVDictionary *m)
struct InputStream InputStream
int opt_init_hw_device(void *optctx, const char *opt, const char *arg)
int init_complex_filtergraph(FilterGraph *fg)
fg inputs[0] ist
OutputStream * ost
OutputFilter ** outputs
const char * graph_desc
AVFilterGraph * graph
InputFilter ** inputs
enum HWAccelID id
enum AVPixelFormat pix_fmt
int(* init)(AVCodecContext *s)
const char * name
AVBufferRef * device_ref
enum AVHWDeviceType type
const char * name
AVPacket * pkt
int64_t ts_offset
int64_t duration
AVFormatContext * ctx
int64_t input_ts_offset
int seek_timestamp
int64_t recording_time
AVRational time_base
int nb_streams_warn
int64_t last_ts
float readrate
int64_t start_time
AVBufferRef * hw_frames_ctx
uint8_t * name
struct InputStream * ist
AVFilterContext * filter
enum AVMediaType type
AVFifoBuffer * frame_queue
uint64_t channel_layout
struct FilterGraph * graph
AVRational sample_aspect_ratio
unsigned int initialize
marks if sub2video_update should force an initialization
AVFifoBuffer * sub_queue
queue of AVSubtitle* before filter init
enum AVPixelFormat hwaccel_pix_fmt
AVFrame * decoded_frame
int64_t * dts_buffer
int64_t dts
dts of the last packet read for this stream (in AV_TIME_BASE units)
enum AVPixelFormat hwaccel_output_format
int64_t cfr_next_pts
void(* hwaccel_uninit)(AVCodecContext *s)
AVCodecContext * dec_ctx
int64_t pts
current pts of the decoded frame (in AV_TIME_BASE units)
AVBufferRef * hw_frames_ctx
struct InputStream::@2 prev_sub
enum HWAccelID hwaccel_id
uint64_t data_size
int(* hwaccel_get_buffer)(AVCodecContext *s, AVFrame *frame, int flags)
int64_t filter_in_rescale_delta_last
int64_t next_dts
int wrap_correction_done
int64_t max_pts
enum AVPixelFormat hwaccel_retrieved_pix_fmt
AVPacket * pkt
AVFrame * filter_frame
void * hwaccel_ctx
int64_t first_dts
dts of the first packet read for this stream (in AV_TIME_BASE units)
uint64_t samples_decoded
int64_t next_pts
synthetic pts for the next decode frame (in AV_TIME_BASE units)
uint64_t frames_decoded
struct InputStream::sub2video sub2video
AVStream * st
InputFilter ** filters
int(* hwaccel_retrieve_data)(AVCodecContext *s, AVFrame *frame)
uint64_t nb_packets
AVSubtitle subtitle
char * hwaccel_device
AVDictionary * decoder_opts
int64_t min_pts
const AVCodec * dec
enum AVHWDeviceType hwaccel_device_type
int64_t nb_samples
AVRational framerate
SpecifierOpt * metadata_map
int nb_copy_initial_nonkeyframes
SpecifierOpt * frame_pix_fmts
SpecifierOpt * dump_attachment
SpecifierOpt * autoscale
int nb_chroma_intra_matrices
int nb_muxing_queue_data_threshold
SpecifierOpt * frame_aspect_ratios
SpecifierOpt * pass
SpecifierOpt * filter_scripts
SpecifierOpt * copy_initial_nonkeyframes
SpecifierOpt * guess_layout_max
const char * format
SpecifierOpt * enc_time_bases
SpecifierOpt * max_frame_rates
int64_t input_ts_offset
SpecifierOpt * audio_sample_rate
SpecifierOpt * max_frames
StreamMap * stream_maps
SpecifierOpt * frame_sizes
SpecifierOpt * muxing_queue_data_threshold
SpecifierOpt * discard
SpecifierOpt * forced_key_frames
SpecifierOpt * hwaccel_devices
SpecifierOpt * filters
SpecifierOpt * metadata
SpecifierOpt * autorotate
int64_t recording_time
SpecifierOpt * disposition
uint64_t limit_filesize
SpecifierOpt * sample_fmts
SpecifierOpt * audio_channels
SpecifierOpt * codec_names
int64_t start_time_eof
SpecifierOpt * canvas_sizes
SpecifierOpt * reinit_filters
SpecifierOpt * passlogfiles
SpecifierOpt * frame_rates
SpecifierOpt * intra_matrices
SpecifierOpt * apad
SpecifierOpt * chroma_intra_matrices
int nb_hwaccel_output_formats
SpecifierOpt * top_field_first
int metadata_chapters_manual
SpecifierOpt * force_fps
SpecifierOpt * qscale
SpecifierOpt * copy_prior_start
SpecifierOpt * max_muxing_queue_size
SpecifierOpt * rc_overrides
const char ** attachments
SpecifierOpt * hwaccels
SpecifierOpt * program
SpecifierOpt * codec_tags
SpecifierOpt * time_bases
SpecifierOpt * presets
SpecifierOpt * ts_scale
SpecifierOpt * fix_sub_duration
SpecifierOpt * inter_matrices
SpecifierOpt * hwaccel_output_formats
SpecifierOpt * bitstream_filters
int nb_max_muxing_queue_size
AudioChannelMap * audio_channel_maps
OptionGroup * g
uint64_t limit_filesize
AVFormatContext * ctx
int64_t start_time
start time in microseconds == AV_TIME_BASE units
AVDictionary * opts
int64_t recording_time
desired length of the resulting file in microseconds == AV_TIME_BASE units
AVFilterInOut * out_tmp
struct OutputStream * ost
uint64_t * channel_layouts
AVFilterContext * filter
uint8_t * name
struct FilterGraph * graph
AVRational frame_rate
uint64_t channel_layout
enum AVMediaType type
int max_muxing_queue_size
AVDictionary * swr_opts
int copy_initial_nonkeyframes
int64_t last_mux_dts
AVRational mux_timebase
double forced_keyframes_expr_const_values[FKF_NB]
OSTFinished finished
int * audio_channels_map
AVPacket * pkt
AVRational frame_aspect_ratio
double rotate_override_value
AVFrame * last_frame
const AVCodec * enc
int audio_channels_mapped
int64_t sync_opts
int64_t * forced_kf_pts
int64_t error[4]
uint64_t packets_written
uint64_t frames_encoded
int64_t max_frames
size_t muxing_queue_data_threshold
AVDictionary * resample_opts
AVRational max_frame_rate
AVRational enc_timebase
AVFifoBuffer * muxing_queue
AVCodecParameters * ref_par
char * forced_keyframes
AVFrame * filtered_frame
const char * attachment_filename
AVRational frame_rate
AVCodecContext * enc_ctx
struct InputStream * sync_ist
AVDictionary * encoder_opts
uint64_t data_size
AVStream * st
char * filters
filtergraph associated to the -filter option
int64_t forced_kf_ref_pts
uint64_t samples_encoded
char * filters_script
filtergraph script associated to the -filter_script option
AVBSFContext * bsf_ctx
int64_t first_pts
void * hwaccel_ctx
AVDictionary * sws_dict
OutputFilter * filter
char * disposition
AVExpr * forced_keyframes_pexpr
size_t muxing_queue_data_size
int last_nb0_frames[3]
char * logfile_prefix
int sync_stream_index
char * linklabel
int sync_file_index