FFmpegKit Linux API 5.1
Data Structures | Macros | Typedefs | Functions | Variables
fftools_ffmpeg.c File Reference

Go to the source code of this file.

Data Structures

struct  BenchmarkTimeStamps
 

Macros

#define SIGNAL(sig, func)    signal(sig, func)
 
#define OFFSET(x)   offsetof(OptionsContext, x)
 

Typedefs

typedef struct BenchmarkTimeStamps BenchmarkTimeStamps
 

Functions

static BenchmarkTimeStamps get_benchmark_time_stamps (void)
 
static int64_t getmaxrss (void)
 
static int ifilter_has_all_input_formats (FilterGraph *fg)
 
int opt_map (void *optctx, const char *opt, const char *arg)
 
int opt_map_channel (void *optctx, const char *opt, const char *arg)
 
int opt_recording_timestamp (void *optctx, const char *opt, const char *arg)
 
int opt_data_frames (void *optctx, const char *opt, const char *arg)
 
int opt_progress (void *optctx, const char *opt, const char *arg)
 
int opt_target (void *optctx, const char *opt, const char *arg)
 
int opt_vsync (void *optctx, const char *opt, const char *arg)
 
int opt_abort_on (void *optctx, const char *opt, const char *arg)
 
int opt_stats_period (void *optctx, const char *opt, const char *arg)
 
int opt_qscale (void *optctx, const char *opt, const char *arg)
 
int opt_profile (void *optctx, const char *opt, const char *arg)
 
int opt_filter_complex (void *optctx, const char *opt, const char *arg)
 
int opt_filter_complex_script (void *optctx, const char *opt, const char *arg)
 
int opt_attach (void *optctx, const char *opt, const char *arg)
 
int opt_video_frames (void *optctx, const char *opt, const char *arg)
 
int opt_video_codec (void *optctx, const char *opt, const char *arg)
 
int opt_sameq (void *optctx, const char *opt, const char *arg)
 
int opt_timecode (void *optctx, const char *opt, const char *arg)
 
int opt_vstats_file (void *optctx, const char *opt, const char *arg)
 
int opt_vstats (void *optctx, const char *opt, const char *arg)
 
int opt_old2new (void *optctx, const char *opt, const char *arg)
 
int opt_streamid (void *optctx, const char *opt, const char *arg)
 
int opt_bitrate (void *optctx, const char *opt, const char *arg)
 
int show_hwaccels (void *optctx, const char *opt, const char *arg)
 
int opt_video_filters (void *optctx, const char *opt, const char *arg)
 
int opt_audio_frames (void *optctx, const char *opt, const char *arg)
 
int opt_audio_qscale (void *optctx, const char *opt, const char *arg)
 
int opt_audio_codec (void *optctx, const char *opt, const char *arg)
 
int opt_channel_layout (void *optctx, const char *opt, const char *arg)
 
int opt_preset (void *optctx, const char *opt, const char *arg)
 
int opt_audio_filters (void *optctx, const char *opt, const char *arg)
 
int opt_subtitle_codec (void *optctx, const char *opt, const char *arg)
 
int opt_video_channel (void *optctx, const char *opt, const char *arg)
 
int opt_video_standard (void *optctx, const char *opt, const char *arg)
 
int opt_sdp_file (void *optctx, const char *opt, const char *arg)
 
int opt_data_codec (void *optctx, const char *opt, const char *arg)
 
int opt_init_hw_device (void *optctx, const char *opt, const char *arg)
 
int opt_filter_hw_device (void *optctx, const char *opt, const char *arg)
 
int opt_filter_threads (void *optctx, const char *opt, const char *arg)
 
void cancelSession (long sessionId)
 
int cancelRequested (long sessionId)
 
static int sub2video_get_blank_frame (InputStream *ist)
 
static void sub2video_copy_rect (uint8_t *dst, int dst_linesize, int w, int h, AVSubtitleRect *r)
 
static void sub2video_push_ref (InputStream *ist, int64_t pts)
 
void sub2video_update (InputStream *ist, int64_t heartbeat_pts, AVSubtitle *sub)
 
static void sub2video_heartbeat (InputStream *ist, int64_t pts)
 
static void sub2video_flush (InputStream *ist)
 
static void term_exit_sigsafe (void)
 
void term_exit (void)
 
static void sigterm_handler (int sig)
 
void term_init (void)
 
static int read_key (void)
 
int decode_interrupt_cb (void *ctx)
 
static void ffmpeg_cleanup (int ret)
 
void remove_avoptions (AVDictionary **a, AVDictionary *b)
 
void assert_avoptions (AVDictionary *m)
 
static void abort_codec_experimental (const AVCodec *c, int encoder)
 
