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

Go to the source code of this file.

Data Structures

struct  FrameData
 
struct  BenchmarkTimeStamps
 

Macros

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

Typedefs

typedef struct FrameData FrameData
 
typedef struct BenchmarkTimeStamps BenchmarkTimeStamps
 

Functions

static int trigger_fix_sub_duration_heartbeat (OutputStream *ost, const AVPacket *pkt)
 
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)
 
static OutputStreamost_iter (OutputStream *prev)
 
InputStreamist_iter (InputStream *prev)
 
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 int check_recording_time (OutputStream *ost, int64_t ts, AVRational tb)
 
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)
 
void enc_stats_write (OutputStream *ost, EncStats *es, const AVFrame *frame, const AVPacket *pkt, uint64_t frame_num)
 
static int encode_frame (OutputFile *of, OutputStream *ost, AVFrame *frame)
 
static int submit_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 video_sync_process (OutputFile *of, OutputStream *ost, AVFrame *next_picture, double duration, int64_t *nb_frames, int64_t *nb_frames_prev)
 
enum AVPictureType forced_kf_apply (void *logctx, KeyframeForceCtx *kf, AVRational tb, const AVFrame *in_picture, int dup_idx)
 
static void do_video_out (OutputFile *of, OutputStream *ost, AVFrame *next_picture)
 
static int reap_filters (int flush)
 
static void print_final_stats (int64_t total_size)
 
static void forward_report (uint64_t frame_number, float fps, float quality, int64_t total_size, int seconds, int microseconds, double bitrate, double speed)
 
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)
 
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 (InputStream *ist, 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 process_subtitle (InputStream *ist, AVSubtitle *subtitle, int *got_output)
 
static int copy_av_subtitle (AVSubtitle *dst, AVSubtitle *src)
 
static int fix_sub_duration_heartbeat (InputStream *ist, int64_t signal_pts)
 
static int transcode_subtitles (InputStream *ist, const 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 (InputStream *ist, char *error, int error_len)
 
static int init_output_stream_streamcopy (OutputStream *ost)
 
static void set_encoder_id (OutputFile *of, OutputStream *ost)
 
static void init_encoder_time_base (OutputStream *ost, AVRational default_time_base)
 
static int init_output_stream_encode (OutputStream *ost, AVFrame *frame)
 
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 got_eagain (void)
 
static void reset_eagain (void)
 
static void decode_flush (InputFile *ifile)
 
static void ts_discontinuity_detect (InputFile *ifile, InputStream *ist, AVPacket *pkt)
 
static void ts_discontinuity_process (InputFile *ifile, InputStream *ist, AVPacket *pkt)
 
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, double, double, double))
 
void cancel_operation (long id)
 
int ffmpeg_execute (int argc, char **argv)
 

Variables

static __thread FILE * vstats_file
 
__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 BenchmarkTimeStamps current_time
 
__thread AVIOContext * progress_avio = NULL
 
__thread InputFile ** input_files = NULL
 
__thread int nb_input_files = 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, double, double, double) = NULL
 
__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 int want_sdp
 
__thread struct EncStatsFileenc_stats_files
 
__thread int nb_enc_stats_files
 
__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 531 of file fftools_ffmpeg.c.

Typedef Documentation

◆ BenchmarkTimeStamps

◆ FrameData

typedef struct FrameData FrameData

Function Documentation

◆ abort_codec_experimental()

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

Definition at line 797 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 844 of file fftools_ffmpeg.c.

◆ assert_avoptions()

void assert_avoptions ( AVDictionary *  m)

Definition at line 788 of file fftools_ffmpeg.c.

◆ cancel_operation()

void cancel_operation ( long  id)

Definition at line 4367 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 446 of file FFmpegKitConfig.cpp.

◆ cancelSession()

void cancelSession ( long  sessionId)

Adds a cancel session request to the session map.

Parameters
sessionIdsession id

Definition at line 436 of file FFmpegKitConfig.cpp.

◆ check_decode_result()

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

Definition at line 2128 of file fftools_ffmpeg.c.

◆ check_keyboard_interaction()

static int check_keyboard_interaction ( int64_t  cur_time)
static

Definition at line 3699 of file fftools_ffmpeg.c.

◆ check_output_constraints()

static int check_output_constraints ( InputStream ist,
OutputStream ost 
)
static

Definition at line 2028 of file fftools_ffmpeg.c.

