ffmpeg.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  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. #ifndef FFTOOLS_FFMPEG_H
  19. #define FFTOOLS_FFMPEG_H
  20. #include "config.h"
  21. #include <stdint.h>
  22. #include <stdio.h>
  23. #include <signal.h>
  24. #include "cmdutils.h"
  25. #include "sync_queue.h"
  26. #include "libavformat/avformat.h"
  27. #include "libavformat/avio.h"
  28. #include "libavcodec/avcodec.h"
  29. #include "libavcodec/bsf.h"
  30. #include "libavfilter/avfilter.h"
  31. #include "libavutil/avutil.h"
  32. #include "libavutil/dict.h"
  33. #include "libavutil/eval.h"
  34. #include "libavutil/fifo.h"
  35. #include "libavutil/hwcontext.h"
  36. #include "libavutil/pixfmt.h"
  37. #include "libavutil/rational.h"
  38. #include "libavutil/thread.h"
  39. #include "libavutil/threadmessage.h"
  40. #include "libswresample/swresample.h"
  41. enum VideoSyncMethod {
  42. VSYNC_AUTO = -1,
  43. VSYNC_PASSTHROUGH,
  44. VSYNC_CFR,
  45. VSYNC_VFR,
  46. VSYNC_VSCFR,
  47. VSYNC_DROP,
  48. };
  49. #define MAX_STREAMS 1024 /* arbitrary sanity check value */
  50. enum HWAccelID {
  51. HWACCEL_NONE = 0,
  52. HWACCEL_AUTO,
  53. HWACCEL_GENERIC,
  54. };
  55. typedef struct HWDevice {
  56. const char *name;
  57. enum AVHWDeviceType type;
  58. AVBufferRef *device_ref;
  59. } HWDevice;
  60. /* select an input stream for an output stream */
  61. typedef struct StreamMap {
  62. int disabled; /* 1 is this mapping is disabled by a negative map */
  63. int file_index;
  64. int stream_index;
  65. int sync_file_index;
  66. int sync_stream_index;
  67. char *linklabel; /* name of an output link, for mapping lavfi outputs */
  68. } StreamMap;
  69. typedef struct {
  70. int file_idx, stream_idx, channel_idx; // input
  71. int ofile_idx, ostream_idx; // output
  72. } AudioChannelMap;
  73. typedef struct OptionsContext {
  74. OptionGroup *g;
  75. /* input/output options */
  76. int64_t start_time;
  77. int64_t start_time_eof;
  78. int seek_timestamp;
  79. const char *format;
  80. SpecifierOpt *codec_names;
  81. int nb_codec_names;
  82. SpecifierOpt *audio_ch_layouts;
  83. int nb_audio_ch_layouts;
  84. SpecifierOpt *audio_channels;
  85. int nb_audio_channels;
  86. SpecifierOpt *audio_sample_rate;
  87. int nb_audio_sample_rate;
  88. SpecifierOpt *frame_rates;
  89. int nb_frame_rates;
  90. SpecifierOpt *max_frame_rates;
  91. int nb_max_frame_rates;
  92. SpecifierOpt *frame_sizes;
  93. int nb_frame_sizes;
  94. SpecifierOpt *frame_pix_fmts;
  95. int nb_frame_pix_fmts;
  96. /* input options */
  97. int64_t input_ts_offset;
  98. int loop;
  99. int rate_emu;
  100. float readrate;
  101. int accurate_seek;
  102. int thread_queue_size;
  103. int input_sync_ref;
  104. SpecifierOpt *ts_scale;
  105. int nb_ts_scale;
  106. SpecifierOpt *dump_attachment;
  107. int nb_dump_attachment;
  108. SpecifierOpt *hwaccels;
  109. int nb_hwaccels;
  110. SpecifierOpt *hwaccel_devices;
  111. int nb_hwaccel_devices;
  112. SpecifierOpt *hwaccel_output_formats;
  113. int nb_hwaccel_output_formats;
  114. SpecifierOpt *autorotate;
  115. int nb_autorotate;
  116. /* output options */
  117. StreamMap *stream_maps;
  118. int nb_stream_maps;
  119. AudioChannelMap *audio_channel_maps; /* one info entry per -map_channel */
  120. int nb_audio_channel_maps; /* number of (valid) -map_channel settings */
  121. int metadata_global_manual;
  122. int metadata_streams_manual;
  123. int metadata_chapters_manual;
  124. const char **attachments;
  125. int nb_attachments;
  126. int chapters_input_file;
  127. int64_t recording_time;
  128. int64_t stop_time;
  129. int64_t limit_filesize;
  130. float mux_preload;
  131. float mux_max_delay;
  132. float shortest_buf_duration;
  133. int shortest;
  134. int bitexact;
  135. int video_disable;
  136. int audio_disable;
  137. int subtitle_disable;
  138. int data_disable;
  139. /* indexed by output file stream index */
  140. int *streamid_map;
  141. int nb_streamid_map;
  142. SpecifierOpt *metadata;
  143. int nb_metadata;
  144. SpecifierOpt *max_frames;
  145. int nb_max_frames;
  146. SpecifierOpt *bitstream_filters;
  147. int nb_bitstream_filters;
  148. SpecifierOpt *codec_tags;
  149. int nb_codec_tags;
  150. SpecifierOpt *sample_fmts;
  151. int nb_sample_fmts;
  152. SpecifierOpt *qscale;
  153. int nb_qscale;
  154. SpecifierOpt *forced_key_frames;
  155. int nb_forced_key_frames;
  156. SpecifierOpt *fps_mode;
  157. int nb_fps_mode;
  158. SpecifierOpt *force_fps;
  159. int nb_force_fps;
  160. SpecifierOpt *frame_aspect_ratios;
  161. int nb_frame_aspect_ratios;
  162. SpecifierOpt *rc_overrides;
  163. int nb_rc_overrides;
  164. SpecifierOpt *intra_matrices;
  165. int nb_intra_matrices;
  166. SpecifierOpt *inter_matrices;
  167. int nb_inter_matrices;
  168. SpecifierOpt *chroma_intra_matrices;
  169. int nb_chroma_intra_matrices;
  170. SpecifierOpt *top_field_first;
  171. int nb_top_field_first;
  172. SpecifierOpt *metadata_map;
  173. int nb_metadata_map;
  174. SpecifierOpt *presets;
  175. int nb_presets;
  176. SpecifierOpt *copy_initial_nonkeyframes;
  177. int nb_copy_initial_nonkeyframes;
  178. SpecifierOpt *copy_prior_start;
  179. int nb_copy_prior_start;
  180. SpecifierOpt *filters;
  181. int nb_filters;
  182. SpecifierOpt *filter_scripts;
  183. int nb_filter_scripts;
  184. SpecifierOpt *reinit_filters;
  185. int nb_reinit_filters;
  186. SpecifierOpt *fix_sub_duration;
  187. int nb_fix_sub_duration;
  188. SpecifierOpt *canvas_sizes;
  189. int nb_canvas_sizes;
  190. SpecifierOpt *pass;
  191. int nb_pass;
  192. SpecifierOpt *passlogfiles;
  193. int nb_passlogfiles;
  194. SpecifierOpt *max_muxing_queue_size;
  195. int nb_max_muxing_queue_size;
  196. SpecifierOpt *muxing_queue_data_threshold;
  197. int nb_muxing_queue_data_threshold;
  198. SpecifierOpt *guess_layout_max;
  199. int nb_guess_layout_max;
  200. SpecifierOpt *apad;
  201. int nb_apad;
  202. SpecifierOpt *discard;
  203. int nb_discard;
  204. SpecifierOpt *disposition;
  205. int nb_disposition;
  206. SpecifierOpt *program;
  207. int nb_program;
  208. SpecifierOpt *time_bases;
  209. int nb_time_bases;
  210. SpecifierOpt *enc_time_bases;
  211. int nb_enc_time_bases;
  212. SpecifierOpt *autoscale;
  213. int nb_autoscale;
  214. SpecifierOpt *bits_per_raw_sample;
  215. int nb_bits_per_raw_sample;
  216. } OptionsContext;
  217. typedef struct InputFilter {
  218. AVFilterContext *filter;
  219. struct InputStream *ist;
  220. struct FilterGraph *graph;
  221. uint8_t *name;
  222. enum AVMediaType type; // AVMEDIA_TYPE_SUBTITLE for sub2video
  223. AVFifo *frame_queue;
  224. // parameters configured for this input
  225. int format;
  226. int width, height;
  227. AVRational sample_aspect_ratio;
  228. int sample_rate;
  229. AVChannelLayout ch_layout;
  230. AVBufferRef *hw_frames_ctx;
  231. int32_t *displaymatrix;
  232. int eof;
  233. } InputFilter;
  234. typedef struct OutputFilter {
  235. AVFilterContext *filter;
  236. struct OutputStream *ost;
  237. struct FilterGraph *graph;
  238. uint8_t *name;
  239. /* temporary storage until stream maps are processed */
  240. AVFilterInOut *out_tmp;
  241. enum AVMediaType type;
  242. /* desired output stream properties */
  243. int width, height;
  244. AVRational frame_rate;
  245. int format;
  246. int sample_rate;
  247. AVChannelLayout ch_layout;
  248. // those are only set if no format is specified and the encoder gives us multiple options
  249. // They point directly to the relevant lists of the encoder.
  250. const int *formats;
  251. const AVChannelLayout *ch_layouts;
  252. const int *sample_rates;
  253. } OutputFilter;
  254. typedef struct FilterGraph {
  255. int index;
  256. const char *graph_desc;
  257. AVFilterGraph *graph;
  258. int reconfiguration;
  259. // true when the filtergraph contains only meta filters
  260. // that do not modify the frame data
  261. int is_meta;
  262. InputFilter **inputs;
  263. int nb_inputs;
  264. OutputFilter **outputs;
  265. int nb_outputs;
  266. } FilterGraph;
  267. typedef struct InputStream {
  268. int file_index;
  269. AVStream *st;
  270. int discard; /* true if stream data should be discarded */
  271. int user_set_discard;
  272. int decoding_needed; /* non zero if the packets must be decoded in 'raw_fifo', see DECODING_FOR_* */
  273. #define DECODING_FOR_OST 1
  274. #define DECODING_FOR_FILTER 2
  275. int processing_needed; /* non zero if the packets must be processed */
  276. AVCodecContext *dec_ctx;
  277. const AVCodec *dec;
  278. AVFrame *decoded_frame;
  279. AVPacket *pkt;
  280. int64_t prev_pkt_pts;
  281. int64_t start; /* time when read started */
  282. /* predicted dts of the next packet read for this stream or (when there are
  283. * several frames in a packet) of the next frame in current packet (in AV_TIME_BASE units) */
  284. int64_t next_dts;
  285. int64_t first_dts; ///< dts of the first packet read for this stream (in AV_TIME_BASE units)
  286. int64_t dts; ///< dts of the last packet read for this stream (in AV_TIME_BASE units)
  287. int64_t next_pts; ///< synthetic pts for the next decode frame (in AV_TIME_BASE units)
  288. int64_t pts; ///< current pts of the decoded frame (in AV_TIME_BASE units)
  289. int wrap_correction_done;
  290. int64_t filter_in_rescale_delta_last;
  291. int64_t min_pts; /* pts with the smallest value in a current stream */
  292. int64_t max_pts; /* pts with the higher value in a current stream */
  293. // when forcing constant input framerate through -r,
  294. // this contains the pts that will be given to the next decoded frame
  295. int64_t cfr_next_pts;
  296. int64_t nb_samples; /* number of samples in the last decoded audio frame before looping */
  297. double ts_scale;
  298. int saw_first_ts;
  299. AVDictionary *decoder_opts;
  300. AVRational framerate; /* framerate forced with -r */
  301. int top_field_first;
  302. int guess_layout_max;
  303. int autorotate;
  304. int fix_sub_duration;
  305. struct { /* previous decoded subtitle and related variables */
  306. int got_output;
  307. int ret;
  308. AVSubtitle subtitle;
  309. } prev_sub;
  310. struct sub2video {
  311. int64_t last_pts;
  312. int64_t end_pts;
  313. AVFifo *sub_queue; ///< queue of AVSubtitle* before filter init
  314. AVFrame *frame;
  315. int w, h;
  316. unsigned int initialize; ///< marks if sub2video_update should force an initialization
  317. } sub2video;
  318. /* decoded data from this stream goes into all those filters
  319. * currently video and audio only */
  320. InputFilter **filters;
  321. int nb_filters;
  322. int reinit_filters;
  323. /* hwaccel options */
  324. enum HWAccelID hwaccel_id;
  325. enum AVHWDeviceType hwaccel_device_type;
  326. char *hwaccel_device;
  327. enum AVPixelFormat hwaccel_output_format;
  328. /* hwaccel context */
  329. void *hwaccel_ctx;
  330. void (*hwaccel_uninit)(AVCodecContext *s);
  331. int (*hwaccel_retrieve_data)(AVCodecContext *s, AVFrame *frame);
  332. enum AVPixelFormat hwaccel_pix_fmt;
  333. enum AVPixelFormat hwaccel_retrieved_pix_fmt;
  334. /* stats */
  335. // combined size of all the packets read
  336. uint64_t data_size;
  337. /* number of packets successfully read for this stream */
  338. uint64_t nb_packets;
  339. // number of frames/samples retrieved from the decoder
  340. uint64_t frames_decoded;
  341. uint64_t samples_decoded;
  342. int64_t *dts_buffer;
  343. int nb_dts_buffer;
  344. int got_output;
  345. } InputStream;
  346. typedef struct InputFile {
  347. AVFormatContext *ctx;
  348. int eof_reached; /* true if eof reached */
  349. int eagain; /* true if last read attempt returned EAGAIN */
  350. int ist_index; /* index of first stream in input_streams */
  351. int loop; /* set number of times input stream should be looped */
  352. int64_t duration; /* actual duration of the longest stream in a file
  353. at the moment when looping happens */
  354. AVRational time_base; /* time base of the duration */
  355. int64_t input_ts_offset;
  356. int input_sync_ref;
  357. int64_t ts_offset;
  358. int64_t last_ts;
  359. int64_t start_time; /* user-specified start time in AV_TIME_BASE or AV_NOPTS_VALUE */
  360. int64_t recording_time;
  361. int nb_streams; /* number of stream that ffmpeg is aware of; may be different
  362. from ctx.nb_streams if new streams appear during av_read_frame() */
  363. int nb_streams_warn; /* number of streams that the user was warned of */
  364. int rate_emu;
  365. float readrate;
  366. int accurate_seek;
  367. AVPacket *pkt;
  368. AVThreadMessageQueue *in_thread_queue;
  369. pthread_t thread; /* thread reading from this file */
  370. int non_blocking; /* reading packets from the thread should not block */
  371. int joined; /* the thread has been joined */
  372. int thread_queue_size; /* maximum number of queued packets */
  373. } InputFile;
  374. enum forced_keyframes_const {
  375. FKF_N,
  376. FKF_N_FORCED,
  377. FKF_PREV_FORCED_N,
  378. FKF_PREV_FORCED_T,
  379. FKF_T,
  380. FKF_NB
  381. };
  382. #define ABORT_ON_FLAG_EMPTY_OUTPUT (1 << 0)
  383. #define ABORT_ON_FLAG_EMPTY_OUTPUT_STREAM (1 << 1)
  384. extern const char *const forced_keyframes_const_names[];
  385. typedef enum {
  386. ENCODER_FINISHED = 1,
  387. MUXER_FINISHED = 2,
  388. } OSTFinished ;
  389. typedef struct OutputStream {
  390. int file_index; /* file index */
  391. int index; /* stream index in the output file */
  392. int source_index; /* InputStream index */
  393. AVStream *st; /* stream in the output file */
  394. int encoding_needed; /* true if encoding needed for this stream */
  395. /* number of frames emitted by the video-encoding sync code */
  396. int64_t vsync_frame_number;
  397. /* input pts and corresponding output pts
  398. for A/V sync */
  399. struct InputStream *sync_ist; /* input stream to sync against */
  400. int64_t sync_opts; /* output frame counter, could be changed to some true timestamp */ // FIXME look at frame_number
  401. /* pts of the first frame encoded for this stream, used for limiting
  402. * recording time */
  403. int64_t first_pts;
  404. /* dts of the last packet sent to the muxing queue, in AV_TIME_BASE_Q */
  405. int64_t last_mux_dts;
  406. /* pts of the last frame received from the filters, in AV_TIME_BASE_Q */
  407. int64_t last_filter_pts;
  408. // the timebase of the packets sent to the muxer
  409. AVRational mux_timebase;
  410. AVRational enc_timebase;
  411. AVBSFContext *bsf_ctx;
  412. AVCodecContext *enc_ctx;
  413. AVCodecParameters *ref_par; /* associated input codec parameters with encoders options applied */
  414. const AVCodec *enc;
  415. int64_t max_frames;
  416. AVFrame *filtered_frame;
  417. AVFrame *last_frame;
  418. AVFrame *sq_frame;
  419. AVPacket *pkt;
  420. int64_t last_dropped;
  421. int64_t last_nb0_frames[3];
  422. void *hwaccel_ctx;
  423. /* video only */
  424. AVRational frame_rate;
  425. AVRational max_frame_rate;
  426. enum VideoSyncMethod vsync_method;
  427. int is_cfr;
  428. const char *fps_mode;
  429. int force_fps;
  430. int top_field_first;
  431. int rotate_overridden;
  432. int autoscale;
  433. int bitexact;
  434. int bits_per_raw_sample;
  435. double rotate_override_value;
  436. AVRational frame_aspect_ratio;
  437. /* forced key frames */
  438. int64_t forced_kf_ref_pts;
  439. int64_t *forced_kf_pts;
  440. int forced_kf_count;
  441. int forced_kf_index;
  442. char *forced_keyframes;
  443. AVExpr *forced_keyframes_pexpr;
  444. double forced_keyframes_expr_const_values[FKF_NB];
  445. int dropped_keyframe;
  446. /* audio only */
  447. int *audio_channels_map; /* list of the channels id to pick from the source stream */
  448. int audio_channels_mapped; /* number of channels in audio_channels_map */
  449. char *logfile_prefix;
  450. FILE *logfile;
  451. OutputFilter *filter;
  452. char *avfilter;
  453. char *filters; ///< filtergraph associated to the -filter option
  454. char *filters_script; ///< filtergraph script associated to the -filter_script option
  455. AVDictionary *encoder_opts;
  456. AVDictionary *sws_dict;
  457. AVDictionary *swr_opts;
  458. char *apad;
  459. OSTFinished finished; /* no more packets should be written for this stream */
  460. int unavailable; /* true if the steram is unavailable (possibly temporarily) */
  461. int stream_copy;
  462. // init_output_stream() has been called for this stream
  463. // The encoder and the bitstream filters have been initialized and the stream
  464. // parameters are set in the AVStream.
  465. int initialized;
  466. int inputs_done;
  467. const char *attachment_filename;
  468. int streamcopy_started;
  469. int copy_initial_nonkeyframes;
  470. int copy_prior_start;
  471. char *disposition;
  472. int keep_pix_fmt;
  473. /* stats */
  474. // combined size of all the packets written
  475. uint64_t data_size;
  476. // number of packets send to the muxer
  477. uint64_t packets_written;
  478. // number of frames/samples sent to the encoder
  479. uint64_t frames_encoded;
  480. uint64_t samples_encoded;
  481. // number of packets received from the encoder
  482. uint64_t packets_encoded;
  483. /* packet quality factor */
  484. int quality;
  485. int max_muxing_queue_size;
  486. /* Threshold after which max_muxing_queue_size will be in effect */
  487. size_t muxing_queue_data_threshold;
  488. /* packet picture type */
  489. int pict_type;
  490. /* frame encode sum of squared error values */
  491. int64_t error[4];
  492. int sq_idx_encode;
  493. int sq_idx_mux;
  494. } OutputStream;
  495. typedef struct Muxer Muxer;
  496. typedef struct OutputFile {
  497. int index;
  498. Muxer *mux;
  499. const AVOutputFormat *format;
  500. const char *url;
  501. SyncQueue *sq_encode;
  502. SyncQueue *sq_mux;
  503. int nb_streams;
  504. int ost_index; /* index of the first stream in output_streams */
  505. int64_t recording_time; ///< desired length of the resulting file in microseconds == AV_TIME_BASE units
  506. int64_t start_time; ///< start time in microseconds == AV_TIME_BASE units
  507. int shortest;
  508. int bitexact;
  509. } OutputFile;
  510. extern InputStream **input_streams;
  511. extern int nb_input_streams;
  512. extern InputFile **input_files;
  513. extern int nb_input_files;
  514. extern OutputStream **output_streams;
  515. extern int nb_output_streams;
  516. extern OutputFile **output_files;
  517. extern int nb_output_files;
  518. extern FilterGraph **filtergraphs;
  519. extern int nb_filtergraphs;
  520. extern char *vstats_filename;
  521. extern char *sdp_filename;
  522. extern float audio_drift_threshold;
  523. extern float dts_delta_threshold;
  524. extern float dts_error_threshold;
  525. extern int audio_volume;
  526. extern int audio_sync_method;
  527. extern enum VideoSyncMethod video_sync_method;
  528. extern float frame_drop_threshold;
  529. extern int do_benchmark;
  530. extern int do_benchmark_all;
  531. extern int do_deinterlace;
  532. extern int do_hex_dump;
  533. extern int do_pkt_dump;
  534. extern int copy_ts;
  535. extern int start_at_zero;
  536. extern int copy_tb;
  537. extern int debug_ts;
  538. extern int exit_on_error;
  539. extern int abort_on_flags;
  540. extern int print_stats;
  541. extern int64_t stats_period;
  542. extern int qp_hist;
  543. extern int stdin_interaction;
  544. extern int frame_bits_per_raw_sample;
  545. extern AVIOContext *progress_avio;
  546. extern float max_error_rate;
  547. extern char *filter_nbthreads;
  548. extern int filter_complex_nbthreads;
  549. extern int vstats_version;
  550. extern int auto_conversion_filters;
  551. extern const AVIOInterruptCB int_cb;
  552. extern const OptionDef options[];
  553. #if CONFIG_QSV
  554. extern char *qsv_device;
  555. #endif
  556. extern HWDevice *filter_hw_device;
  557. extern unsigned nb_output_dumped;
  558. extern int main_return_code;
  559. void term_init(void);
  560. void term_exit(void);
  561. void show_usage(void);
  562. void remove_avoptions(AVDictionary **a, AVDictionary *b);
  563. void assert_avoptions(AVDictionary *m);
  564. int guess_input_channel_layout(InputStream *ist);
  565. int configure_filtergraph(FilterGraph *fg);
  566. void check_filter_outputs(void);
  567. int filtergraph_is_simple(FilterGraph *fg);
  568. int init_simple_filtergraph(InputStream *ist, OutputStream *ost);
  569. int init_complex_filtergraph(FilterGraph *fg);
  570. void sub2video_update(InputStream *ist, int64_t heartbeat_pts, AVSubtitle *sub);
  571. int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame);
  572. int ffmpeg_parse_options(int argc, char **argv);
  573. int videotoolbox_init(AVCodecContext *s);
  574. int qsv_init(AVCodecContext *s);
  575. HWDevice *hw_device_get_by_name(const char *name);
  576. int hw_device_init_from_string(const char *arg, HWDevice **dev);
  577. void hw_device_free_all(void);
  578. int hw_device_setup_for_decode(InputStream *ist);
  579. int hw_device_setup_for_encode(OutputStream *ost);
  580. int hw_device_setup_for_filter(FilterGraph *fg);
  581. int hwaccel_decode_init(AVCodecContext *avctx);
  582. int of_muxer_init(OutputFile *of, AVFormatContext *fc,
  583. AVDictionary *opts, int64_t limit_filesize);
  584. /* open the muxer when all the streams are initialized */
  585. int of_check_init(OutputFile *of);
  586. int of_write_trailer(OutputFile *of);
  587. void of_close(OutputFile **pof);
  588. int of_submit_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost);
  589. int of_finished(OutputFile *of);
  590. int64_t of_filesize(OutputFile *of);
  591. AVChapter * const *
  592. of_get_chapters(OutputFile *of, unsigned int *nb_chapters);
  593. #endif /* FFTOOLS_FFMPEG_H */