static void update_benchmark (const char *fmt,...)
 
static void close_output_stream (OutputStream *ost)
 
static void output_packet (OutputFile *of, AVPacket *pkt, OutputStream *ost, int eof)
 
static int check_recording_time (OutputStream *ost)
 
static double adjust_frame_pts_to_encoder_tb (OutputFile *of, OutputStream *ost, AVFrame *frame)
 
static int init_output_stream (OutputStream *ost, AVFrame *frame, char *error, int error_len)
 
static int init_output_stream_wrapper (OutputStream *ost, AVFrame *frame, unsigned int fatal)
 
static double psnr (double d)
 
static void update_video_stats (OutputStream *ost, const AVPacket *pkt, int write_vstats)
 
static int encode_frame (OutputFile *of, OutputStream *ost, AVFrame *frame)
 
static void do_audio_out (OutputFile *of, OutputStream *ost, AVFrame *frame)
 
static void do_subtitle_out (OutputFile *of, OutputStream *ost, AVSubtitle *sub)
 
static void do_video_out (OutputFile *of, OutputStream *ost, AVFrame *next_picture)
 
static void finish_output_stream (OutputStream *ost)
 
static int reap_filters (int flush)
 
static void print_final_stats (int64_t total_size)
 
static void forward_report (int is_last_report, int64_t timer_start, int64_t cur_time)
 
static void print_report (int is_last_report, int64_t timer_start, int64_t cur_time)
 
static int ifilter_parameters_from_codecpar (InputFilter *ifilter, AVCodecParameters *par)
 
static void flush_encoders (void)
 
static int check_output_constraints (InputStream *ist, OutputStream *ost)
 
static void do_streamcopy (InputStream *ist, OutputStream *ost, const AVPacket *pkt)
 
int guess_input_channel_layout (InputStream *ist)
 
static void check_decode_result (InputStream *ist, int *got_output, int ret)
 
static int ifilter_send_frame (InputFilter *ifilter, AVFrame *frame, int keep_reference)
 
static int ifilter_send_eof (InputFilter *ifilter, int64_t pts)
 
static int decode (AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt)
 
static int send_frame_to_filters (InputStream *ist, AVFrame *decoded_frame)
 
static int decode_audio (InputStream *ist, AVPacket *pkt, int *got_output, int *decode_failed)
 
static int decode_video (InputStream *ist, AVPacket *pkt, int *got_output, int64_t *duration_pts, int eof, int *decode_failed)
 
static int transcode_subtitles (InputStream *ist, AVPacket *pkt, int *got_output, int *decode_failed)
 
static int send_filter_eof (InputStream *ist)
 
static int process_input_packet (InputStream *ist, const AVPacket *pkt, int no_eof)
 
static enum AVPixelFormat get_format (AVCodecContext *s, const enum AVPixelFormat *pix_fmts)
 
static int init_input_stream (int ist_index, char *error, int error_len)
 
static InputStreamget_input_stream (OutputStream *ost)
 
static int compare_int64 (const void *a, const void *b)
 
static int init_output_bsfs (OutputStream *ost)
 
static int init_output_stream_streamcopy (OutputStream *ost)
 
static void set_encoder_id (OutputFile *of, OutputStream *ost)
 
static void parse_forced_key_frames (char *kf, OutputStream *ost, AVCodecContext *avctx)
 
static void init_encoder_time_base (OutputStream *ost, AVRational default_time_base)
 
static int init_output_stream_encode (OutputStream *ost, AVFrame *frame)
 
static void report_new_stream (int input_index, AVPacket *pkt)
 
static int transcode_init (void)
 
static int need_output (void)
 
static OutputStreamchoose_output (void)
 
static void set_tty_echo (int on)
 
static int check_keyboard_interaction (int64_t cur_time)
 
static int get_input_packet (InputFile *f, AVPacket **pkt)
 
static int got_eagain (void)
 
static void reset_eagain (void)
 
static AVRational duration_max (int64_t tmp, int64_t *duration, AVRational tmp_time_base, AVRational time_base)
 
static int seek_to_start (InputFile *ifile, AVFormatContext *is)
 
static int process_input (int file_index)
 
static int transcode_from_filter (FilterGraph *graph, InputStream **best_ist)
 
static int transcode_step (void)
 
static int transcode (void)
 
void ffmpeg_var_cleanup ()
 
void set_report_callback (void(*callback)(int, float, float, int64_t, int, double, double))
 
void cancel_operation (long id)
 
int ffmpeg_execute (int argc, char **argv)
 

Variables

static FILE * vstats_file
 
const char *const forced_keyframes_const_names []
 
__thread int64_t nb_frames_dup = 0
 