◆ check_recording_time()

static int check_recording_time ( OutputStream ost,
int64_t  ts,
AVRational  tb 
)
static

Definition at line 832 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 3657 of file fftools_ffmpeg.c.

◆ close_output_stream()

static void close_output_stream ( OutputStream ost)
static

Definition at line 823 of file fftools_ffmpeg.c.

◆ copy_av_subtitle()

static int copy_av_subtitle ( AVSubtitle *  dst,
AVSubtitle *  src 
)
static

Definition at line 2570 of file fftools_ffmpeg.c.

◆ decode()

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

Definition at line 2272 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 2330 of file fftools_ffmpeg.c.

◆ decode_flush()

static void decode_flush ( InputFile ifile)
static

Definition at line 3824 of file fftools_ffmpeg.c.

◆ decode_interrupt_cb()

int decode_interrupt_cb ( void *  ctx)

Definition at line 652 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 2387 of file fftools_ffmpeg.c.

◆ do_audio_out()

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

Definition at line 1184 of file fftools_ffmpeg.c.

◆ do_streamcopy()

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

Definition at line 2044 of file fftools_ffmpeg.c.

◆ do_subtitle_out()

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

Definition at line 1210 of file fftools_ffmpeg.c.

◆ do_video_out()

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

Definition at line 1412 of file fftools_ffmpeg.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.

◆ encode_frame()

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

Definition at line 1036 of file fftools_ffmpeg.c.

◆ ffmpeg_cleanup()

static void ffmpeg_cleanup ( int  ret)
static

Definition at line 659 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 4378 of file fftools_ffmpeg.c.

◆ ffmpeg_var_cleanup()

void ffmpeg_var_cleanup ( )

Definition at line 4322 of file fftools_ffmpeg.c.

◆ fix_sub_duration_heartbeat()

static int fix_sub_duration_heartbeat ( InputStream ist,
int64_t  signal_pts 
)
static

Definition at line 2650 of file fftools_ffmpeg.c.

◆ flush_encoders()

static void flush_encoders ( void  )
static

Definition at line 1965 of file fftools_ffmpeg.c.

◆ forced_kf_apply()

enum AVPictureType forced_kf_apply ( void *  logctx,
KeyframeForceCtx kf,
AVRational  tb,
const AVFrame *  in_picture,
int  dup_idx 
)

Definition at line 1360 of file fftools_ffmpeg.c.

◆ forward_report()

static void forward_report ( uint64_t  frame_number,
float  fps,
float  quality,
int64_t  total_size,
int  seconds,
int  microseconds,
double  bitrate,
double  speed 
)
static

Definition at line 1728 of file fftools_ffmpeg.c.

◆ get_benchmark_time_stamps()

static BenchmarkTimeStamps get_benchmark_time_stamps ( void  )
static

Definition at line 4278 of file fftools_ffmpeg.c.

◆ get_format()

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

Definition at line 2929 of file fftools_ffmpeg.c.

◆ getmaxrss()

static int64_t getmaxrss ( void  )
static

Definition at line 4304 of file fftools_ffmpeg.c.

◆ got_eagain()

static int got_eagain ( void  )
static

Definition at line 3807 of file fftools_ffmpeg.c.

◆ ifilter_has_all_input_formats()

static int ifilter_has_all_input_formats ( FilterGraph fg)
static

Definition at line 2147 of file fftools_ffmpeg.c.

◆ ifilter_parameters_from_codecpar()

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

Definition at line 1947 of file fftools_ffmpeg.c.

◆ ifilter_send_eof()

static int ifilter_send_eof ( InputFilter ifilter,
int64_t  pts 
)
static

Definition at line 2238 of file fftools_ffmpeg.c.

◆ ifilter_send_frame()

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

Definition at line 2158 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 3190 of file fftools_ffmpeg.c.

◆ init_input_stream()

static int init_input_stream ( InputStream ist,
char *  error,
int  error_len 
)
static

Definition at line 2978 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 3388 of file fftools_ffmpeg.c.

◆ init_output_stream_encode()

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

Definition at line 3213 of file fftools_ffmpeg.c.

◆ init_output_stream_streamcopy()

static int init_output_stream_streamcopy ( OutputStream ost)
static

Definition at line 3037 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 889 of file fftools_ffmpeg.c.

◆ ist_iter()

InputStream * ist_iter ( InputStream prev)

Definition at line 763 of file fftools_ffmpeg.c.

