FFmpegKit Linux API 6.0
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
fftools_ffmpeg.h File Reference

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  LastFrameDuration
 
struct  InputFile
 
struct  EncStatsComponent
 
struct  EncStats
 
struct  KeyframeForceCtx
 
struct  OutputStream
 
struct  OutputFile
 

Macros

#define FFMPEG_OPT_PSNR   1
 
#define FFMPEG_OPT_MAP_CHANNEL   1
 
#define FFMPEG_OPT_MAP_SYNC   1
 
#define FFMPEG_ROTATION_METADATA   1
 
#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)
 

Typedefs

typedef struct HWDevice HWDevice
 
typedef struct StreamMap StreamMap
 
typedef struct OptionsContext OptionsContext
 
typedef struct InputFilter InputFilter
 
typedef struct OutputFilter OutputFilter
 
typedef struct FilterGraph FilterGraph
 
typedef struct InputStream InputStream
 
typedef struct LastFrameDuration LastFrameDuration
 
typedef struct InputFile InputFile
 
typedef struct EncStatsComponent EncStatsComponent
 
typedef struct EncStats EncStats
 
typedef struct KeyframeForceCtx KeyframeForceCtx
 
typedef struct OutputStream OutputStream
 
typedef struct OutputFile OutputFile
 

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  EncStatsType {
  ENC_STATS_LITERAL = 0 , ENC_STATS_FILE_IDX , ENC_STATS_STREAM_IDX , ENC_STATS_FRAME_NUM ,
  ENC_STATS_FRAME_NUM_IN , ENC_STATS_TIMEBASE , ENC_STATS_TIMEBASE_IN , ENC_STATS_PTS ,
  ENC_STATS_PTS_TIME , ENC_STATS_PTS_IN , ENC_STATS_PTS_TIME_IN , ENC_STATS_DTS ,
  ENC_STATS_DTS_TIME , ENC_STATS_SAMPLE_NUM , ENC_STATS_NB_SAMPLES , ENC_STATS_PKT_SIZE ,
  ENC_STATS_BITRATE , ENC_STATS_AVG_BITRATE
}
 
enum  OSTFinished { ENCODER_FINISHED = 1 , MUXER_FINISHED = 2 }
 
enum  { KF_FORCE_SOURCE = 1 , KF_FORCE_SOURCE_NO_DROP = 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)
 
void assert_file_overwrite (const char *filename)
 
char * file_read (const char *filename)
 
AVDictionary * strip_specifiers (const AVDictionary *dict)
 
const AVCodec * find_codec_or_die (void *logctx, const char *name, enum AVMediaType type, int encoder)
 
int parse_and_set_vsync (const char *arg, int *vsync_var, int file_idx, int st_idx, int is_global)
 
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)
 
void enc_stats_write (OutputStream *ost, EncStats *es, const AVFrame *frame, const AVPacket *pkt, uint64_t frame_num)
 
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_stream_init (OutputFile *of, OutputStream *ost)
 
int of_write_trailer (OutputFile *of)
 
int of_open (const OptionsContext *o, const char *filename)
 
void of_close (OutputFile **pof)
 
void of_enc_stats_close (void)
 
void of_output_packet (OutputFile *of, AVPacket *pkt, OutputStream *ost, int eof)
 
int64_t of_filesize (OutputFile *of)
 
int ifile_open (const OptionsContext *o, const char *filename)
 
void ifile_close (InputFile **f)
 
int ifile_get_packet (InputFile *f, AVPacket **pkt)
 
InputStreamist_iter (InputStream *prev)
 
void set_report_callback (void(*callback)(int, float, float, int64_t, double, double, double))
 
void cancel_operation (long id)
 

Variables

const char *const forced_keyframes_const_names []
 
__thread InputFile ** input_files
 
__thread int nb_input_files
 
__thread OutputFile ** output_files
 
__thread int nb_output_files
 
__thread FilterGraph ** filtergraphs
 
__thread int nb_filtergraphs
 
__thread char * vstats_filename
 
__thread char * sdp_filename
 
__thread float audio_drift_threshold
 
__thread float dts_delta_threshold
 
__thread float dts_error_threshold
 
__thread enum VideoSyncMethod video_sync_method
 
__thread float frame_drop_threshold
 
__thread int do_benchmark
 
__thread int do_benchmark_all
 
__thread int do_hex_dump
 
__thread int do_pkt_dump
 
__thread int copy_ts
 
__thread int start_at_zero
 
__thread int copy_tb
 