__thread uint64_t dup_warning = 1000
 
__thread int64_t nb_frames_drop = 0
 
__thread int64_t decode_error_stat [2]
 
__thread unsigned nb_output_dumped = 0
 
__thread int want_sdp = 1
 
__thread BenchmarkTimeStamps current_time
 
__thread AVIOContext * progress_avio = NULL
 
__thread uint8_t * subtitle_out
 
__thread InputStream ** input_streams = NULL
 
__thread int nb_input_streams = 0
 
__thread InputFile ** input_files = NULL
 
__thread int nb_input_files = 0
 
__thread OutputStream ** output_streams = NULL
 
__thread int nb_output_streams = 0
 
__thread OutputFile ** output_files = NULL
 
__thread int nb_output_files = 0
 
__thread FilterGraph ** filtergraphs
 
__thread int nb_filtergraphs
 
__thread int64_t last_time = -1
 
__thread int64_t keyboard_last_time = 0
 
__thread int first_report = 1
 
__thread int qp_histogram [52]
 
void(* report_callback )(int, float, float, int64_t, int, double, double) = NULL
 
__thread int input_sync
 
__thread int file_overwrite
 
__thread int no_file_overwrite
 
__thread int do_psnr
 
__thread int ignore_unknown_streams
 
__thread int copy_unknown_streams
 
__thread int recast_media
 
volatile int handleSIGQUIT
 
volatile int handleSIGINT
 
volatile int handleSIGTERM
 
volatile int handleSIGXCPU
 
volatile int handleSIGPIPE
 
__thread long globalSessionId
 
static volatile int received_sigterm = 0
 
static volatile int received_nb_signals = 0
 
__thread atomic_int transcode_init_done = ATOMIC_VAR_INIT(0)
 
__thread int ffmpeg_exited = 0
 
__thread int main_ffmpeg_return_code = 0
 
__thread int64_t copy_ts_first_pts = AV_NOPTS_VALUE
 
__thread int longjmp_value
 
__thread const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL }
 
__thread OptionDefffmpeg_options = NULL
 

Detailed Description

multimedia converter based on the FFmpeg libraries

Definition in file fftools_ffmpeg.c.

Macro Definition Documentation

◆ OFFSET

#define OFFSET (   x)    offsetof(OptionsContext, x)

◆ SIGNAL

#define SIGNAL (   sig,
  func 
)     signal(sig, func)

Definition at line 520 of file fftools_ffmpeg.c.

Typedef Documentation

◆ BenchmarkTimeStamps

Function Documentation

◆ abort_codec_experimental()

static void abort_codec_experimental ( const AVCodec *  c,
int  encoder 
)
static

Definition at line 812 of file fftools_ffmpeg.c.

◆ adjust_frame_pts_to_encoder_tb()

static double adjust_frame_pts_to_encoder_tb ( OutputFile of,
OutputStream ost,
AVFrame *  frame 
)
static

Definition at line 900 of file fftools_ffmpeg.c.

◆ assert_avoptions()

void assert_avoptions ( AVDictionary *  m)

Definition at line 803 of file fftools_ffmpeg.c.

◆ cancel_operation()

void cancel_operation ( long  id)

Definition at line 4764 of file fftools_ffmpeg.c.

◆ cancelRequested()

int cancelRequested ( long  sessionId)

Checks whether a cancel request for the given session id exists in the session map.

Parameters
sessionIdsession id
Returns
1 if exists, false otherwise

Definition at line 441 of file FFmpegKitConfig.cpp.

◆ cancelSession()

void cancelSession ( long  sessionId)

Adds a cancel session request to the session map.

Parameters
sessionIdsession id

Definition at line 431 of file FFmpegKitConfig.cpp.

◆ check_decode_result()

static void check_decode_result ( InputStream ist,
int got_output,
int  ret 
)
static

Definition at line 2109 of file fftools_ffmpeg.c.

◆ check_keyboard_interaction()

static int check_keyboard_interaction ( int64_t  cur_time)
static

Definition at line 3733 of file fftools_ffmpeg.c.

◆ check_output_constraints()

static int check_output_constraints ( InputStream ist,
OutputStream ost 
)
static

Definition at line 1996 of file fftools_ffmpeg.c.

◆ check_recording_time()

static int check_recording_time ( OutputStream ost)
static

Definition at line 887 of file fftools_ffmpeg.c.

◆ choose_output()

static OutputStream * choose_output ( void  )
static

Select the output stream to process.

Returns
selected output stream, or NULL if none available

Definition at line 3694 of file fftools_ffmpeg.c.

◆ close_output_stream()

static void close_output_stream ( OutputStream ost)
static

Definition at line 838 of file fftools_ffmpeg.c.

