FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 "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/threadmessage.h"
#include "libswresample/swresample.h"

Go to the source code of this file.

Data Structures

struct  HWAccel
 
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 VSYNC_AUTO   -1
 
#define VSYNC_PASSTHROUGH   0
 
#define VSYNC_CFR   1
 
#define VSYNC_VFR   2
 
#define VSYNC_VSCFR   0xfe
 
#define VSYNC_DROP   0xff
 
#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)
 

Enumerations

enum  HWAccelID {
  HWACCEL_NONE = 0, HWACCEL_AUTO, HWACCEL_VDPAU, HWACCEL_DXVA2,
  HWACCEL_VDA, HWACCEL_VIDEOTOOLBOX, HWACCEL_QSV, HWACCEL_VAAPI,
  HWACCEL_CUVID, HWACCEL_D3D11VA
}
 
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 reset_options (OptionsContext *o, int is_input)
 
void show_usage (void)
 
void opt_output_file (void *optctx, const char *filename)
 
void remove_avoptions (AVDictionary **a, AVDictionary *b)
 
void assert_avoptions (AVDictionary *m)
 
int guess_input_channel_layout (InputStream *ist)
 
enum AVPixelFormat choose_pixel_fmt (AVStream *st, AVCodecContext *avctx, AVCodec *codec, enum AVPixelFormat target)
 
void choose_sample_fmt (AVStream *st, AVCodec *codec)
 
int configure_filtergraph (FilterGraph *fg)
 
int configure_output_filter (FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
 
void check_filter_outputs (void)
 
int ist_in_filtergraph (FilterGraph *fg, InputStream *ist)
 
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, AVSubtitle *sub)
 
int ifilter_parameters_from_frame (InputFilter *ifilter, const AVFrame *frame)
 
int ffmpeg_parse_options (int argc, char **argv)
 
int vda_init (AVCodecContext *s)
 
int videotoolbox_init (AVCodecContext *s)
 
int qsv_init (AVCodecContext *s)
 
int cuvid_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 hwaccel_decode_init (AVCodecContext *avctx)
 

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
 
int 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
 
int qp_hist
 
int stdin_interaction
 
int frame_bits_per_raw_sample
 
AVIOContextprogress_avio
 
float max_error_rate
 
char * videotoolbox_pixfmt
 
int filter_nbthreads
 
int filter_complex_nbthreads
 
int vstats_version
 
const AVIOInterruptCB int_cb
 
const OptionDef options []
 
const HWAccel hwaccels []
 
int hwaccel_lax_profile_check
 
AVBufferRefhw_device_ctx
 
HWDevicefilter_hw_device
 

Macro Definition Documentation

#define VSYNC_AUTO   -1

Definition at line 52 of file ffmpeg.h.

Referenced by do_video_out(), init_output_stream_encode(), and opt_vsync().

#define VSYNC_PASSTHROUGH   0

Definition at line 53 of file ffmpeg.h.

Referenced by do_video_out(), init_output_stream_encode(), new_video_stream(), and opt_vsync().

#define VSYNC_CFR   1

Definition at line 54 of file ffmpeg.h.

Referenced by do_video_out(), init_output_stream_encode(), and opt_vsync().

#define VSYNC_VFR   2

Definition at line 55 of file ffmpeg.h.

Referenced by do_video_out(), and opt_vsync().

#define VSYNC_VSCFR   0xfe

Definition at line 56 of file ffmpeg.h.

Referenced by do_video_out(), and init_output_stream_encode().

#define VSYNC_DROP   0xff

Definition at line 57 of file ffmpeg.h.

Referenced by do_video_out(), opt_vsync(), and write_packet().

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

Definition at line 59 of file ffmpeg.h.

Referenced by opt_streamid().

#define DECODING_FOR_OST   1

Definition at line 308 of file ffmpeg.h.

Referenced by init_input_stream(), and open_output_file().

#define DECODING_FOR_FILTER   2

Definition at line 309 of file ffmpeg.h.

Referenced by init_input_filter(), and init_input_stream().

#define ABORT_ON_FLAG_EMPTY_OUTPUT   (1 << 0)

Definition at line 440 of file ffmpeg.h.

Referenced by opt_abort_on(), and transcode().

Enumeration Type Documentation

enum HWAccelID
Enumerator
HWACCEL_NONE 
HWACCEL_AUTO 
HWACCEL_VDPAU 
HWACCEL_DXVA2 
HWACCEL_VDA 
HWACCEL_VIDEOTOOLBOX 
HWACCEL_QSV 
HWACCEL_VAAPI 
HWACCEL_CUVID 
HWACCEL_D3D11VA 

Definition at line 61 of file ffmpeg.h.

Enumerator
FKF_N 
FKF_N_FORCED 
FKF_PREV_FORCED_N 
FKF_PREV_FORCED_T 
FKF_T 
FKF_NB 

Definition at line 431 of file ffmpeg.h.