__thread int debug_ts
 
__thread int exit_on_error
 
__thread int abort_on_flags
 
__thread int print_stats
 
__thread int64_t stats_period
 
__thread int qp_hist
 
__thread int stdin_interaction
 
__thread AVIOContext * progress_avio
 
__thread float max_error_rate
 
__thread char * filter_nbthreads
 
__thread int filter_complex_nbthreads
 
__thread int vstats_version
 
__thread int auto_conversion_filters
 
__thread const AVIOInterruptCB int_cb
 
__thread HWDevicefilter_hw_device
 
__thread unsigned nb_output_dumped
 
__thread int main_ffmpeg_return_code
 
__thread int ignore_unknown_streams
 
__thread int copy_unknown_streams
 
__thread int recast_media
 
__thread int do_psnr
 
const char *const opt_name_codec_names []
 
const char *const opt_name_codec_tags []
 
const char *const opt_name_frame_rates []
 
const char *const opt_name_top_field_first []
 

Macro Definition Documentation

◆ ABORT_ON_FLAG_EMPTY_OUTPUT

#define ABORT_ON_FLAG_EMPTY_OUTPUT   (1 << 0)

Definition at line 545 of file fftools_ffmpeg.h.

◆ ABORT_ON_FLAG_EMPTY_OUTPUT_STREAM

#define ABORT_ON_FLAG_EMPTY_OUTPUT_STREAM   (1 << 1)

Definition at line 546 of file fftools_ffmpeg.h.

◆ DECODING_FOR_FILTER

#define DECODING_FOR_FILTER   2

Definition at line 391 of file fftools_ffmpeg.h.

◆ DECODING_FOR_OST

#define DECODING_FOR_OST   1

Definition at line 390 of file fftools_ffmpeg.h.

◆ FFMPEG_OPT_MAP_CHANNEL

#define FFMPEG_OPT_MAP_CHANNEL   1

Definition at line 103 of file fftools_ffmpeg.h.

◆ FFMPEG_OPT_MAP_SYNC

#define FFMPEG_OPT_MAP_SYNC   1

Definition at line 104 of file fftools_ffmpeg.h.

◆ FFMPEG_OPT_PSNR

#define FFMPEG_OPT_PSNR   1

Definition at line 102 of file fftools_ffmpeg.h.

◆ FFMPEG_ROTATION_METADATA

#define FFMPEG_ROTATION_METADATA   1

Definition at line 105 of file fftools_ffmpeg.h.

◆ MAX_STREAMS

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

Definition at line 116 of file fftools_ffmpeg.h.

Typedef Documentation

◆ EncStats

typedef struct EncStats EncStats

◆ EncStatsComponent

◆ FilterGraph

typedef struct FilterGraph FilterGraph

◆ HWDevice

typedef struct HWDevice HWDevice

◆ InputFile

typedef struct InputFile InputFile

◆ InputFilter

typedef struct InputFilter InputFilter

◆ InputStream

typedef struct InputStream InputStream

◆ KeyframeForceCtx

◆ LastFrameDuration

◆ OptionsContext

◆ OutputFile

typedef struct OutputFile OutputFile

◆ OutputFilter

typedef struct OutputFilter OutputFilter

◆ OutputStream

typedef struct OutputStream OutputStream

◆ StreamMap

typedef struct StreamMap StreamMap

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
KF_FORCE_SOURCE 
KF_FORCE_SOURCE_NO_DROP 

Definition at line 590 of file fftools_ffmpeg.h.

◆ EncStatsType

Enumerator
ENC_STATS_LITERAL 
ENC_STATS_FILE_IDX 
ENC_STATS_STREAM_IDX 
ENC_STATS_FRAME_NUM 
ENC_STATS_FRAME_NUM_IN 
ENC_STATS_TIMEBASE 
ENC_STATS_TIMEBASE_IN 
ENC_STATS_PTS 
ENC_STATS_PTS_TIME 
ENC_STATS_PTS_IN 
ENC_STATS_PTS_TIME_IN 
ENC_STATS_DTS 
ENC_STATS_DTS_TIME 
ENC_STATS_SAMPLE_NUM 
ENC_STATS_NB_SAMPLES 
ENC_STATS_PKT_SIZE 
ENC_STATS_BITRATE 
ENC_STATS_AVG_BITRATE 

Definition at line 548 of file fftools_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 536 of file fftools_ffmpeg.h.

◆ HWAccelID