◆ compare_int64()

static int compare_int64 ( const void *  a,
const void *  b 
)
static

Definition at line 2879 of file fftools_ffmpeg.c.

◆ decode()

static int decode ( AVCodecContext *  avctx,
AVFrame *  frame,
int got_frame,
AVPacket *  pkt 
)
static

Definition at line 2253 of file fftools_ffmpeg.c.

◆ decode_audio()

static int decode_audio ( InputStream ist,
AVPacket *  pkt,
int got_output,
int decode_failed 
)
static

Definition at line 2294 of file fftools_ffmpeg.c.

◆ decode_interrupt_cb()

int decode_interrupt_cb ( void *  ctx)

Definition at line 641 of file fftools_ffmpeg.c.

◆ decode_video()

static int decode_video ( InputStream ist,
AVPacket *  pkt,
int got_output,
int64_t *  duration_pts,
int  eof,
int decode_failed 
)
static

Definition at line 2354 of file fftools_ffmpeg.c.

◆ do_audio_out()

static void do_audio_out ( OutputFile of,
OutputStream ost,
AVFrame *  frame 
)
static

Definition at line 1110 of file fftools_ffmpeg.c.

◆ do_streamcopy()

static void do_streamcopy ( InputStream ist,
OutputStream ost,
const AVPacket *  pkt 
)
static

Definition at line 2013 of file fftools_ffmpeg.c.

◆ do_subtitle_out()

static void do_subtitle_out ( OutputFile of,
OutputStream ost,
AVSubtitle *  sub 
)
static

Definition at line 1130 of file fftools_ffmpeg.c.

◆ do_video_out()

static void do_video_out ( OutputFile of,
OutputStream ost,
AVFrame *  next_picture 
)
static

Definition at line 1214 of file fftools_ffmpeg.c.

◆ duration_max()

static AVRational duration_max ( int64_t  tmp,
int64_t *  duration,
AVRational  tmp_time_base,
AVRational  time_base 
)
static

Definition at line 4015 of file fftools_ffmpeg.c.

◆ encode_frame()

static int encode_frame ( OutputFile of,
OutputStream ost,
AVFrame *  frame 
)
static

Definition at line 1028 of file fftools_ffmpeg.c.

◆ ffmpeg_cleanup()

static void ffmpeg_cleanup ( int  ret)
static

Definition at line 648 of file fftools_ffmpeg.c.

◆ ffmpeg_execute()

int ffmpeg_execute ( int  argc,
char **  argv 
)

Forward declaration for function defined in fftools_ffmpeg.c

Definition at line 4775 of file fftools_ffmpeg.c.

◆ ffmpeg_var_cleanup()

void ffmpeg_var_cleanup ( )

Definition at line 4724 of file fftools_ffmpeg.c.

◆ finish_output_stream()

static void finish_output_stream ( OutputStream ost)
static

Definition at line 1430 of file fftools_ffmpeg.c.

◆ flush_encoders()

static void flush_encoders ( void  )
static

Definition at line 1937 of file fftools_ffmpeg.c.

◆ forward_report()

static void forward_report ( int  is_last_report,
int64_t  timer_start,
int64_t  cur_time 
)
static

Definition at line 1643 of file fftools_ffmpeg.c.

◆ get_benchmark_time_stamps()

static BenchmarkTimeStamps get_benchmark_time_stamps ( void  )
static

Definition at line 4680 of file fftools_ffmpeg.c.

◆ get_format()

static enum AVPixelFormat get_format ( AVCodecContext *  s,
const enum AVPixelFormat *  pix_fmts 
)
static

Definition at line 2758 of file fftools_ffmpeg.c.

◆ get_input_packet()

static int get_input_packet ( InputFile f,
AVPacket **  pkt 
)
static

Definition at line 3967 of file fftools_ffmpeg.c.

◆ get_input_stream()

static InputStream * get_input_stream ( OutputStream ost)
static

Definition at line 2872 of file fftools_ffmpeg.c.

◆ getmaxrss()

static int64_t getmaxrss ( void  )
static

Definition at line 4706 of file fftools_ffmpeg.c.

◆ got_eagain()

static int got_eagain ( void  )
static

Definition at line 3996 of file fftools_ffmpeg.c.

◆ guess_input_channel_layout()

int guess_input_channel_layout ( InputStream ist)

Definition at line 2090 of file fftools_ffmpeg.c.

◆ ifilter_has_all_input_formats()

static int ifilter_has_all_input_formats ( FilterGraph fg)
static

Definition at line 2128 of file fftools_ffmpeg.c.

◆ ifilter_parameters_from_codecpar()