Enumerator
ENCODER_FINISHED 
MUXER_FINISHED 

Definition at line 444 of file ffmpeg.h.

Function Documentation

void term_init ( void  )

Definition at line 373 of file ffmpeg.c.

Referenced by assert_file_overwrite(), and ffmpeg_parse_options().

void term_exit ( void  )

Definition at line 315 of file ffmpeg.c.

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

void reset_options ( OptionsContext o,
int  is_input 
)
void show_usage ( void  )

Definition at line 3241 of file ffmpeg_opt.c.

Referenced by main(), and show_help_default().

void opt_output_file ( void optctx,
const char *  filename 
)
void remove_avoptions ( AVDictionary **  a,
AVDictionary b 
)

Definition at line 622 of file ffmpeg.c.

Referenced by open_input_file().

void assert_avoptions ( AVDictionary m)

Definition at line 631 of file ffmpeg.c.

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

int guess_input_channel_layout ( InputStream ist)

Definition at line 2102 of file ffmpeg.c.

Referenced by add_input_streams().

enum AVPixelFormat choose_pixel_fmt ( AVStream st,
AVCodecContext avctx,
AVCodec codec,
enum AVPixelFormat  target 
)

Definition at line 63 of file ffmpeg_filter.c.

Referenced by choose_pix_fmts(), and read_ffserver_streams().

void choose_sample_fmt ( AVStream st,
AVCodec codec 
)

Definition at line 92 of file ffmpeg_filter.c.

Referenced by read_ffserver_streams().

int configure_filtergraph ( FilterGraph fg)

Definition at line 995 of file ffmpeg_filter.c.

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

int configure_output_filter ( FilterGraph fg,
OutputFilter ofilter,
AVFilterInOut out 
)

Definition at line 667 of file ffmpeg_filter.c.

Referenced by configure_filtergraph().

void check_filter_outputs ( void  )

Definition at line 681 of file ffmpeg_filter.c.

Referenced by ffmpeg_parse_options().

int ist_in_filtergraph ( FilterGraph fg,
InputStream ist 
)

Definition at line 1198 of file ffmpeg_filter.c.

int filtergraph_is_simple ( FilterGraph fg)

Definition at line 1207 of file ffmpeg_filter.c.

Referenced by configure_filtergraph(), and transcode_init().

int init_simple_filtergraph ( InputStream ist,
OutputStream ost 
)

Referenced by open_output_file().

int init_complex_filtergraph ( FilterGraph fg)

Definition at line 332 of file ffmpeg_filter.c.

Referenced by init_complex_filters().

void sub2video_update ( InputStream ist,
AVSubtitle sub 
)
int ifilter_parameters_from_frame ( InputFilter ifilter,
const AVFrame frame 
)

Definition at line 1175 of file ffmpeg_filter.c.

Referenced by ifilter_send_frame().

int ffmpeg_parse_options ( int  argc,
char **  argv 
)

Definition at line 3291 of file ffmpeg_opt.c.

Referenced by main().

int vda_init ( AVCodecContext s)
int videotoolbox_init ( AVCodecContext s)

Definition at line 129 of file ffmpeg_videotoolbox.c.

int qsv_init ( AVCodecContext s)

Definition at line 71 of file ffmpeg_qsv.c.

int cuvid_init ( AVCodecContext s)

Definition at line 30 of file ffmpeg_cuvid.c.

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

Definition at line 67 of file ffmpeg_hw.c.

Referenced by hw_device_setup_for_decode(), and opt_init_hw_device().

void hw_device_free_all ( void  )

Definition at line 217 of file ffmpeg_hw.c.

Referenced by transcode().

int hw_device_setup_for_decode ( InputStream ist)

Definition at line 255 of file ffmpeg_hw.c.

Referenced by init_input_stream().

int hw_device_setup_for_encode ( OutputStream ost)

Definition at line 312 of file ffmpeg_hw.c.

Referenced by init_output_stream().

int hwaccel_decode_init ( AVCodecContext avctx)

Definition at line 378 of file ffmpeg_hw.c.

Variable Documentation

const char* const forced_keyframes_const_names[]

Definition at line 117 of file ffmpeg.c.

Referenced by init_output_stream_encode().

InputStream** input_streams
int nb_input_streams
InputFile** input_files
int nb_input_files
OutputStream** output_streams

Definition at line 149 of file ffmpeg.c.

Referenced by new_output_stream(), and open_output_file().

int nb_output_streams
OutputFile** output_files
int nb_output_files
FilterGraph** filtergraphs
int nb_filtergraphs
char* vstats_filename
char* sdp_filename

Definition at line 108 of file ffmpeg_opt.c.

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

float audio_drift_threshold

Definition at line 110 of file ffmpeg_opt.c.

Referenced by configure_input_audio_filter().

float dts_delta_threshold

Definition at line 111 of file ffmpeg_opt.c.

