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