static int ifilter_parameters_from_codecpar ( InputFilter ifilter,
AVCodecParameters *  par 
)
static

Definition at line 1919 of file fftools_ffmpeg.c.

◆ ifilter_send_eof()

static int ifilter_send_eof ( InputFilter ifilter,
int64_t  pts 
)
static

Definition at line 2219 of file fftools_ffmpeg.c.

◆ ifilter_send_frame()

static int ifilter_send_frame ( InputFilter ifilter,
AVFrame *  frame,
int  keep_reference 
)
static

Definition at line 2139 of file fftools_ffmpeg.c.

◆ init_encoder_time_base()

static void init_encoder_time_base ( OutputStream ost,
AVRational  default_time_base 
)
static

Definition at line 3136 of file fftools_ffmpeg.c.

◆ init_input_stream()

static int init_input_stream ( int  ist_index,
char *  error,
int  error_len 
)
static

Definition at line 2807 of file fftools_ffmpeg.c.

◆ init_output_bsfs()

static int init_output_bsfs ( OutputStream ost)
static

Definition at line 2884 of file fftools_ffmpeg.c.

◆ init_output_stream()

static int init_output_stream ( OutputStream ost,
AVFrame *  frame,
char *  error,
int  error_len 
)
static

Definition at line 3323 of file fftools_ffmpeg.c.

◆ init_output_stream_encode()

static int init_output_stream_encode ( OutputStream ost,
AVFrame *  frame 
)
static

Definition at line 3160 of file fftools_ffmpeg.c.

◆ init_output_stream_streamcopy()

static int init_output_stream_streamcopy ( OutputStream ost)
static

Definition at line 2913 of file fftools_ffmpeg.c.

◆ init_output_stream_wrapper()

static int init_output_stream_wrapper ( OutputStream ost,
AVFrame *  frame,
unsigned int  fatal 
)
static

Definition at line 947 of file fftools_ffmpeg.c.

◆ need_output()

static int need_output ( void  )
static

Definition at line 3664 of file fftools_ffmpeg.c.

◆ opt_abort_on()

int opt_abort_on ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 383 of file fftools_ffmpeg_opt.c.

◆ opt_attach()

int opt_attach ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 559 of file fftools_ffmpeg_opt.c.

◆ opt_audio_codec()

int opt_audio_codec ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 417 of file fftools_ffmpeg_opt.c.

◆ opt_audio_filters()

int opt_audio_filters ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 3398 of file fftools_ffmpeg_opt.c.

◆ opt_audio_frames()

int opt_audio_frames ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 3254 of file fftools_ffmpeg_opt.c.

◆ opt_audio_qscale()

int opt_audio_qscale ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 3425 of file fftools_ffmpeg_opt.c.

◆ opt_bitrate()

int opt_bitrate ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 3346 of file fftools_ffmpeg_opt.c.

◆ opt_channel_layout()

int opt_channel_layout ( void *  optctx,
const char *  opt,
const char *  arg 
)

◆ opt_data_codec()

int opt_data_codec ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 435 of file fftools_ffmpeg_opt.c.

◆ opt_data_frames()

int opt_data_frames ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 3260 of file fftools_ffmpeg_opt.c.

◆ opt_filter_complex()

int opt_filter_complex ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 3431 of file fftools_ffmpeg_opt.c.

◆ opt_filter_complex_script()

int opt_filter_complex_script ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 3445 of file fftools_ffmpeg_opt.c.

◆ opt_filter_hw_device()

int opt_filter_hw_device ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 698 of file fftools_ffmpeg_opt.c.

◆ opt_filter_threads()

int opt_filter_threads ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 376 of file fftools_ffmpeg_opt.c.

◆ opt_init_hw_device()

int opt_init_hw_device ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 683 of file fftools_ffmpeg_opt.c.

◆ opt_map()

int opt_map ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 441 of file fftools_ffmpeg_opt.c.

◆ opt_map_channel()

int opt_map_channel ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 567 of file fftools_ffmpeg_opt.c.

◆ opt_old2new()

int opt_old2new ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 3334 of file fftools_ffmpeg_opt.c.

◆ opt_preset()

int opt_preset ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 3286 of file fftools_ffmpeg_opt.c.

◆ opt_profile()

int opt_profile ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 3380 of file fftools_ffmpeg_opt.c.

◆ opt_progress()

int opt_progress ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 3645 of file fftools_ffmpeg_opt.c.

◆ opt_qscale()

int opt_qscale ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 3362 of file fftools_ffmpeg_opt.c.

◆ opt_recording_timestamp()

int opt_recording_timestamp ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 836 of file fftools_ffmpeg_opt.c.

◆ opt_sameq()

int opt_sameq ( void *  optctx,
const char *  opt,
const char *  arg 
)