Referenced by process_input().

float dts_error_threshold

Definition at line 112 of file ffmpeg_opt.c.

Referenced by do_video_out(), and process_input().

int audio_volume

Definition at line 114 of file ffmpeg_opt.c.

Referenced by configure_input_audio_filter(), and configure_output_audio_filter().

int audio_sync_method

Definition at line 115 of file ffmpeg_opt.c.

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

int video_sync_method
float frame_drop_threshold

Definition at line 117 of file ffmpeg_opt.c.

Referenced by do_video_out().

int do_benchmark

Definition at line 119 of file ffmpeg_opt.c.

Referenced by ffmpeg_cleanup(), and main().

int do_benchmark_all

Definition at line 120 of file ffmpeg_opt.c.

Referenced by update_benchmark().

int do_deinterlace

Definition at line 118 of file ffmpeg_opt.c.

Referenced by configure_input_video_filter().

int do_hex_dump

Definition at line 121 of file ffmpeg_opt.c.

Referenced by check_keyboard_interaction(), and process_input().

int do_pkt_dump

Definition at line 122 of file ffmpeg_opt.c.

Referenced by check_keyboard_interaction(), and process_input().

int copy_ts
int start_at_zero
int copy_tb

Definition at line 125 of file ffmpeg_opt.c.

Referenced by init_output_stream_streamcopy().

int debug_ts
int exit_on_error
int abort_on_flags

Definition at line 128 of file ffmpeg_opt.c.

Referenced by opt_abort_on(), and transcode().

int print_stats

Definition at line 129 of file ffmpeg_opt.c.

Referenced by print_report().

int qp_hist

Definition at line 130 of file ffmpeg_opt.c.

Referenced by check_keyboard_interaction(), and print_report().

int stdin_interaction

Definition at line 131 of file ffmpeg_opt.c.

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

int frame_bits_per_raw_sample

Definition at line 132 of file ffmpeg_opt.c.

Referenced by init_output_stream_encode(), and new_video_stream().

AVIOContext* progress_avio

Definition at line 140 of file ffmpeg.c.

Referenced by opt_progress().

float max_error_rate

Definition at line 133 of file ffmpeg_opt.c.

Referenced by main().

char* videotoolbox_pixfmt

Definition at line 39 of file ffmpeg_videotoolbox.c.

Referenced by videotoolbox_init(), and videotoolbox_retrieve_data().

int filter_nbthreads

Definition at line 134 of file ffmpeg_opt.c.

Referenced by configure_filtergraph().

int filter_complex_nbthreads

Definition at line 135 of file ffmpeg_opt.c.

Referenced by configure_filtergraph().

int vstats_version

Definition at line 136 of file ffmpeg_opt.c.

Referenced by do_video_stats().

const AVIOInterruptCB int_cb
static const OptionDef options
Initial value:
= {
{ "n", OPT_BOOL, {(void *)&no_launch }, "enable no-launch mode" },
{ "d", 0, {(void*)opt_debug}, "enable debug mode" },
{ "f", HAS_ARG | OPT_STRING, {(void*)&config.filename }, "use configfile instead of /etc/ffserver.conf", "configfile" },
{ NULL },
}
#define NULL
Definition: coverity.c:32
static FFServerConfig config
Definition: ffserver.c:193
#define CMDUTILS_COMMON_OPTIONS
Definition: cmdutils.h:231
static void opt_debug(void)
Definition: ffserver.c:3934
#define HAS_ARG
Definition: cmdutils.h:166
#define OPT_STRING
Definition: cmdutils.h:169
#define OPT_BOOL
Definition: cmdutils.h:167
static int no_launch
Definition: ffserver.c:243
Examples:
http_multiclient.c.

Definition at line 3948 of file ffserver.c.

Referenced by avfilter_init_str(), ff_opus_psy_init(), ffmpeg_parse_options(), hw_device_init_from_string(), init(), main(), open_output_file(), opt_audio_codec(), opt_audio_filters(), opt_audio_frames(), opt_audio_qscale(), opt_channel_layout(), opt_data_codec(), opt_data_frames(), opt_old2new(), opt_qscale(), opt_recording_timestamp(), opt_subtitle_codec(), opt_target(), opt_timecode(), opt_video_codec(), opt_video_filters(), opt_video_frames(), pcm_read_header(), pp_get_mode_by_name_and_quality(), show_help_default(), tee_open(), and uninit_options().

const HWAccel hwaccels[]

Definition at line 68 of file ffmpeg_opt.c.

Referenced by get_hwaccel(), and hw_device_match_type_by_hwaccel().

int hwaccel_lax_profile_check

Definition at line 103 of file ffmpeg_opt.c.

AVBufferRef* hw_device_ctx

Definition at line 104 of file ffmpeg_opt.c.

HWDevice* filter_hw_device

Definition at line 105 of file ffmpeg_opt.c.

Referenced by configure_filtergraph().