◆ need_output()

static int need_output ( void  )
static

Definition at line 3640 of file fftools_ffmpeg.c.

◆ opt_abort_on()

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

Definition at line 345 of file fftools_ffmpeg_opt.c.

◆ opt_attach()

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

Definition at line 494 of file fftools_ffmpeg_opt.c.

◆ opt_audio_codec()

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

Definition at line 379 of file fftools_ffmpeg_opt.c.

◆ opt_audio_filters()

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

Definition at line 1120 of file fftools_ffmpeg_opt.c.

◆ opt_audio_frames()

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

Definition at line 976 of file fftools_ffmpeg_opt.c.

◆ opt_audio_qscale()

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

Definition at line 1147 of file fftools_ffmpeg_opt.c.

◆ opt_bitrate()

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

Definition at line 1068 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 397 of file fftools_ffmpeg_opt.c.

◆ opt_data_frames()

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

Definition at line 982 of file fftools_ffmpeg_opt.c.

◆ opt_filter_complex()

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

Definition at line 1153 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 1165 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 641 of file fftools_ffmpeg_opt.c.

◆ opt_filter_threads()

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

Definition at line 338 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 626 of file fftools_ffmpeg_opt.c.

◆ opt_map()

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

Definition at line 403 of file fftools_ffmpeg_opt.c.

◆ opt_map_channel()

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

Definition at line 503 of file fftools_ffmpeg_opt.c.

◆ opt_old2new()

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

Definition at line 1056 of file fftools_ffmpeg_opt.c.

◆ opt_preset()

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

Definition at line 1008 of file fftools_ffmpeg_opt.c.

◆ opt_profile()

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

Definition at line 1102 of file fftools_ffmpeg_opt.c.

◆ opt_progress()

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

Definition at line 1363 of file fftools_ffmpeg_opt.c.

◆ opt_qscale()

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

Definition at line 1084 of file fftools_ffmpeg_opt.c.

◆ opt_recording_timestamp()

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

Definition at line 655 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 587 of file fftools_ffmpeg_opt.c.

◆ opt_stats_period()

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

Definition at line 364 of file fftools_ffmpeg_opt.c.

◆ opt_streamid()

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

Definition at line 769 of file fftools_ffmpeg_opt.c.

◆ opt_subtitle_codec()

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

Definition at line 391 of file fftools_ffmpeg_opt.c.

◆ opt_target()

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

Definition at line 803 of file fftools_ffmpeg_opt.c.

◆ opt_timecode()

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

Definition at line 1133 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 385 of file fftools_ffmpeg_opt.c.

◆ opt_video_filters()

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

Definition at line 1114 of file fftools_ffmpeg_opt.c.

◆ opt_video_frames()

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

Definition at line 970 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 954 of file fftools_ffmpeg_opt.c.

◆ opt_vstats_file()

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

Definition at line 947 of file fftools_ffmpeg_opt.c.

◆ opt_vsync()

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

Definition at line 1126 of file fftools_ffmpeg_opt.c.

◆ ost_iter()

static OutputStream * ost_iter ( OutputStream prev)
static

Definition at line 747 of file fftools_ffmpeg.c.

◆ print_final_stats()

static void print_final_stats ( int64_t  total_size)
static

Definition at line 1608 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 1736 of file fftools_ffmpeg.c.

◆ process_input()

static int process_input ( int  file_index)
static

Definition at line 3946 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 2737 of file fftools_ffmpeg.c.

◆ process_subtitle()

static int process_subtitle ( InputStream ist,
AVSubtitle *  subtitle,
int got_output 
)
static

Definition at line 2511 of file fftools_ffmpeg.c.

◆ psnr()

static double psnr ( double  d)
static

Definition at line 910 of file fftools_ffmpeg.c.

◆ read_key()

static int read_key ( void  )
static

Definition at line 599 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 1520 of file fftools_ffmpeg.c.

◆ remove_avoptions()

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

Definition at line 779 of file fftools_ffmpeg.c.

◆ reset_eagain()

static void reset_eagain ( void  )
static

Definition at line 3815 of file fftools_ffmpeg.c.

◆ send_filter_eof()

static int send_filter_eof ( InputStream ist)
static

Definition at line 2721 of file fftools_ffmpeg.c.

◆ send_frame_to_filters()

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

Definition at line 2312 of file fftools_ffmpeg.c.

◆ set_encoder_id()