◆ opt_sdp_file()

int opt_sdp_file ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 644 of file fftools_ffmpeg_opt.c.

◆ opt_stats_period()

int opt_stats_period ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 402 of file fftools_ffmpeg_opt.c.

◆ opt_streamid()

int opt_streamid ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 2223 of file fftools_ffmpeg_opt.c.

◆ opt_subtitle_codec()

int opt_subtitle_codec ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 429 of file fftools_ffmpeg_opt.c.

◆ opt_target()

int opt_target ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 3081 of file fftools_ffmpeg_opt.c.

◆ opt_timecode()

int opt_timecode ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 3411 of file fftools_ffmpeg_opt.c.

◆ opt_video_channel()

int opt_video_channel ( void *  optctx,
const char *  opt,
const char *  arg 
)

◆ opt_video_codec()

int opt_video_codec ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 423 of file fftools_ffmpeg_opt.c.

◆ opt_video_filters()

int opt_video_filters ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 3392 of file fftools_ffmpeg_opt.c.

◆ opt_video_frames()

int opt_video_frames ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 3248 of file fftools_ffmpeg_opt.c.

◆ opt_video_standard()

int opt_video_standard ( void *  optctx,
const char *  opt,
const char *  arg 
)

◆ opt_vstats()

int opt_vstats ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 3232 of file fftools_ffmpeg_opt.c.

◆ opt_vstats_file()

int opt_vstats_file ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 3225 of file fftools_ffmpeg_opt.c.

◆ opt_vsync()

int opt_vsync ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 3404 of file fftools_ffmpeg_opt.c.

◆ output_packet()

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

Definition at line 861 of file fftools_ffmpeg.c.

◆ parse_forced_key_frames()

static void parse_forced_key_frames ( char *  kf,
OutputStream ost,
AVCodecContext *  avctx 
)
static

Definition at line 3073 of file fftools_ffmpeg.c.

◆ print_final_stats()

static void print_final_stats ( int64_t  total_size)
static

Definition at line 1526 of file fftools_ffmpeg.c.

◆ print_report()

static void print_report ( int  is_last_report,
int64_t  timer_start,
int64_t  cur_time 
)
static

Definition at line 1712 of file fftools_ffmpeg.c.

◆ process_input()

static int process_input ( int  file_index)
static

Definition at line 4100 of file fftools_ffmpeg.c.

◆ process_input_packet()

static int process_input_packet ( InputStream ist,
const AVPacket *  pkt,
int  no_eof 
)
static

Definition at line 2570 of file fftools_ffmpeg.c.

◆ psnr()

static double psnr ( double  d)
static

Definition at line 968 of file fftools_ffmpeg.c.

◆ read_key()

static int read_key ( void  )
static

Definition at line 588 of file fftools_ffmpeg.c.

◆ reap_filters()

static int reap_filters ( int  flush)
static

Get and encode new output from any of the filtergraphs, without causing activity.

Returns
0 for success, <0 for severe errors

Definition at line 1449 of file fftools_ffmpeg.c.

◆ remove_avoptions()

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

Definition at line 794 of file fftools_ffmpeg.c.

◆ report_new_stream()

static void report_new_stream ( int  input_index,
AVPacket *  pkt 
)
static

Definition at line 3467 of file fftools_ffmpeg.c.

◆ reset_eagain()

static void reset_eagain ( void  )
static

Definition at line 4005 of file fftools_ffmpeg.c.

◆ seek_to_start()

static int seek_to_start ( InputFile ifile,
AVFormatContext *  is 
)
static

Definition at line 4034 of file fftools_ffmpeg.c.

◆ send_filter_eof()

static int send_filter_eof ( InputStream ist)
static

Definition at line 2554 of file fftools_ffmpeg.c.

◆ send_frame_to_filters()

static int send_frame_to_filters ( InputStream ist,
AVFrame *  decoded_frame 
)
static

Definition at line 2276 of file fftools_ffmpeg.c.

◆ set_encoder_id()

static void set_encoder_id ( OutputFile of,
OutputStream ost 
)
static

Definition at line 3032 of file fftools_ffmpeg.c.

◆ set_report_callback()

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

Definition at line 4759 of file fftools_ffmpeg.c.

◆ set_tty_echo()

static void set_tty_echo ( int  on)
static

Definition at line 3721 of file fftools_ffmpeg.c.

◆ show_hwaccels()

int show_hwaccels ( void *  optctx,
const char *  opt,
const char *  arg 
)

Definition at line 274 of file fftools_ffmpeg_opt.c.

◆ sigterm_handler()

static void sigterm_handler ( int  sig)
static

Definition at line 474 of file fftools_ffmpeg.c.