enum HWAccelID
Enumerator
HWACCEL_NONE 
HWACCEL_AUTO 
HWACCEL_GENERIC 

Definition at line 118 of file fftools_ffmpeg.h.

◆ OSTFinished

Enumerator
ENCODER_FINISHED 
MUXER_FINISHED 

Definition at line 585 of file fftools_ffmpeg.h.

◆ VideoSyncMethod

Enumerator
VSYNC_AUTO 
VSYNC_PASSTHROUGH 
VSYNC_CFR 
VSYNC_VFR 
VSYNC_VSCFR 
VSYNC_DROP 

Definition at line 107 of file fftools_ffmpeg.h.

Function Documentation

◆ assert_avoptions()

void assert_avoptions ( AVDictionary *  m)

Definition at line 788 of file fftools_ffmpeg.c.

◆ assert_file_overwrite()

void assert_file_overwrite ( const char *  filename)

Definition at line 700 of file fftools_ffmpeg_opt.c.

◆ cancel_operation()

void cancel_operation ( long  id)

Definition at line 4367 of file fftools_ffmpeg.c.

◆ check_filter_outputs()

void check_filter_outputs ( void  )

Definition at line 822 of file fftools_ffmpeg_filter.c.

◆ configure_filtergraph()

int configure_filtergraph ( FilterGraph fg)

Definition at line 1136 of file fftools_ffmpeg_filter.c.

◆ enc_stats_write()

void enc_stats_write ( OutputStream ost,
EncStats es,
const AVFrame *  frame,
const AVPacket *  pkt,
uint64_t  frame_num 
)

Definition at line 970 of file fftools_ffmpeg.c.

◆ ffmpeg_parse_options()

int ffmpeg_parse_options ( int  argc,
char **  argv 
)

Definition at line 1303 of file fftools_ffmpeg_opt.c.

◆ file_read()

char * file_read ( const char *  filename)

Definition at line 743 of file fftools_ffmpeg_opt.c.

◆ filtergraph_is_simple()

int filtergraph_is_simple ( FilterGraph fg)

Definition at line 1331 of file fftools_ffmpeg_filter.c.

◆ find_codec_or_die()

const AVCodec * find_codec_or_die ( void *  logctx,
const char *  name,
enum AVMediaType  type,
int  encoder 
)

Definition at line 670 of file fftools_ffmpeg_opt.c.

◆ hw_device_free_all()

void hw_device_free_all ( void  )

Definition at line 313 of file fftools_ffmpeg_hw.c.

◆ hw_device_get_by_name()

HWDevice * hw_device_get_by_name ( const char *  name)

Definition at line 69 of file fftools_ffmpeg_hw.c.

◆ hw_device_init_from_string()

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

Definition at line 119 of file fftools_ffmpeg_hw.c.

◆ hw_device_setup_for_decode()

int hw_device_setup_for_decode ( InputStream ist)

Definition at line 342 of file fftools_ffmpeg_hw.c.

◆ hw_device_setup_for_encode()

int hw_device_setup_for_encode ( OutputStream ost)

Definition at line 470 of file fftools_ffmpeg_hw.c.

◆ hw_device_setup_for_filter()

int hw_device_setup_for_filter ( FilterGraph fg)

Definition at line 576 of file fftools_ffmpeg_hw.c.

◆ hwaccel_decode_init()

int hwaccel_decode_init ( AVCodecContext *  avctx)

Definition at line 567 of file fftools_ffmpeg_hw.c.

◆ ifile_close()

void ifile_close ( InputFile **  f)

Definition at line 496 of file fftools_ffmpeg_demux.c.

◆ ifile_get_packet()

int ifile_get_packet ( InputFile f,
AVPacket **  pkt 
)

Get next input packet from the demuxer.

Parameters
pktthe packet is written here when this function returns 0
Returns
  • 0 when a packet has been read successfully
  • 1 when stream end was reached, but the stream is looped; caller should flush decoders and read from this demuxer again
  • a negative error code on failure

Definition at line 427 of file fftools_ffmpeg_demux.c.

◆ ifile_open()

int ifile_open ( const OptionsContext o,
const char *  filename 
)

Definition at line 859 of file fftools_ffmpeg_demux.c.

◆ ifilter_parameters_from_frame()

int ifilter_parameters_from_frame ( InputFilter ifilter,
const AVFrame *  frame 
)

Definition at line 1299 of file fftools_ffmpeg_filter.c.

◆ init_complex_filtergraph()

int init_complex_filtergraph ( FilterGraph fg)

