ffmpeg.h 21 KB

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