◆ sub2video_copy_rect()

static void sub2video_copy_rect ( uint8_t *  dst,
int  dst_linesize,
int  w,
int  h,
AVSubtitleRect *  r 
)
static

Definition at line 314 of file fftools_ffmpeg.c.

◆ sub2video_flush()

static void sub2video_flush ( InputStream ist)
static

Definition at line 435 of file fftools_ffmpeg.c.

◆ sub2video_get_blank_frame()

static int sub2video_get_blank_frame ( InputStream ist)
static

Definition at line 299 of file fftools_ffmpeg.c.

◆ sub2video_heartbeat()

static void sub2video_heartbeat ( InputStream ist,
int64_t  pts 
)
static

Definition at line 403 of file fftools_ffmpeg.c.

◆ sub2video_push_ref()

static void sub2video_push_ref ( InputStream ist,
int64_t  pts 
)
static

Definition at line 345 of file fftools_ffmpeg.c.

◆ sub2video_update()

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

Definition at line 363 of file fftools_ffmpeg.c.

◆ term_exit()

void term_exit ( void  )

Definition at line 459 of file fftools_ffmpeg.c.

◆ term_exit_sigsafe()

static void term_exit_sigsafe ( void  )
static

Definition at line 451 of file fftools_ffmpeg.c.

◆ term_init()

void term_init ( void  )

Definition at line 524 of file fftools_ffmpeg.c.

◆ transcode()

static int transcode ( void  )
static

Definition at line 4532 of file fftools_ffmpeg.c.

◆ transcode_from_filter()

static int transcode_from_filter ( FilterGraph graph,
InputStream **  best_ist 
)
static

Perform a step of transcoding for the specified filter graph.

Parameters
[in]graphfilter graph to consider
[out]best_istinput stream where a frame would allow to continue
Returns
0 for success, <0 for error

Definition at line 4396 of file fftools_ffmpeg.c.

◆ transcode_init()

static int transcode_init ( void  )
static

Definition at line 3482 of file fftools_ffmpeg.c.

◆ transcode_step()

static int transcode_step ( void  )
static

Run a single step of transcoding.

Returns
0 for success, <0 for error

Definition at line 4442 of file fftools_ffmpeg.c.

◆ transcode_subtitles()

static int transcode_subtitles ( InputStream ist,
AVPacket *  pkt,
int got_output,
int decode_failed 
)
static

Definition at line 2479 of file fftools_ffmpeg.c.

◆ update_benchmark()

static void update_benchmark ( const char *  fmt,
  ... 
)
static

Definition at line 817 of file fftools_ffmpeg.c.

◆ update_video_stats()

static void update_video_stats ( OutputStream ost,
const AVPacket *  pkt,
int  write_vstats 
)
static

Definition at line 973 of file fftools_ffmpeg.c.

Variable Documentation

◆ copy_ts_first_pts

__thread int64_t copy_ts_first_pts = AV_NOPTS_VALUE

Definition at line 470 of file fftools_ffmpeg.c.

◆ copy_unknown_streams

__thread int copy_unknown_streams
extern

Definition at line 220 of file fftools_ffmpeg_opt.c.

◆ current_time

__thread BenchmarkTimeStamps current_time

Definition at line 194 of file fftools_ffmpeg.c.

◆ decode_error_stat

__thread int64_t decode_error_stat[2]

Definition at line 189 of file fftools_ffmpeg.c.

◆ do_psnr

__thread int do_psnr
extern

Definition at line 217 of file fftools_ffmpeg_opt.c.

◆ dup_warning

__thread uint64_t dup_warning = 1000

Definition at line 187 of file fftools_ffmpeg.c.

◆ ffmpeg_exited

__thread int ffmpeg_exited = 0

Definition at line 468 of file fftools_ffmpeg.c.

◆ ffmpeg_options

__thread OptionDef* ffmpeg_options = NULL

Definition at line 4773 of file fftools_ffmpeg.c.

◆ file_overwrite

__thread int file_overwrite
extern

Definition at line 215 of file fftools_ffmpeg_opt.c.

◆ filtergraphs

__thread FilterGraph** filtergraphs

Definition at line 209 of file fftools_ffmpeg.c.

◆ first_report

__thread int first_report = 1

Definition at line 214 of file fftools_ffmpeg.c.

◆ forced_keyframes_const_names

const char* const forced_keyframes_const_names[]
Initial value:
= {
"n",
"n_forced",
"prev_forced_n",
"prev_forced_t",
"t",
NULL
}

Definition at line 167 of file fftools_ffmpeg.c.

◆ globalSessionId

__thread long globalSessionId
extern

Holds the id of the current execution

