FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 FFMPEG_H
20 #define FFMPEG_H
21 
22 #include "config.h"
23 
24 #include <stdint.h>
25 #include <stdio.h>
26 #include <signal.h>
27 
28 #if HAVE_PTHREADS
29 #include <pthread.h>
30 #endif
31 
32 #include "cmdutils.h"
33 
34 #include "libavformat/avformat.h"
35 #include "libavformat/avio.h"
36 
37 #include "libavcodec/avcodec.h"
38 
39 #include "libavfilter/avfilter.h"
40 
41 #include "libavutil/avutil.h"
42 #include "libavutil/dict.h"
43 #include "libavutil/eval.h"
44 #include "libavutil/fifo.h"
45 #include "libavutil/pixfmt.h"
46 #include "libavutil/rational.h"
48 
50 
51 #define VSYNC_AUTO -1
52 #define VSYNC_PASSTHROUGH 0
53 #define VSYNC_CFR 1
54 #define VSYNC_VFR 2
55 #define VSYNC_VSCFR 0xfe
56 #define VSYNC_DROP 0xff
57 
58 #define MAX_STREAMS 1024 /* arbitrary sanity check value */
59 
60 enum HWAccelID {
67 };
68 
69 typedef struct HWAccel {
70  const char *name;
71  int (*init)(AVCodecContext *s);
72  enum HWAccelID id;
74 } HWAccel;
75 
76 /* select an input stream for an output stream */
77 typedef struct StreamMap {
78  int disabled; /* 1 is this mapping is disabled by a negative map */
83  char *linklabel; /* name of an output link, for mapping lavfi outputs */
84 } StreamMap;
85 
86 typedef struct {
87  int file_idx, stream_idx, channel_idx; // input
88  int ofile_idx, ostream_idx; // output
90 
91 typedef struct OptionsContext {
93 
94  /* input/output options */
95  int64_t start_time;
96  int64_t start_time_eof;
98  const char *format;
99 
112 
113  /* input options */
115  int rate_emu;
118 
129 
130  /* output options */
133  AudioChannelMap *audio_channel_maps; /* one info entry per -map_channel */
134  int nb_audio_channel_maps; /* number of (valid) -map_channel settings */
138  const char **attachments;
140 
142 
143  int64_t recording_time;
144  int64_t stop_time;
145  uint64_t limit_filesize;
146  float mux_preload;
148  int shortest;
149 
154 
155  /* indexed by output file stream index */
158 
206  int nb_pass;
212  int nb_apad;
218 
219 typedef struct InputFilter {
221  struct InputStream *ist;
224 } InputFilter;
225 
226 typedef struct OutputFilter {
228  struct OutputStream *ost;
231 
232  /* temporary storage until stream maps are processed */
235 } OutputFilter;
236 
237 typedef struct FilterGraph {
238  int index;
239  const char *graph_desc;
240 
243 
248 } FilterGraph;
249 
250 typedef struct InputStream {
253  int discard; /* true if stream data should be discarded */
255  int decoding_needed; /* non zero if the packets must be decoded in 'raw_fifo', see DECODING_FOR_* */
256 #define DECODING_FOR_OST 1
257 #define DECODING_FOR_FILTER 2
258 
262  AVFrame *filter_frame; /* a ref of decoded_frame, to be sent to filters */
263 
264  int64_t start; /* time when read started */
265  /* predicted dts of the next packet read for this stream or (when there are
266  * several frames in a packet) of the next frame in current packet (in AV_TIME_BASE units) */
267  int64_t next_dts;
268  int64_t dts; ///< dts of the last packet read for this stream (in AV_TIME_BASE units)
269 
270  int64_t next_pts; ///< synthetic pts for the next decode frame (in AV_TIME_BASE units)
271  int64_t pts; ///< current pts of the decoded frame (in AV_TIME_BASE units)
273 
275 
276  double ts_scale;
280  AVRational framerate; /* framerate forced with -r */
283 
288 
293 
295  struct { /* previous decoded subtitle and related variables */
297  int ret;
299  } prev_sub;
300 
301  struct sub2video {
302  int64_t last_pts;
303  int64_t end_pts;
305  int w, h;
306  } sub2video;
307 
308  int dr1;
309 
310  /* decoded data from this stream goes into all those filters
311  * currently video and audio only */
314 
316 
317  /* hwaccel options */
320 
321  /* hwaccel context */
323  void *hwaccel_ctx;
329 
330  /* stats */
331  // combined size of all the packets read
332  uint64_t data_size;
333  /* number of packets successfully read for this stream */
334  uint64_t nb_packets;
335  // number of frames/samples retrieved from the decoder
336  uint64_t frames_decoded;
337  uint64_t samples_decoded;
338 } InputStream;
339 
340 typedef struct InputFile {
342  int eof_reached; /* true if eof reached */
343  int eagain; /* true if last read attempt returned EAGAIN */
344  int ist_index; /* index of first stream in input_streams */
346  int64_t ts_offset;
347  int64_t last_ts;
348  int64_t start_time; /* user-specified start time in AV_TIME_BASE or AV_NOPTS_VALUE */
350  int64_t recording_time;
351  int nb_streams; /* number of stream that ffmpeg is aware of; may be different
352  from ctx.nb_streams if new streams appear during av_read_frame() */
353  int nb_streams_warn; /* number of streams that the user was warned of */
354  int rate_emu;
356 
357 #if HAVE_PTHREADS
358  AVThreadMessageQueue *in_thread_queue;
359  pthread_t thread; /* thread reading from this file */
360  int non_blocking; /* reading packets from the thread should not block */
361  int joined; /* the thread has been joined */
362  int thread_queue_size; /* maximum number of queued packets */
363 #endif
364 } InputFile;
365 
373 };
374 
375 extern const char *const forced_keyframes_const_names[];
376 
377 typedef enum {
380 } OSTFinished ;
381 
382 typedef struct OutputStream {
383  int file_index; /* file index */
384  int index; /* stream index in the output file */
385  int source_index; /* InputStream index */
386  AVStream *st; /* stream in the output file */
387  int encoding_needed; /* true if encoding needed for this stream */
389  /* input pts and corresponding output pts
390  for A/V sync */
391  struct InputStream *sync_ist; /* input stream to sync against */
392  int64_t sync_opts; /* output frame counter, could be changed to some true timestamp */ // FIXME look at frame_number
393  /* pts of the first frame encoded for this stream, used for limiting
394  * recording time */
395  int64_t first_pts;
396  /* dts of the last packet sent to the muxer */
397  int64_t last_mux_dts;
401  int64_t max_frames;
406 
407  /* video only */
412 
414 
415  /* forced key frames */
416  int64_t *forced_kf_pts;
422 
423  /* audio only */
424  int *audio_channels_map; /* list of the channels id to pick from the source stream */
425  int audio_channels_mapped; /* number of channels in audio_channels_map */
426 
428  FILE *logfile;
429 
431  char *avfilter;
432  char *filters; ///< filtergraph associated to the -filter option
433  char *filters_script; ///< filtergraph script associated to the -filter_script option
434 
440  char *apad;
441  OSTFinished finished; /* no more packets should be written for this stream */
442  int unavailable; /* true if the steram is unavailable (possibly temporarily) */
444  const char *attachment_filename;
447  char *disposition;
448 
450 
452 
453  /* stats */
454  // combined size of all the packets written
455  uint64_t data_size;
456  // number of packets send to the muxer
457  uint64_t packets_written;
458  // number of frames/samples sent to the encoder
459  uint64_t frames_encoded;
460  uint64_t samples_encoded;
461 
462  /* packet quality factor */
463  int quality;
464 
465  /* packet picture type */
467 
468  /* frame encode sum of squared error values */
469  int64_t error[4];
470 } OutputStream;
471 
472 typedef struct OutputFile {
475  int ost_index; /* index of the first stream in output_streams */
476  int64_t recording_time; ///< desired length of the resulting file in microseconds == AV_TIME_BASE units
477  int64_t start_time; ///< start time in microseconds == AV_TIME_BASE units
478  uint64_t limit_filesize; /* filesize limit expressed in bytes */
479 
480  int shortest;
481 } OutputFile;
482 
483 extern InputStream **input_streams;
484 extern int nb_input_streams;
485 extern InputFile **input_files;
486 extern int nb_input_files;
487 
489 extern int nb_output_streams;
490 extern OutputFile **output_files;
491 extern int nb_output_files;
492 
493 extern FilterGraph **filtergraphs;
494 extern int nb_filtergraphs;
495 
496 extern char *vstats_filename;
497 extern char *sdp_filename;
498 
499 extern float audio_drift_threshold;
500 extern float dts_delta_threshold;
501 extern float dts_error_threshold;
502 
503 extern int audio_volume;
504 extern int audio_sync_method;
505 extern int video_sync_method;
506 extern float frame_drop_threshold;
507 extern int do_benchmark;
508 extern int do_benchmark_all;
509 extern int do_deinterlace;
510 extern int do_hex_dump;
511 extern int do_pkt_dump;
512 extern int copy_ts;
513 extern int start_at_zero;
514 extern int copy_tb;
515 extern int debug_ts;
516 extern int exit_on_error;
517 extern int print_stats;
518 extern int qp_hist;
519 extern int stdin_interaction;
520 extern int frame_bits_per_raw_sample;
521 extern AVIOContext *progress_avio;
522 extern float max_error_rate;
523 extern int vdpau_api_ver;
524 extern char *videotoolbox_pixfmt;
525 
526 extern const AVIOInterruptCB int_cb;
527 
528 extern const OptionDef options[];
529 extern const HWAccel hwaccels[];
530 
531 
532 void term_init(void);
533 void term_exit(void);
534 
535 void reset_options(OptionsContext *o, int is_input);
536 void show_usage(void);
537 
538 void opt_output_file(void *optctx, const char *filename);
539 
542 
544 
545 enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *avctx, AVCodec *codec, enum AVPixelFormat target);
546 void choose_sample_fmt(AVStream *st, AVCodec *codec);
547 
553 
554 int ffmpeg_parse_options(int argc, char **argv);
555 
560 
561 #endif /* FFMPEG_H */
int64_t pts
current pts of the decoded frame (in AV_TIME_BASE units)
Definition: ffmpeg.h:271
SpecifierOpt * passlogfiles
Definition: ffmpeg.h:207
int nb_dump_attachment
Definition: ffmpeg.h:122
int got_output
Definition: ffmpeg.h:296
int nb_metadata
Definition: ffmpeg.h:160
int nb_streamid_map
Definition: ffmpeg.h:157
int frame_number
Definition: ffmpeg.h:388
Definition: ffmpeg.h:367
enum HWAccelID active_hwaccel_id
Definition: ffmpeg.h:322
int keep_pix_fmt
Definition: ffmpeg.h:449
const char * s
Definition: avisynth_c.h:631
Bytestream IO Context.
Definition: avio.h:111
float mux_preload
Definition: ffmpeg.h:146
int64_t recording_time
desired length of the resulting file in microseconds == AV_TIME_BASE units
Definition: ffmpeg.h:476
HWAccelID
Definition: ffmpeg.h:60
Buffered I/O operations.
uint8_t * name
Definition: ffmpeg.h:230
int nb_outputs
Definition: ffmpeg.h:247
AVDictionary * swr_opts
Definition: ffmpeg.h:437
int resample_channels
Definition: ffmpeg.h:291
enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *avctx, AVCodec *codec, enum AVPixelFormat target)
Definition: ffmpeg_filter.c:41
This structure describes decoded (raw) audio or video data.
Definition: frame.h:171
int stream_copy
Definition: ffmpeg.h:443
AVRational frame_rate
Definition: ffmpeg.h:408
int64_t * forced_kf_pts
Definition: ffmpeg.h:416
int64_t start_time_eof
Definition: ffmpeg.h:96
char * filters
filtergraph associated to the -filter option
Definition: ffmpeg.h:432
int data_disable
Definition: ffmpeg.h:153
float mux_max_delay
Definition: ffmpeg.h:147
int exit_on_error
Definition: ffmpeg_opt.c:105
int accurate_seek
Definition: ffmpeg.h:355
OutputFile ** output_files
Definition: ffmpeg.c:147
int nb_forced_key_frames
Definition: ffmpeg.h:172
int * streamid_map
Definition: ffmpeg.h:156
Main libavfilter public API header.
int nb_stream_maps
Definition: ffmpeg.h:132
SpecifierOpt * copy_initial_nonkeyframes
Definition: ffmpeg.h:191
int ostream_idx
Definition: ffmpeg.h:88
int nb_chroma_intra_matrices
Definition: ffmpeg.h:184
AVRational framerate
Definition: ffmpeg.h:280
void choose_sample_fmt(AVStream *st, AVCodec *codec)
Definition: ffmpeg_filter.c:79
SpecifierOpt * reinit_filters
Definition: ffmpeg.h:199
SpecifierOpt * ts_scale
Definition: ffmpeg.h:119
AVCodecParserContext * parser
Definition: ffmpeg.h:451
AVFilterInOut * out_tmp
Definition: ffmpeg.h:233
int decoding_needed
Definition: ffmpeg.h:255
int nb_canvas_sizes
Definition: ffmpeg.h:204
FilterGraph * init_simple_filtergraph(InputStream *ist, OutputStream *ost)
int rotate_overridden
Definition: ffmpeg.h:411
const char * b
Definition: vf_curves.c:109
SpecifierOpt * discard
Definition: ffmpeg.h:213
int nb_frame_pix_fmts
Definition: ffmpeg.h:111
SpecifierOpt * sample_fmts
Definition: ffmpeg.h:167
SpecifierOpt * guess_layout_max
Definition: ffmpeg.h:209
int eagain
Definition: ffmpeg.h:343
AVBitStreamFilterContext * bitstream_filters
Definition: ffmpeg.h:398
external API header
forced_keyframes_const
Definition: ffmpeg.h:366
int quality
Definition: ffmpeg.h:463
AVFrame * filter_frame
Definition: ffmpeg.h:262
int do_benchmark_all
Definition: ffmpeg_opt.c:98
FilterGraph ** filtergraphs
Definition: ffmpeg.c:150
int(* hwaccel_get_buffer)(AVCodecContext *s, AVFrame *frame, int flags)
Definition: ffmpeg.h:325
int64_t input_ts_offset
Definition: ffmpeg.h:345
int do_hex_dump
Definition: ffmpeg_opt.c:99
int nb_filter_scripts
Definition: ffmpeg.h:198
const char * name
Definition: ffmpeg.h:70
uint64_t packets_written
Definition: ffmpeg.h:457
AVCodec.
Definition: avcodec.h:3472
SpecifierOpt * filters
Definition: ffmpeg.h:195
int print_stats
Definition: ffmpeg_opt.c:106
float dts_error_threshold
Definition: ffmpeg_opt.c:90
int64_t start_time
start time in microseconds == AV_TIME_BASE units
Definition: ffmpeg.h:477
int index
Definition: ffmpeg.h:238
uint64_t data_size
Definition: ffmpeg.h:455
SpecifierOpt * qscale
Definition: ffmpeg.h:169
SpecifierOpt * frame_pix_fmts
Definition: ffmpeg.h:110
SpecifierOpt * chroma_intra_matrices
Definition: ffmpeg.h:183
struct FilterGraph * graph
Definition: ffmpeg.h:222
SpecifierOpt * intra_matrices
Definition: ffmpeg.h:179
int encoding_needed
Definition: ffmpeg.h:387
Format I/O context.
Definition: avformat.h:1273
void remove_avoptions(AVDictionary **a, AVDictionary *b)
Definition: ffmpeg.c:587
uint64_t samples_decoded
Definition: ffmpeg.h:337
struct InputStream * ist
Definition: ffmpeg.h:221
enum HWAccelID id
Definition: ffmpeg.h:72
uint64_t frames_decoded
Definition: ffmpeg.h:336
AVFilterGraph * graph
Definition: ffmpeg.h:241
Public dictionary API.
char * logfile_prefix
Definition: ffmpeg.h:427
int vdpau_init(AVCodecContext *s)
Definition: ffmpeg_vdpau.c:353
int user_set_discard
Definition: ffmpeg.h:254
int copy_initial_nonkeyframes
Definition: ffmpeg.h:445
uint8_t
AVDictionary * sws_dict
Definition: ffmpeg.h:436
int stdin_interaction
Definition: ffmpeg_opt.c:108
FILE * logfile
Definition: ffmpeg.h:428
AVDictionary * opts
Definition: ffmpeg.h:474
int last_droped
Definition: ffmpeg.h:404
Definition: eval.c:144
int do_benchmark
Definition: ffmpeg_opt.c:97
int audio_sync_method
Definition: ffmpeg_opt.c:93
int nb_max_frames
Definition: ffmpeg.h:162
int shortest
Definition: ffmpeg.h:480
int nb_output_streams
Definition: ffmpeg.c:146
static AVFrame * frame
int nb_streams
Definition: ffmpeg.h:351
int sync_file_index
Definition: ffmpeg.h:81
AVDictionary * resample_opts
Definition: ffmpeg.h:438
int seek_timestamp
Definition: ffmpeg.h:97
void reset_options(OptionsContext *o, int is_input)
AVFilterContext * filter
Definition: ffmpeg.h:227
SpecifierOpt * bitstream_filters
Definition: ffmpeg.h:163
int resample_sample_rate
Definition: ffmpeg.h:290
int init_complex_filtergraph(FilterGraph *fg)
AVCodec * dec
Definition: ffmpeg.h:260
int top_field_first
Definition: ffmpeg.h:281
int file_index
Definition: ffmpeg.h:251
const OptionDef options[]
Definition: ffserver.c:3807
struct InputStream::sub2video sub2video
int resample_pix_fmt
Definition: ffmpeg.h:287
int resample_height
Definition: ffmpeg.h:285
int64_t filter_in_rescale_delta_last
Definition: ffmpeg.h:274
int wrap_correction_done
Definition: ffmpeg.h:272
int ist_in_filtergraph(FilterGraph *fg, InputStream *ist)
unsigned m
Definition: audioconvert.c:187
SpecifierOpt * disposition
Definition: ffmpeg.h:215
int64_t next_dts
Definition: ffmpeg.h:267
Callback for checking whether to abort blocking functions.
Definition: avio.h:50
libswresample public header
int nb_top_field_first
Definition: ffmpeg.h:186
int rate_emu
Definition: ffmpeg.h:354
int nb_discard
Definition: ffmpeg.h:214
enum AVPixelFormat hwaccel_pix_fmt
Definition: ffmpeg.h:327
int ffmpeg_parse_options(int argc, char **argv)
Definition: ffmpeg_opt.c:2923
AVFilterContext * filter
Definition: ffmpeg.h:220
void(* hwaccel_uninit)(AVCodecContext *s)
Definition: ffmpeg.h:324
int nb_filters
Definition: ffmpeg.h:196
int64_t start_time
Definition: ffmpeg.h:95
int64_t start
Definition: ffmpeg.h:264
uint64_t nb_packets
Definition: ffmpeg.h:334
int seek_timestamp
Definition: ffmpeg.h:349
int64_t last_mux_dts
Definition: ffmpeg.h:397
int video_sync_method
Definition: ffmpeg_opt.c:94
char * sdp_filename
Definition: ffmpeg_opt.c:86
SpecifierOpt * apad
Definition: ffmpeg.h:211
int last_nb0_frames[3]
Definition: ffmpeg.h:405
int dr1
Definition: ffmpeg.h:308
int nb_hwaccel_devices
Definition: ffmpeg.h:126
AudioChannelMap * audio_channel_maps
Definition: ffmpeg.h:133
int nb_disposition
Definition: ffmpeg.h:216
SpecifierOpt * codec_tags
Definition: ffmpeg.h:165
SpecifierOpt * rc_overrides
Definition: ffmpeg.h:177
int(* init)(AVCodecContext *s)
Definition: ffmpeg.h:71
int video_disable
Definition: ffmpeg.h:150
int nb_input_files
Definition: ffmpeg.c:143
int force_fps
Definition: ffmpeg.h:409
int nb_codec_names
Definition: ffmpeg.h:101
Libavcodec external API header.
int qp_hist
Definition: ffmpeg_opt.c:107
StreamMap * stream_maps
Definition: ffmpeg.h:131
float frame_drop_threshold
Definition: ffmpeg_opt.c:95
uint64_t limit_filesize
Definition: ffmpeg.h:145
const char * format
Definition: ffmpeg.h:98
int64_t error[4]
Definition: ffmpeg.h:469
int nb_passlogfiles
Definition: ffmpeg.h:208
int nb_force_fps
Definition: ffmpeg.h:174
OutputFilter * filter
Definition: ffmpeg.h:430
AVRational frame_aspect_ratio
Definition: ffmpeg.h:413
int nb_sample_fmts
Definition: ffmpeg.h:168
int file_index
Definition: ffmpeg.h:79
int nb_audio_channel_maps
Definition: ffmpeg.h:134
SpecifierOpt * filter_scripts
Definition: ffmpeg.h:197
int nb_attachments
Definition: ffmpeg.h:139
char * linklabel
Definition: ffmpeg.h:83
int nb_ts_scale
Definition: ffmpeg.h:120
SpecifierOpt * audio_channels
Definition: ffmpeg.h:102
int saw_first_ts
Definition: ffmpeg.h:277
int nb_audio_sample_rate
Definition: ffmpeg.h:105
int metadata_chapters_manual
Definition: ffmpeg.h:137
struct OutputStream * ost
Definition: ffmpeg.h:228
int accurate_seek
Definition: ffmpeg.h:116
char * apad
Definition: ffmpeg.h:440
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
SpecifierOpt * pass
Definition: ffmpeg.h:205
SpecifierOpt * audio_sample_rate
Definition: ffmpeg.h:104
double forced_keyframes_expr_const_values[FKF_NB]
Definition: ffmpeg.h:421
void opt_output_file(void *optctx, const char *filename)
int dxva2_init(AVCodecContext *s)
Definition: ffmpeg_dxva2.c:598
SpecifierOpt * dump_attachment
Definition: ffmpeg.h:121
void assert_avoptions(AVDictionary *m)
Definition: ffmpeg.c:596
SpecifierOpt * canvas_sizes
Definition: ffmpeg.h:203
int nb_codec_tags
Definition: ffmpeg.h:166
int64_t last_ts
Definition: ffmpeg.h:347
SpecifierOpt * metadata_map
Definition: ffmpeg.h:187
int do_pkt_dump
Definition: ffmpeg_opt.c:100
int64_t max_frames
Definition: ffmpeg.h:401
int(* hwaccel_retrieve_data)(AVCodecContext *s, AVFrame *frame)
Definition: ffmpeg.h:326
int audio_channels_mapped
Definition: ffmpeg.h:425
SpecifierOpt * copy_prior_start
Definition: ffmpeg.h:193
SpecifierOpt * frame_aspect_ratios
Definition: ffmpeg.h:175
SpecifierOpt * frame_sizes
Definition: ffmpeg.h:108
int stream_idx
Definition: ffmpeg.h:87
int nb_hwaccels
Definition: ffmpeg.h:124
int start_at_zero
Definition: ffmpeg_opt.c:102
int ret
Definition: ffmpeg.h:297
int audio_volume
Definition: ffmpeg_opt.c:92
Stream structure.
Definition: avformat.h:842
A linked-list of the inputs/outputs of the filter chain.
Definition: avfilter.h:1355
InputFilter ** filters
Definition: ffmpeg.h:312
int fix_sub_duration
Definition: ffmpeg.h:294
int64_t recording_time
Definition: ffmpeg.h:350
SpecifierOpt * hwaccels
Definition: ffmpeg.h:123
Definition: ffmpeg.h:69
SpecifierOpt * frame_rates
Definition: ffmpeg.h:106
int nb_presets
Definition: ffmpeg.h:190
int ost_index
Definition: ffmpeg.h:475
struct InputStream * sync_ist
Definition: ffmpeg.h:391
double ts_scale
Definition: ffmpeg.h:276
int64_t recording_time
Definition: ffmpeg.h:143
int unavailable
Definition: ffmpeg.h:442
void term_exit(void)
Definition: ffmpeg.c:311
int chapters_input_file
Definition: ffmpeg.h:141
int64_t stop_time
Definition: ffmpeg.h:144
float max_error_rate
Definition: ffmpeg_opt.c:110
uint64_t frames_encoded
Definition: ffmpeg.h:459
int nb_copy_prior_start
Definition: ffmpeg.h:194
OutputStream ** output_streams
Definition: ffmpeg.c:145
int ist_index
Definition: ffmpeg.h:344
const char * graph_desc
Definition: ffmpeg.h:239
int guess_layout_max
Definition: ffmpeg.h:282
int64_t start_time
Definition: ffmpeg.h:348
main external API structure.
Definition: avcodec.h:1502
InputFile ** input_files
Definition: ffmpeg.c:142
int rate_emu
Definition: ffmpeg.h:115
int metadata_streams_manual
Definition: ffmpeg.h:136
const char * attachment_filename
Definition: ffmpeg.h:444
int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
a very simple circular buffer FIFO implementation
AVCodecContext * enc_ctx
Definition: ffmpeg.h:399
int audio_disable
Definition: ffmpeg.h:151
int64_t input_ts_offset
Definition: ffmpeg.h:114
int nb_filtergraphs
Definition: ffmpeg.c:151
AVFrame * decoded_frame
Definition: ffmpeg.h:261
int nb_bitstream_filters
Definition: ffmpeg.h:164
SpecifierOpt * top_field_first
Definition: ffmpeg.h:185
AVCodecContext * dec_ctx
Definition: ffmpeg.h:259
AVStream * st
Definition: ffmpeg.h:252
int * audio_channels_map
Definition: ffmpeg.h:424
int configure_filtergraph(FilterGraph *fg)
rational number numerator/denominator
Definition: rational.h:43
int file_index
Definition: ffmpeg.h:383
int metadata_global_manual
Definition: ffmpeg.h:135
int64_t sync_opts
Definition: ffmpeg.h:392
char * vstats_filename
Definition: ffmpeg_opt.c:85
SpecifierOpt * force_fps
Definition: ffmpeg.h:173
char * disposition
Definition: ffmpeg.h:447
AVMediaType
Definition: avutil.h:191
int nb_fix_sub_duration
Definition: ffmpeg.h:202
int nb_inter_matrices
Definition: ffmpeg.h:182
int nb_streams_warn
Definition: ffmpeg.h:353
AVDictionary * decoder_opts
Definition: ffmpeg.h:279
int shortest
Definition: ffmpeg.h:148
int autorotate
Definition: ffmpeg.h:284
int showed_multi_packet_warning
Definition: ffmpeg.h:278
int frame_bits_per_raw_sample
Definition: ffmpeg_opt.c:109
int vdpau_api_ver
Definition: ffmpeg_vdpau.c:62
int64_t ts_offset
Definition: ffmpeg.h:346
int nb_qscale
Definition: ffmpeg.h:170
char * filters_script
filtergraph script associated to the -filter_script option
Definition: ffmpeg.h:433
SpecifierOpt * hwaccel_devices
Definition: ffmpeg.h:125
int nb_input_streams
Definition: ffmpeg.c:141
float audio_drift_threshold
Definition: ffmpeg_opt.c:88
AVFrame * filtered_frame
Definition: ffmpeg.h:402
int nb_autorotate
Definition: ffmpeg.h:128
int nb_audio_channels
Definition: ffmpeg.h:103
int source_index
Definition: ffmpeg.h:385
InputStream ** input_streams
Definition: ffmpeg.c:140
int copy_prior_start
Definition: ffmpeg.h:446
SpecifierOpt * metadata
Definition: ffmpeg.h:159
AVIOContext * progress_avio
Definition: ffmpeg.c:136
int nb_filters
Definition: ffmpeg.h:313
static int flags
Definition: cpu.c:47
AVExpr * forced_keyframes_pexpr
Definition: ffmpeg.h:420
int64_t dts
dts of the last packet read for this stream (in AV_TIME_BASE units)
Definition: ffmpeg.h:268
int forced_kf_count
Definition: ffmpeg.h:417
int resample_sample_fmt
Definition: ffmpeg.h:289
int nb_intra_matrices
Definition: ffmpeg.h:180
OSTFinished finished
Definition: ffmpeg.h:441
char * forced_keyframes
Definition: ffmpeg.h:419
int nb_frame_rates
Definition: ffmpeg.h:107
uint64_t data_size
Definition: ffmpeg.h:332
const AVIOInterruptCB int_cb
Definition: ffmpeg.c:464
int resample_width
Definition: ffmpeg.h:286
int vda_init(AVCodecContext *s)
int64_t next_pts
synthetic pts for the next decode frame (in AV_TIME_BASE units)
Definition: ffmpeg.h:270
Main libavformat public API header.
int reconfiguration
Definition: ffmpeg.h:242
struct FilterGraph * graph
Definition: ffmpeg.h:229
uint64_t limit_filesize
Definition: ffmpeg.h:478
SpecifierOpt * presets
Definition: ffmpeg.h:189
int reinit_filters
Definition: ffmpeg.h:315
int nb_frame_sizes
Definition: ffmpeg.h:109
rational numbers
OptionGroup * g
Definition: ffmpeg.h:92
SpecifierOpt * inter_matrices
Definition: ffmpeg.h:181
const char *const forced_keyframes_const_names[]
Definition: ffmpeg.c:117
AVStream * st
Definition: muxing.c:54
SpecifierOpt * forced_key_frames
Definition: ffmpeg.h:171
uint64_t samples_encoded
Definition: ffmpeg.h:460
const char ** attachments
Definition: ffmpeg.h:138
AVFrame * last_frame
Definition: ffmpeg.h:403
int copy_ts
Definition: ffmpeg_opt.c:101
AVFormatContext * ctx
Definition: ffmpeg.h:341
int pict_type
Definition: ffmpeg.h:466
int stream_index
Definition: ffmpeg.h:80
AVCodec * enc
Definition: ffmpeg.h:400
AVSubtitle subtitle
Definition: ffmpeg.h:298
enum AVPixelFormat pix_fmt
Definition: ffmpeg.h:73
int eof_reached
Definition: ffmpeg.h:342
int nb_metadata_map
Definition: ffmpeg.h:188
int forced_kf_index
Definition: ffmpeg.h:418
int nb_rc_overrides
Definition: ffmpeg.h:178
int do_deinterlace
Definition: ffmpeg_opt.c:96
SpecifierOpt * fix_sub_duration
Definition: ffmpeg.h:201
Definition: ffmpeg.h:372
pixel format definitions
char * avfilter
Definition: ffmpeg.h:431
SpecifierOpt * autorotate
Definition: ffmpeg.h:127
uint8_t * name
Definition: ffmpeg.h:223
float dts_delta_threshold
Definition: ffmpeg_opt.c:89
void * hwaccel_ctx
Definition: ffmpeg.h:323
int guess_input_channel_layout(InputStream *ist)
Definition: ffmpeg.c:1914
int top_field_first
Definition: ffmpeg.h:410
OutputFilter ** outputs
Definition: ffmpeg.h:246
SpecifierOpt * max_frames
Definition: ffmpeg.h:161
int nb_copy_initial_nonkeyframes
Definition: ffmpeg.h:192
int disabled
Definition: ffmpeg.h:78
AVDictionary * bsf_args
Definition: ffmpeg.h:439
AVFormatContext * ctx
Definition: ffmpeg.h:473
int nb_output_files
Definition: ffmpeg.c:148
SpecifierOpt * codec_names
Definition: ffmpeg.h:100
void show_usage(void)
Definition: ffmpeg_opt.c:2873
int thread_queue_size
Definition: ffmpeg.h:117
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(constint16_t *) pi >>8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(constint32_t *) pi >>24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(constfloat *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(constfloat *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(constfloat *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(constdouble *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(constdouble *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(constdouble *) pi *(1U<< 31))))#defineSET_CONV_FUNC_GROUP(ofmt, ifmt) staticvoidset_generic_function(AudioConvert *ac){}voidff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enumAVSampleFormatout_fmt, enumAVSampleFormatin_fmt, intchannels, intsample_rate, intapply_map){AudioConvert *ac;intin_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) returnNULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt)>2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);returnNULL;}returnac;}in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}elseif(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;elseac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);returnac;}intff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){intuse_generic=1;intlen=in->nb_samples;intp;if(ac->dc){av_log(ac->avr, AV_LOG_TRACE,"%dsamples-audio_convert:%sto%s(dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));returnff_convert_dither(ac-> out
An instance of a filter.
Definition: avfilter.h:633
char * hwaccel_device
Definition: ffmpeg.h:319
AVDictionary * encoder_opts
Definition: ffmpeg.h:435
InputFilter ** inputs
Definition: ffmpeg.h:244
char * videotoolbox_pixfmt
enum AVPixelFormat hwaccel_retrieved_pix_fmt
Definition: ffmpeg.h:328
int sync_stream_index
Definition: ffmpeg.h:82
int copy_tb
Definition: ffmpeg_opt.c:103
int discard
Definition: ffmpeg.h:253
enum HWAccelID hwaccel_id
Definition: ffmpeg.h:318
int64_t first_pts
Definition: ffmpeg.h:395
int nb_inputs
Definition: ffmpeg.h:245
int index
Definition: ffmpeg.h:384
AVPixelFormat
Pixel format.
Definition: pixfmt.h:61
uint64_t resample_channel_layout
Definition: ffmpeg.h:292
OSTFinished
Definition: ffmpeg.h:377
enum AVMediaType type
Definition: ffmpeg.h:234
int nb_reinit_filters
Definition: ffmpeg.h:200
int debug_ts
Definition: ffmpeg_opt.c:104
int nb_guess_layout_max
Definition: ffmpeg.h:210
void term_init(void)
Definition: ffmpeg.c:369
int nb_frame_aspect_ratios
Definition: ffmpeg.h:176
const HWAccel hwaccels[]
Definition: ffmpeg_opt.c:69
int videotoolbox_init(AVCodecContext *s)
Definition: ffmpeg.h:371
simple arithmetic expression evaluator
int subtitle_disable
Definition: ffmpeg.h:152
struct InputStream::@25 prev_sub