static void set_encoder_id ( OutputFile of,
OutputStream ost 
)
static

Definition at line 3167 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.

◆ set_tty_echo()

static void set_tty_echo ( int  on)
static

Definition at line 3687 of file fftools_ffmpeg.c.

◆ show_hwaccels()

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

Definition at line 198 of file fftools_ffmpeg_opt.c.

◆ sigterm_handler()

static void sigterm_handler ( int  sig)
static

Definition at line 477 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 313 of file fftools_ffmpeg.c.

◆ sub2video_flush()

static void sub2video_flush ( InputStream ist)
static

Definition at line 434 of file fftools_ffmpeg.c.

◆ sub2video_get_blank_frame()

static int sub2video_get_blank_frame ( InputStream ist)
static

Definition at line 298 of file fftools_ffmpeg.c.

◆ sub2video_heartbeat()

static void sub2video_heartbeat ( InputStream ist,
int64_t  pts 
)
static

Definition at line 402 of file fftools_ffmpeg.c.

◆ sub2video_push_ref()

static void sub2video_push_ref ( InputStream ist,
int64_t  pts 
)
static

Definition at line 344 of file fftools_ffmpeg.c.

◆ sub2video_update()

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

Definition at line 362 of file fftools_ffmpeg.c.

◆ submit_encode_frame()

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

Definition at line 1138 of file fftools_ffmpeg.c.

◆ term_exit()

void term_exit ( void  )

Definition at line 458 of file fftools_ffmpeg.c.

◆ term_exit_sigsafe()

static void term_exit_sigsafe ( void  )
static

Definition at line 450 of file fftools_ffmpeg.c.

◆ term_init()

void term_init ( void  )

Definition at line 535 of file fftools_ffmpeg.c.

◆ transcode()

static int transcode ( void  )
static

Definition at line 4192 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 4056 of file fftools_ffmpeg.c.

◆ transcode_init()

static int transcode_init ( void  )
static

Definition at line 3500 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 4102 of file fftools_ffmpeg.c.

◆ transcode_subtitles()

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

Definition at line 2700 of file fftools_ffmpeg.c.

◆ trigger_fix_sub_duration_heartbeat()

static int trigger_fix_sub_duration_heartbeat ( OutputStream ost,
const AVPacket *  pkt 
)
static

Definition at line 2669 of file fftools_ffmpeg.c.

◆ ts_discontinuity_detect()

static void ts_discontinuity_detect ( InputFile ifile,
InputStream ist,
AVPacket *  pkt 
)
static

Definition at line 3855 of file fftools_ffmpeg.c.

◆ ts_discontinuity_process()

static void ts_discontinuity_process ( InputFile ifile,
InputStream ist,
AVPacket *  pkt 
)
static

Definition at line 3919 of file fftools_ffmpeg.c.

◆ update_benchmark()

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

Definition at line 802 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 915 of file fftools_ffmpeg.c.

◆ video_sync_process()

static void video_sync_process ( OutputFile of,
OutputStream ost,
AVFrame *  next_picture,
double  duration,
int64_t *  nb_frames,
int64_t *  nb_frames_prev 
)
static

Definition at line 1291 of file fftools_ffmpeg.c.

Variable Documentation

◆ copy_ts_first_pts

__thread int64_t copy_ts_first_pts = AV_NOPTS_VALUE

Definition at line 469 of file fftools_ffmpeg.c.

◆ copy_unknown_streams

__thread int copy_unknown_streams
extern

Definition at line 141 of file fftools_ffmpeg_opt.c.

◆ current_time

__thread BenchmarkTimeStamps current_time

Definition at line 204 of file fftools_ffmpeg.c.

◆ decode_error_stat

__thread int64_t decode_error_stat[2]

Definition at line 201 of file fftools_ffmpeg.c.

◆ do_psnr

__thread int do_psnr
extern

Definition at line 138 of file fftools_ffmpeg_opt.c.

◆ dup_warning

__thread uint64_t dup_warning = 1000

Definition at line 199 of file fftools_ffmpeg.c.

◆ enc_stats_files

__thread struct EncStatsFile* enc_stats_files
extern

Definition at line 198 of file fftools_ffmpeg_mux_init.c.

◆ ffmpeg_exited

__thread int ffmpeg_exited = 0

Definition at line 467 of file fftools_ffmpeg.c.

◆ ffmpeg_options