Definition at line 92 of file FFmpegKitConfig.cpp.

◆ handleSIGINT

volatile int handleSIGINT
extern

Definition at line 86 of file FFmpegKitConfig.cpp.

◆ handleSIGPIPE

volatile int handleSIGPIPE
extern

Definition at line 89 of file FFmpegKitConfig.cpp.

◆ handleSIGQUIT

volatile int handleSIGQUIT
extern

Fields that control the handling of SIGNALs

Definition at line 85 of file FFmpegKitConfig.cpp.

◆ handleSIGTERM

volatile int handleSIGTERM
extern

Definition at line 87 of file FFmpegKitConfig.cpp.

◆ handleSIGXCPU

volatile int handleSIGXCPU
extern

Definition at line 88 of file FFmpegKitConfig.cpp.

◆ ignore_unknown_streams

__thread int ignore_unknown_streams
extern

Definition at line 219 of file fftools_ffmpeg_opt.c.

◆ input_files

__thread InputFile** input_files = NULL

Definition at line 201 of file fftools_ffmpeg.c.

◆ input_streams

__thread InputStream** input_streams = NULL

Definition at line 199 of file fftools_ffmpeg.c.

◆ input_sync

__thread int input_sync
extern

◆ int_cb

__thread const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL }

Definition at line 646 of file fftools_ffmpeg.c.

◆ keyboard_last_time

__thread int64_t keyboard_last_time = 0

Definition at line 213 of file fftools_ffmpeg.c.

◆ last_time

__thread int64_t last_time = -1

Definition at line 212 of file fftools_ffmpeg.c.

◆ longjmp_value

__thread int longjmp_value
extern

Definition at line 106 of file fftools_cmdutils.c.

◆ main_ffmpeg_return_code

__thread int main_ffmpeg_return_code = 0

Definition at line 469 of file fftools_ffmpeg.c.

◆ nb_filtergraphs

__thread int nb_filtergraphs

Definition at line 210 of file fftools_ffmpeg.c.

◆ nb_frames_drop

__thread int64_t nb_frames_drop = 0

Definition at line 188 of file fftools_ffmpeg.c.

◆ nb_frames_dup

__thread int64_t nb_frames_dup = 0

Definition at line 186 of file fftools_ffmpeg.c.

◆ nb_input_files

__thread int nb_input_files = 0

Definition at line 202 of file fftools_ffmpeg.c.

◆ nb_input_streams

__thread int nb_input_streams = 0

Definition at line 200 of file fftools_ffmpeg.c.

◆ nb_output_dumped

__thread unsigned nb_output_dumped = 0

Definition at line 190 of file fftools_ffmpeg.c.

◆ nb_output_files

__thread int nb_output_files = 0

Definition at line 207 of file fftools_ffmpeg.c.

◆ nb_output_streams

__thread int nb_output_streams = 0

Definition at line 205 of file fftools_ffmpeg.c.

◆ no_file_overwrite

__thread int no_file_overwrite
extern

Definition at line 216 of file fftools_ffmpeg_opt.c.

◆ output_files

__thread OutputFile** output_files = NULL

Definition at line 206 of file fftools_ffmpeg.c.

◆ output_streams

__thread OutputStream** output_streams = NULL

Definition at line 204 of file fftools_ffmpeg.c.

◆ progress_avio

__thread AVIOContext* progress_avio = NULL

Definition at line 195 of file fftools_ffmpeg.c.

◆ qp_histogram

__thread int qp_histogram[52]

Definition at line 215 of file fftools_ffmpeg.c.

◆ recast_media

__thread int recast_media
extern

Definition at line 221 of file fftools_ffmpeg_opt.c.

◆ received_nb_signals

volatile int received_nb_signals = 0
static

Definition at line 466 of file fftools_ffmpeg.c.

◆ received_sigterm

volatile int received_sigterm = 0
static

Definition at line 465 of file fftools_ffmpeg.c.

◆ report_callback

void(* report_callback) (int, float, float, int64_t, int, double, double) ( int  ,
float  ,
float  ,
int64_t  ,
int  ,
double  ,
double   
) = NULL

Definition at line 217 of file fftools_ffmpeg.c.

◆ subtitle_out

__thread uint8_t* subtitle_out

Definition at line 197 of file fftools_ffmpeg.c.

◆ transcode_init_done

__thread atomic_int transcode_init_done = ATOMIC_VAR_INIT(0)

Definition at line 467 of file fftools_ffmpeg.c.

◆ vstats_file

FILE* vstats_file
static

Definition at line 165 of file fftools_ffmpeg.c.

◆ want_sdp

__thread int want_sdp = 1

Definition at line 192 of file fftools_ffmpeg.c.