FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
ffmpeg.h File Reference
#include "config.h"
#include <stdint.h>
#include <stdio.h>
#include <signal.h>
#include "cmdutils.h"
#include "libavformat/avformat.h"
#include "libavformat/avio.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/bsf.h"
#include "libavfilter/avfilter.h"
#include "libavutil/avutil.h"
#include "libavutil/dict.h"
#include "libavutil/eval.h"
#include "libavutil/fifo.h"
#include "libavutil/hwcontext.h"
#include "libavutil/pixfmt.h"
#include "libavutil/rational.h"
#include "libavutil/thread.h"
#include "libavutil/threadmessage.h"
#include "libswresample/swresample.h"

Go to the source code of this file.

Data Structures

struct  HWDevice
 
struct  StreamMap
 
struct  AudioChannelMap
 
struct  OptionsContext
 
struct  InputFilter
 
struct  OutputFilter
 
struct  FilterGraph
 
struct  InputStream
 
struct  InputStream::sub2video
 
struct  InputFile
 
struct  OutputStream
 
struct  OutputFile
 

Macros

#define MAX_STREAMS   1024 /* arbitrary sanity check value */
 
#define DECODING_FOR_OST   1
 
#define DECODING_FOR_FILTER   2
 
#define ABORT_ON_FLAG_EMPTY_OUTPUT   (1 << 0)
 
#define ABORT_ON_FLAG_EMPTY_OUTPUT_STREAM   (1 << 1)
 

Enumerations

enum  VideoSyncMethod {
  VSYNC_AUTO = -1, VSYNC_PASSTHROUGH, VSYNC_CFR, VSYNC_VFR,
  VSYNC_VSCFR, VSYNC_DROP
}
 
enum  HWAccelID { HWACCEL_NONE = 0, HWACCEL_AUTO, HWACCEL_GENERIC }
 
enum  forced_keyframes_const {
  FKF_N, FKF_N_FORCED, FKF_PREV_FORCED_N, FKF_PREV_FORCED_T,
  FKF_T, FKF_NB
}
 
enum  OSTFinished { ENCODER_FINISHED = 1, MUXER_FINISHED = 2 }
 

Functions

void term_init (void)
 
void term_exit (void)
 
void show_usage (void)
 
void remove_avoptions (AVDictionary **a, AVDictionary *b)
 
void assert_avoptions (AVDictionary *m)
 
int guess_input_channel_layout (InputStream *ist)
 
int configure_filtergraph (FilterGraph *fg)
 
void check_filter_outputs (void)
 
int filtergraph_is_simple (FilterGraph *fg)
 
int init_simple_filtergraph (InputStream *ist, OutputStream *ost)
 
int init_complex_filtergraph (FilterGraph *fg)
 
void sub2video_update (InputStream *ist, int64_t heartbeat_pts, AVSubtitle *sub)
 
int ifilter_parameters_from_frame (InputFilter *ifilter, const AVFrame *frame)
 
int ffmpeg_parse_options (int argc, char **argv)
 
int videotoolbox_init (AVCodecContext *s)
 
int qsv_init (AVCodecContext *s)
 
HWDevicehw_device_get_by_name (const char *name)
 
int hw_device_init_from_string (const char *arg, HWDevice **dev)
 
void hw_device_free_all (void)
 
int hw_device_setup_for_decode (InputStream *ist)
 
int hw_device_setup_for_encode (OutputStream *ost)
 
int hw_device_setup_for_filter (FilterGraph *fg)
 
int hwaccel_decode_init (AVCodecContext *avctx)
 
int of_check_init (OutputFile *of)
 
int of_write_trailer (OutputFile *of)
 
void of_close (OutputFile **pof)
 