__thread OptionDef* ffmpeg_options = NULL

Definition at line 4376 of file fftools_ffmpeg.c.

◆ file_overwrite

__thread int file_overwrite
extern

Definition at line 135 of file fftools_ffmpeg_opt.c.

◆ filtergraphs

__thread FilterGraph** filtergraphs

Definition at line 213 of file fftools_ffmpeg.c.

◆ first_report

__thread int first_report = 1

Definition at line 218 of file fftools_ffmpeg.c.

◆ globalSessionId

__thread long globalSessionId
extern

Holds the id of the current execution

Definition at line 97 of file FFmpegKitConfig.cpp.

◆ handleSIGINT

volatile int handleSIGINT
extern

Definition at line 91 of file FFmpegKitConfig.cpp.

◆ handleSIGPIPE

volatile int handleSIGPIPE
extern

Definition at line 94 of file FFmpegKitConfig.cpp.

◆ handleSIGQUIT

volatile int handleSIGQUIT
extern

Fields that control the handling of SIGNALs

Definition at line 90 of file FFmpegKitConfig.cpp.

◆ handleSIGTERM

volatile int handleSIGTERM
extern

Definition at line 92 of file FFmpegKitConfig.cpp.

◆ handleSIGXCPU

volatile int handleSIGXCPU
extern

Definition at line 93 of file FFmpegKitConfig.cpp.

◆ 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 = NULL

Definition at line 207 of file fftools_ffmpeg.c.

◆ int_cb

__thread const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL }

Definition at line 657 of file fftools_ffmpeg.c.

◆ keyboard_last_time

__thread int64_t keyboard_last_time = 0

Definition at line 217 of file fftools_ffmpeg.c.

◆ last_time

__thread int64_t last_time = -1

Definition at line 216 of file fftools_ffmpeg.c.

◆ longjmp_value

__thread int longjmp_value
extern

Definition at line 113 of file fftools_cmdutils.c.

◆ main_ffmpeg_return_code

__thread int main_ffmpeg_return_code = 0

Definition at line 468 of file fftools_ffmpeg.c.

◆ nb_enc_stats_files

__thread int nb_enc_stats_files
extern

Definition at line 199 of file fftools_ffmpeg_mux_init.c.

◆ nb_filtergraphs

__thread int nb_filtergraphs

Definition at line 214 of file fftools_ffmpeg.c.

◆ nb_frames_drop

__thread int64_t nb_frames_drop = 0

Definition at line 200 of file fftools_ffmpeg.c.

◆ nb_frames_dup

__thread int64_t nb_frames_dup = 0

Definition at line 198 of file fftools_ffmpeg.c.

◆ nb_input_files

__thread int nb_input_files = 0

Definition at line 208 of file fftools_ffmpeg.c.

◆ nb_output_dumped

__thread unsigned nb_output_dumped = 0

Definition at line 202 of file fftools_ffmpeg.c.

◆ nb_output_files

__thread int nb_output_files = 0

Definition at line 211 of file fftools_ffmpeg.c.

◆ no_file_overwrite

__thread int no_file_overwrite
extern

Definition at line 136 of file fftools_ffmpeg_opt.c.

◆ output_files

__thread OutputFile** output_files = NULL

Definition at line 210 of file fftools_ffmpeg.c.

◆ progress_avio

__thread AVIOContext* progress_avio = NULL

Definition at line 205 of file fftools_ffmpeg.c.

◆ qp_histogram

__thread int qp_histogram[52]

Definition at line 219 of file fftools_ffmpeg.c.

◆ recast_media

__thread int recast_media
extern

Definition at line 142 of file fftools_ffmpeg_opt.c.

◆ received_nb_signals

volatile int received_nb_signals = 0
static

Definition at line 465 of file fftools_ffmpeg.c.

◆ received_sigterm

volatile int received_sigterm = 0
static

Definition at line 464 of file fftools_ffmpeg.c.

◆ report_callback

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

Definition at line 221 of file fftools_ffmpeg.c.

◆ transcode_init_done

__thread atomic_int transcode_init_done = ATOMIC_VAR_INIT(0)

Definition at line 466 of file fftools_ffmpeg.c.

◆ vstats_file

__thread FILE* vstats_file
static

Definition at line 178 of file fftools_ffmpeg.c.

◆ want_sdp

__thread int want_sdp
extern

Definition at line 66 of file fftools_ffmpeg_mux.c.