Definition at line 491 of file fftools_ffmpeg_filter.c.

◆ init_simple_filtergraph()

int init_simple_filtergraph ( InputStream ist,
OutputStream ost 
)

Definition at line 203 of file fftools_ffmpeg_filter.c.

◆ ist_iter()

InputStream * ist_iter ( InputStream prev)

Definition at line 763 of file fftools_ffmpeg.c.

◆ of_close()

void of_close ( OutputFile **  pof)

Definition at line 750 of file fftools_ffmpeg_mux.c.

◆ of_enc_stats_close()

void of_enc_stats_close ( void  )

Definition at line 232 of file fftools_ffmpeg_mux_init.c.

◆ of_filesize()

int64_t of_filesize ( OutputFile of)

Definition at line 777 of file fftools_ffmpeg_mux.c.

◆ of_open()

int of_open ( const OptionsContext o,
const char *  filename 
)

Definition at line 2221 of file fftools_ffmpeg_mux_init.c.

◆ of_output_packet()

void of_output_packet ( OutputFile of,
AVPacket *  pkt,
OutputStream ost,
int  eof 
)

Definition at line 359 of file fftools_ffmpeg_mux.c.

◆ of_stream_init()

int of_stream_init ( OutputFile of,
OutputStream ost 
)

Definition at line 613 of file fftools_ffmpeg_mux.c.

◆ of_write_trailer()

int of_write_trailer ( OutputFile of)

Definition at line 634 of file fftools_ffmpeg_mux.c.

◆ parse_and_set_vsync()

int parse_and_set_vsync ( const char *  arg,
int vsync_var,
int  file_idx,
int  st_idx,
int  is_global 
)

Definition at line 228 of file fftools_ffmpeg_opt.c.

◆ remove_avoptions()

void remove_avoptions ( AVDictionary **  a,
AVDictionary *  b 
)

Definition at line 779 of file fftools_ffmpeg.c.

◆ set_report_callback()

void set_report_callback ( void(*)(int, float, float, int64_t, double, double, double)  callback)

Definition at line 4362 of file fftools_ffmpeg.c.

◆ show_usage()

void show_usage ( void  )

Definition at line 1252 of file fftools_ffmpeg_opt.c.

◆ strip_specifiers()

AVDictionary * strip_specifiers ( const AVDictionary *  dict)

Definition at line 211 of file fftools_ffmpeg_opt.c.

◆ sub2video_update()

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

Definition at line 362 of file fftools_ffmpeg.c.

◆ term_exit()

void term_exit ( void  )

Definition at line 458 of file fftools_ffmpeg.c.

◆ term_init()

void term_init ( void  )

Definition at line 535 of file fftools_ffmpeg.c.

Variable Documentation

◆ abort_on_flags

__thread int abort_on_flags
extern

Definition at line 123 of file fftools_ffmpeg_opt.c.

◆ audio_drift_threshold

__thread float audio_drift_threshold
extern

Definition at line 108 of file fftools_ffmpeg_opt.c.

◆ auto_conversion_filters

__thread int auto_conversion_filters
extern

Definition at line 131 of file fftools_ffmpeg_opt.c.

◆ copy_tb

__thread int copy_tb
extern

Definition at line 120 of file fftools_ffmpeg_opt.c.

◆ copy_ts

__thread int copy_ts
extern

Definition at line 118 of file fftools_ffmpeg_opt.c.

◆ copy_unknown_streams

__thread int copy_unknown_streams
extern

Definition at line 141 of file fftools_ffmpeg_opt.c.

◆ debug_ts

__thread int debug_ts
extern

Definition at line 121 of file fftools_ffmpeg_opt.c.

◆ do_benchmark

__thread int do_benchmark
extern

Definition at line 114 of file fftools_ffmpeg_opt.c.

◆ do_benchmark_all

__thread int do_benchmark_all
extern

Definition at line 115 of file fftools_ffmpeg_opt.c.

◆ do_hex_dump

__thread int do_hex_dump
extern

Definition at line 116 of file fftools_ffmpeg_opt.c.

◆ do_pkt_dump

__thread int do_pkt_dump
extern

Definition at line 117 of file fftools_ffmpeg_opt.c.

◆ do_psnr

__thread int do_psnr
extern

Definition at line 138 of file fftools_ffmpeg_opt.c.

◆ dts_delta_threshold

__thread float dts_delta_threshold
extern

Definition at line 109 of file fftools_ffmpeg_opt.c.

◆ dts_error_threshold