void of_write_packet (OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
 

Variables

const char *const forced_keyframes_const_names []
 
InputStream ** input_streams
 
int nb_input_streams
 
InputFile ** input_files
 
int nb_input_files
 
OutputStream ** output_streams
 
int nb_output_streams
 
OutputFile ** output_files
 
int nb_output_files
 
FilterGraph ** filtergraphs
 
int nb_filtergraphs
 
char * vstats_filename
 
char * sdp_filename
 
float audio_drift_threshold
 
float dts_delta_threshold
 
float dts_error_threshold
 
int audio_volume
 
int audio_sync_method
 
enum VideoSyncMethod video_sync_method
 
float frame_drop_threshold
 
int do_benchmark
 
int do_benchmark_all
 
int do_deinterlace
 
int do_hex_dump
 
int do_pkt_dump
 
int copy_ts
 
int start_at_zero
 
int copy_tb
 
int debug_ts
 
int exit_on_error
 
int abort_on_flags
 
int print_stats
 
int64_t stats_period
 
int qp_hist
 
int stdin_interaction
 
int frame_bits_per_raw_sample
 
AVIOContextprogress_avio
 
float max_error_rate
 
char * filter_nbthreads
 
int filter_complex_nbthreads
 
int vstats_version
 
int auto_conversion_filters
 
const AVIOInterruptCB int_cb
 
const OptionDef options []
 
HWDevicefilter_hw_device
 
int want_sdp
 
unsigned nb_output_dumped
 
int main_return_code
 

Macro Definition Documentation

◆ MAX_STREAMS

#define MAX_STREAMS   1024 /* arbitrary sanity check value */

Definition at line 59 of file ffmpeg.h.

◆ DECODING_FOR_OST

#define DECODING_FOR_OST   1

Definition at line 312 of file ffmpeg.h.

◆ DECODING_FOR_FILTER

#define DECODING_FOR_FILTER   2

Definition at line 313 of file ffmpeg.h.

◆ ABORT_ON_FLAG_EMPTY_OUTPUT

#define ABORT_ON_FLAG_EMPTY_OUTPUT   (1 << 0)

Definition at line 447 of file ffmpeg.h.

◆ ABORT_ON_FLAG_EMPTY_OUTPUT_STREAM

#define ABORT_ON_FLAG_EMPTY_OUTPUT_STREAM   (1 << 1)

Definition at line 448 of file ffmpeg.h.

Enumeration Type Documentation

◆ VideoSyncMethod

Enumerator
VSYNC_AUTO 
VSYNC_PASSTHROUGH 
VSYNC_CFR 
VSYNC_VFR 
VSYNC_VSCFR 
VSYNC_DROP 

Definition at line 50 of file ffmpeg.h.

◆ HWAccelID

enum HWAccelID
Enumerator
HWACCEL_NONE 
HWACCEL_AUTO 
HWACCEL_GENERIC 

Definition at line 61 of file ffmpeg.h.

◆ forced_keyframes_const

Enumerator
FKF_N 
FKF_N_FORCED 
FKF_PREV_FORCED_N 
FKF_PREV_FORCED_T 
FKF_T 
FKF_NB 

Definition at line 438 of file ffmpeg.h.

◆ OSTFinished

Enumerator
ENCODER_FINISHED 
MUXER_FINISHED 

Definition at line 452 of file ffmpeg.h.

Function Documentation

◆ term_init()

void term_init ( void  )

Definition at line 407 of file ffmpeg.c.

Referenced by assert_file_overwrite().

◆ term_exit()

void term_exit ( void  )

Definition at line 336 of file ffmpeg.c.

Referenced by assert_file_overwrite(), ffmpeg_cleanup(), and transcode().

◆ show_usage()

void show_usage ( void  )

Definition at line 3499 of file ffmpeg_opt.c.

Referenced by main(), and show_help_default().

◆ remove_avoptions()

void remove_avoptions ( AVDictionary **  a,
AVDictionary b 
)

Definition at line 658 of file ffmpeg.c.

Referenced by open_input_file().

◆ assert_avoptions()

void assert_avoptions ( AVDictionary m)

Definition at line 667 of file ffmpeg.c.

Referenced by init_input_stream(), init_output_stream(), and open_input_file().

◆ guess_input_channel_layout()

int guess_input_channel_layout ( InputStream ist)

Definition at line 1888 of file ffmpeg.c.

Referenced by add_input_streams().

◆ configure_filtergraph()

int configure_filtergraph ( FilterGraph fg)

Definition at line 993 of file ffmpeg_filter.c.

Referenced by flush_encoders(), ifilter_send_frame(), and transcode_step().

◆ check_filter_outputs()

void check_filter_outputs ( void  )

Definition at line 645 of file ffmpeg_filter.c.

◆ filtergraph_is_simple()

int filtergraph_is_simple ( FilterGraph fg)

Definition at line 1201 of file ffmpeg_filter.c.

Referenced by configure_filtergraph(), and transcode_init().

◆ init_simple_filtergraph()

int init_simple_filtergraph ( InputStream ist,
OutputStream ost 
)

Definition at line 176 of file ffmpeg_filter.c.

Referenced by open_output_file().

◆ init_complex_filtergraph()

int init_complex_filtergraph ( FilterGraph fg)

Definition at line 315 of file ffmpeg_filter.c.

Referenced by init_complex_filters().

◆ sub2video_update()

void sub2video_update ( InputStream ist,
int64_t  heartbeat_pts,
AVSubtitle sub 
)

◆ ifilter_parameters_from_frame()

int ifilter_parameters_from_frame ( InputFilter ifilter,
const AVFrame frame 
)

Definition at line 1169 of file ffmpeg_filter.c.

Referenced by ifilter_send_frame().

◆ ffmpeg_parse_options()

int ffmpeg_parse_options ( int  argc,
char **  argv 
)

Referenced by main().

◆ videotoolbox_init()

int videotoolbox_init ( AVCodecContext s)

◆ qsv_init()

int qsv_init ( AVCodecContext s)

◆ hw_device_get_by_name()

HWDevice* hw_device_get_by_name ( const char *  name)

◆ hw_device_init_from_string()

int hw_device_init_from_string ( const char *  arg,
HWDevice **  dev 
)

Definition at line 94 of file ffmpeg_hw.c.

Referenced by opt_init_hw_device().

◆ hw_device_free_all()

void hw_device_free_all ( void  )

Definition at line 288 of file ffmpeg_hw.c.

Referenced by transcode().

◆ hw_device_setup_for_decode()

int hw_device_setup_for_decode ( InputStream ist)

Definition at line 317 of file ffmpeg_hw.c.

Referenced by init_input_stream().

◆ hw_device_setup_for_encode()

int hw_device_setup_for_encode ( OutputStream ost)

Definition at line 445 of file ffmpeg_hw.c.

Referenced by init_output_stream().

◆ hw_device_setup_for_filter()

int hw_device_setup_for_filter ( FilterGraph fg)

Definition at line 551 of file ffmpeg_hw.c.

Referenced by configure_filtergraph().

◆ hwaccel_decode_init()

int hwaccel_decode_init ( AVCodecContext avctx)

Definition at line 542 of file ffmpeg_hw.c.

Referenced by get_format().

◆ of_check_init()

int of_check_init ( OutputFile of)

Definition at line 230 of file ffmpeg_mux.c.

Referenced by init_output_stream(), and transcode_init().

◆ of_write_trailer()

int of_write_trailer ( OutputFile of)

Definition at line 281 of file ffmpeg_mux.c.

Referenced by transcode().

◆ of_close()

void of_close ( OutputFile **  pof)

Definition at line 302 of file ffmpeg_mux.c.

Referenced by ffmpeg_cleanup().

◆ of_write_packet()

void of_write_packet ( OutputFile of,
AVPacket pkt,
OutputStream ost,
int  unqueue 
)

Definition at line 44 of file ffmpeg_mux.c.

Referenced by of_check_init(), and output_packet().

Variable Documentation

◆ forced_keyframes_const_names

const char* const forced_keyframes_const_names[]

Definition at line 115 of file ffmpeg.c.

Referenced by init_output_stream_encode().

◆ input_streams

InputStream** input_streams

◆ nb_input_streams

int nb_input_streams

◆ input_files

InputFile** input_files

◆ nb_input_files

int nb_input_files

◆ output_streams

OutputStream** output_streams

◆ nb_output_streams

int nb_output_streams

◆ output_files

OutputFile** output_files

◆ nb_output_files

int nb_output_files

◆ filtergraphs

FilterGraph** filtergraphs

◆ nb_filtergraphs

int nb_filtergraphs

◆ vstats_filename

char* vstats_filename

Definition at line 152 of file ffmpeg_opt.c.

Referenced by encode_frame(), ffmpeg_cleanup(), opt_vstats_file(), and update_video_stats().

◆ sdp_filename

char* sdp_filename

Definition at line 153 of file ffmpeg_opt.c.

Referenced by of_check_init(), opt_sdp_file(), and print_sdp().

◆ audio_drift_threshold

float audio_drift_threshold

Definition at line 155 of file ffmpeg_opt.c.

Referenced by configure_input_audio_filter().

◆ dts_delta_threshold

float dts_delta_threshold

Definition at line 156 of file ffmpeg_opt.c.

Referenced by process_input().

◆ dts_error_threshold

float dts_error_threshold

Definition at line 157 of file ffmpeg_opt.c.

Referenced by do_video_out(), and process_input().

◆ audio_volume

int audio_volume

Definition at line 159 of file ffmpeg_opt.c.

Referenced by configure_input_audio_filter(), and init_output_stream_streamcopy().

◆ audio_sync_method

int audio_sync_method

Definition at line 160 of file ffmpeg_opt.c.

Referenced by configure_input_audio_filter(), do_audio_out(), and of_write_packet().

◆ video_sync_method

enum VideoSyncMethod video_sync_method

Definition at line 161 of file ffmpeg_opt.c.

Referenced by new_video_stream(), opt_vsync(), and parse_and_set_vsync().

◆ frame_drop_threshold

float frame_drop_threshold

Definition at line 162 of file ffmpeg_opt.c.

Referenced by do_video_out().

◆ do_benchmark

int do_benchmark

Definition at line 163 of file ffmpeg_opt.c.

Referenced by ffmpeg_cleanup(), and main().

◆ do_benchmark_all

int do_benchmark_all

Definition at line 164 of file ffmpeg_opt.c.

Referenced by update_benchmark().

◆ do_deinterlace

int do_deinterlace

◆ do_hex_dump

int do_hex_dump

Definition at line 165 of file ffmpeg_opt.c.

Referenced by check_keyboard_interaction(), and process_input().

◆ do_pkt_dump

int do_pkt_dump

Definition at line 166 of file ffmpeg_opt.c.

Referenced by check_keyboard_interaction(), and process_input().

◆ copy_ts

int copy_ts

◆ start_at_zero

int start_at_zero

◆ copy_tb

int copy_tb

◆ debug_ts

int debug_ts

◆ exit_on_error

int exit_on_error

◆ abort_on_flags

int abort_on_flags

Definition at line 172 of file ffmpeg_opt.c.

Referenced by opt_abort_on(), and transcode().

◆ print_stats

int print_stats

Definition at line 173 of file ffmpeg_opt.c.

Referenced by print_report().

◆ stats_period

int64_t stats_period

Definition at line 181 of file ffmpeg_opt.c.

Referenced by opt_stats_period(), and print_report().

◆ qp_hist

int qp_hist

Definition at line 174 of file ffmpeg_opt.c.

Referenced by check_keyboard_interaction(), and print_report().

◆ stdin_interaction

int stdin_interaction

Definition at line 175 of file ffmpeg_opt.c.

Referenced by assert_file_overwrite(), open_input_file(), term_init(), and transcode().

◆ frame_bits_per_raw_sample

int frame_bits_per_raw_sample

◆ progress_avio

AVIOContext* progress_avio

Definition at line 143 of file ffmpeg.c.

Referenced by print_report().

◆ max_error_rate

float max_error_rate

Definition at line 176 of file ffmpeg_opt.c.

Referenced by main().

◆ filter_nbthreads

char* filter_nbthreads

Definition at line 177 of file ffmpeg_opt.c.

Referenced by configure_filtergraph(), ffmpeg_cleanup(), and opt_filter_threads().

◆ filter_complex_nbthreads

int filter_complex_nbthreads

Definition at line 178 of file ffmpeg_opt.c.

Referenced by configure_filtergraph().

◆ vstats_version

int vstats_version

Definition at line 179 of file ffmpeg_opt.c.

Referenced by update_video_stats().

◆ auto_conversion_filters

int auto_conversion_filters

Definition at line 180 of file ffmpeg_opt.c.

Referenced by configure_filtergraph().

◆ int_cb

const AVIOInterruptCB int_cb

◆ options

const OptionDef options[]

◆ filter_hw_device

HWDevice* filter_hw_device

Definition at line 150 of file ffmpeg_opt.c.

Referenced by hw_device_setup_for_filter(), and opt_filter_hw_device().

◆ want_sdp

int want_sdp

Definition at line 140 of file ffmpeg.c.

Referenced by main(), and of_check_init().

◆ nb_output_dumped

unsigned nb_output_dumped

Definition at line 138 of file ffmpeg.c.

Referenced by of_check_init(), and print_report().

◆ main_return_code

int main_return_code

Definition at line 346 of file ffmpeg.c.

Referenced by main(), and of_write_packet().