__thread float dts_error_threshold
extern

Definition at line 110 of file fftools_ffmpeg_opt.c.

◆ exit_on_error

__thread int exit_on_error
extern

Definition at line 122 of file fftools_ffmpeg_opt.c.

◆ filter_complex_nbthreads

__thread int filter_complex_nbthreads
extern

Definition at line 129 of file fftools_ffmpeg_opt.c.

◆ filter_hw_device

__thread HWDevice* filter_hw_device
extern

Definition at line 103 of file fftools_ffmpeg_opt.c.

◆ filter_nbthreads

__thread char* filter_nbthreads
extern

Definition at line 128 of file fftools_ffmpeg_opt.c.

◆ filtergraphs

__thread FilterGraph** filtergraphs
extern

Definition at line 213 of file fftools_ffmpeg.c.

◆ forced_keyframes_const_names

const char* const forced_keyframes_const_names[]
extern

Definition at line 2044 of file fftools_ffmpeg_mux_init.c.

◆ frame_drop_threshold

__thread float frame_drop_threshold
extern

Definition at line 113 of file fftools_ffmpeg_opt.c.

◆ ignore_unknown_streams

__thread int ignore_unknown_streams
extern

Definition at line 140 of file fftools_ffmpeg_opt.c.

◆ input_files

__thread InputFile** input_files
extern

Definition at line 207 of file fftools_ffmpeg.c.

◆ int_cb

__thread const AVIOInterruptCB int_cb
extern

Definition at line 657 of file fftools_ffmpeg.c.

◆ main_ffmpeg_return_code

__thread int main_ffmpeg_return_code
extern

Definition at line 468 of file fftools_ffmpeg.c.

◆ max_error_rate

__thread float max_error_rate
extern

Definition at line 127 of file fftools_ffmpeg_opt.c.

◆ nb_filtergraphs

__thread int nb_filtergraphs
extern

Definition at line 214 of file fftools_ffmpeg.c.

◆ nb_input_files

__thread int nb_input_files
extern

Definition at line 208 of file fftools_ffmpeg.c.

◆ nb_output_dumped

__thread unsigned nb_output_dumped
extern

Definition at line 202 of file fftools_ffmpeg.c.

◆ nb_output_files

__thread int nb_output_files
extern

Definition at line 211 of file fftools_ffmpeg.c.

◆ opt_name_codec_names

const char* const opt_name_codec_names[]
extern

Definition at line 98 of file fftools_ffmpeg_opt.c.

◆ opt_name_codec_tags

const char* const opt_name_codec_tags[]
extern

Definition at line 100 of file fftools_ffmpeg_opt.c.

◆ opt_name_frame_rates

const char* const opt_name_frame_rates[]
extern

Definition at line 99 of file fftools_ffmpeg_opt.c.

◆ opt_name_top_field_first

const char* const opt_name_top_field_first[]
extern

Definition at line 101 of file fftools_ffmpeg_opt.c.

◆ output_files

__thread OutputFile** output_files
extern

Definition at line 210 of file fftools_ffmpeg.c.

◆ print_stats

__thread int print_stats
extern

Definition at line 124 of file fftools_ffmpeg_opt.c.

◆ progress_avio

__thread AVIOContext* progress_avio
extern

Definition at line 205 of file fftools_ffmpeg.c.

◆ qp_hist

__thread int qp_hist
extern

Definition at line 125 of file fftools_ffmpeg_opt.c.

◆ recast_media

__thread int recast_media
extern

Definition at line 142 of file fftools_ffmpeg_opt.c.

◆ sdp_filename

__thread char* sdp_filename
extern

Definition at line 106 of file fftools_ffmpeg_opt.c.

◆ start_at_zero

__thread int start_at_zero
extern

Definition at line 119 of file fftools_ffmpeg_opt.c.

◆ stats_period

__thread int64_t stats_period
extern

Definition at line 132 of file fftools_ffmpeg_opt.c.

◆ stdin_interaction

__thread int stdin_interaction
extern

Definition at line 126 of file fftools_ffmpeg_opt.c.

◆ video_sync_method

__thread enum VideoSyncMethod video_sync_method
extern

Definition at line 112 of file fftools_ffmpeg_opt.c.

◆ vstats_filename

__thread char* vstats_filename
extern

Definition at line 105 of file fftools_ffmpeg_opt.c.

◆ vstats_version

__thread int vstats_version
extern

Definition at line 130 of file fftools_ffmpeg_opt.c.