FFmpegKit Android API 4.5
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 void do_video_stats (OutputStream *ost, int frame_size)
 
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)
 
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_all_output_streams (OutputStream *ost, OSTFinished this_stream, OSTFinished others)
 
static void write_packet (OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
 
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 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 double psnr (double d)
 
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 void 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)
 
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 void print_sdp (void)
 
static enum AVPixelFormat get_format (AVCodecContext *s, const enum AVPixelFormat *pix_fmts)
 
static int get_buffer (AVCodecContext *s, AVFrame *frame, int flags)
 
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 check_init_output_file (OutputFile *of, int file_index)
 
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)
 
static void log_callback_null (void *ptr, int level, const char *fmt, va_list vl)
 
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 int run_as_daemon = 0
 
__thread int nb_frames_dup = 0
 
__thread unsigned dup_warning = 1000
 
__thread int 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 file_overwrite
 
__thread int no_file_overwrite
 
__thread int ignore_unknown_streams
 
__thread int copy_unknown_streams
 
__thread int intra_only
 
__thread int do_psnr
 
__thread int input_sync
 
volatile int handleSIGQUIT
 
volatile int handleSIGINT
 
volatile int handleSIGTERM
 
volatile int handleSIGXCPU
 
volatile int handleSIGPIPE
 
__thread volatile 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 volatile int ffmpeg_exited = 0
 
__thread volatile int main_ffmpeg_return_code = 0
 
__thread int64_t copy_ts_first_pts = AV_NOPTS_VALUE
 
__thread volatile 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 493 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 802 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 1044 of file fftools_ffmpeg.c.

◆ assert_avoptions()

void assert_avoptions ( AVDictionary *  m)

Definition at line 793 of file fftools_ffmpeg.c.

◆ cancel_operation()

void cancel_operation ( long  id)

Definition at line 5201 of file fftools_ffmpeg.c.

◆ cancelRequested()

int cancelRequested ( long  id)

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

Parameters
idsession id
Returns
1 if exists, false otherwise

Definition at line 418 of file ffmpegkit.c.

◆ cancelSession()

void cancelSession ( long  id)

Adds a cancel session request to the session map.

Parameters
idsession id

Definition at line 408 of file ffmpegkit.c.

◆ check_decode_result()

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

Definition at line 2325 of file fftools_ffmpeg.c.

◆ check_init_output_file()

static int check_init_output_file ( OutputFile of,
int  file_index 
)
static

Definition at line 3214 of file fftools_ffmpeg.c.

◆ check_keyboard_interaction()

static int check_keyboard_interaction ( int64_t  cur_time)
static

Definition at line 4174 of file fftools_ffmpeg.c.

◆ check_output_constraints()

static int check_output_constraints ( InputStream ist,
OutputStream ost 
)
static

Definition at line 2211 of file fftools_ffmpeg.c.

◆ check_recording_time()

static int check_recording_time ( OutputStream ost)
static

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

◆ close_all_output_streams()

static void close_all_output_streams ( OutputStream ost,
OSTFinished  this_stream,
OSTFinished  others 
)
static

Definition at line 828 of file fftools_ffmpeg.c.

◆ close_output_stream()

static void close_output_stream ( OutputStream ost)
static

Definition at line 983 of file fftools_ffmpeg.c.

◆ compare_int64()

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

Definition at line 3208 of file fftools_ffmpeg.c.

◆ decode()

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

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

◆ decode_interrupt_cb()

int decode_interrupt_cb ( void *  ctx)

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

◆ do_audio_out()

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

Definition at line 1109 of file fftools_ffmpeg.c.

◆ do_streamcopy()

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

Definition at line 2228 of file fftools_ffmpeg.c.

◆ do_subtitle_out()

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

Definition at line 1167 of file fftools_ffmpeg.c.

◆ do_video_out()

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

Definition at line 1250 of file fftools_ffmpeg.c.

◆ do_video_stats()

static void do_video_stats ( OutputStream ost,
int  frame_size 
)
static

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

◆ ffmpeg_cleanup()

static void ffmpeg_cleanup ( int  ret)
static

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

◆ ffmpeg_var_cleanup()

void ffmpeg_var_cleanup ( )

Definition at line 5160 of file fftools_ffmpeg.c.

◆ finish_output_stream()

static void finish_output_stream ( OutputStream ost)
static

Definition at line 1594 of file fftools_ffmpeg.c.

◆ flush_encoders()

static void flush_encoders ( void  )
static

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

◆ get_benchmark_time_stamps()

static BenchmarkTimeStamps get_benchmark_time_stamps ( void  )
static

Definition at line 5112 of file fftools_ffmpeg.c.

◆ get_buffer()

static int get_buffer ( AVCodecContext *  s,
AVFrame *  frame,
int  flags 
)
static

Definition at line 3123 of file fftools_ffmpeg.c.

◆ get_format()

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

Definition at line 3037 of file fftools_ffmpeg.c.

◆ get_input_packet()

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

Definition at line 4406 of file fftools_ffmpeg.c.

◆ get_input_stream()

static InputStream * get_input_stream ( OutputStream ost)
static

Definition at line 3201 of file fftools_ffmpeg.c.

◆ getmaxrss()

static int64_t getmaxrss ( void  )
static

Definition at line 5138 of file fftools_ffmpeg.c.

◆ got_eagain()

static int got_eagain ( void  )
static

Definition at line 4435 of file fftools_ffmpeg.c.

◆ guess_input_channel_layout()

int guess_input_channel_layout ( InputStream ist)

Definition at line 2305 of file fftools_ffmpeg.c.

◆ ifilter_has_all_input_formats()

static int ifilter_has_all_input_formats ( FilterGraph fg)
static

Definition at line 2344 of file fftools_ffmpeg.c.

◆ ifilter_parameters_from_codecpar()

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

Definition at line 2091 of file fftools_ffmpeg.c.

◆ ifilter_send_eof()

static int ifilter_send_eof ( InputFilter ifilter,
int64_t  pts 
)
static

Definition at line 2432 of file fftools_ffmpeg.c.

◆ ifilter_send_frame()

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

Definition at line 2355 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 3519 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 3133 of file fftools_ffmpeg.c.

◆ init_output_bsfs()

static int init_output_bsfs ( OutputStream ost)
static

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

◆ init_output_stream_encode()

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

Definition at line 3543 of file fftools_ffmpeg.c.

◆ init_output_stream_streamcopy()

static int init_output_stream_streamcopy ( OutputStream ost)
static

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

◆ log_callback_null()

static void log_callback_null ( void *  ptr,
int  level,
const char *  fmt,
va_list  vl 
)
static

Definition at line 5156 of file fftools_ffmpeg.c.

◆ need_output()

static int need_output ( void  )
static

Definition at line 4105 of file fftools_ffmpeg.c.

◆ opt_abort_on()

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

Definition at line 287 of file fftools_ffmpeg_opt.c.

◆ opt_attach()

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

Definition at line 484 of file fftools_ffmpeg_opt.c.

◆ opt_audio_codec()

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

Definition at line 342 of file fftools_ffmpeg_opt.c.

◆ opt_audio_filters()

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

Definition at line 3193 of file fftools_ffmpeg_opt.c.

◆ opt_audio_frames()

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

Definition at line 3049 of file fftools_ffmpeg_opt.c.

◆ opt_audio_qscale()

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

Definition at line 3261 of file fftools_ffmpeg_opt.c.

◆ opt_bitrate()

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

Definition at line 3141 of file fftools_ffmpeg_opt.c.

◆ opt_channel_layout()

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

Definition at line 3225 of file fftools_ffmpeg_opt.c.

◆ opt_data_codec()

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

Definition at line 360 of file fftools_ffmpeg_opt.c.

◆ opt_data_frames()

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

Definition at line 3055 of file fftools_ffmpeg_opt.c.

◆ opt_filter_complex()

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

Definition at line 3267 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 3282 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 623 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 608 of file fftools_ffmpeg_opt.c.

◆ opt_map()

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

Definition at line 366 of file fftools_ffmpeg_opt.c.

◆ opt_map_channel()

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

Definition at line 492 of file fftools_ffmpeg_opt.c.

◆ opt_old2new()

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

Definition at line 3129 of file fftools_ffmpeg_opt.c.

◆ opt_preset()

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

Definition at line 3081 of file fftools_ffmpeg_opt.c.

◆ opt_profile()

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

Definition at line 3175 of file fftools_ffmpeg_opt.c.

◆ opt_progress()

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

◆ opt_qscale()

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

Definition at line 3157 of file fftools_ffmpeg_opt.c.

◆ opt_recording_timestamp()

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

Definition at line 761 of file fftools_ffmpeg_opt.c.

◆ opt_sameq()

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

Definition at line 321 of file fftools_ffmpeg_opt.c.

◆ opt_sdp_file()

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

Definition at line 569 of file fftools_ffmpeg_opt.c.

◆ opt_stats_period()

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

Definition at line 306 of file fftools_ffmpeg_opt.c.

◆ opt_streamid()

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

Definition at line 2094 of file fftools_ffmpeg_opt.c.

◆ opt_subtitle_codec()

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

Definition at line 354 of file fftools_ffmpeg_opt.c.

◆ opt_target()

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

Definition at line 2876 of file fftools_ffmpeg_opt.c.

◆ opt_timecode()

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

Definition at line 3211 of file fftools_ffmpeg_opt.c.

◆ opt_video_channel()

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

Definition at line 330 of file fftools_ffmpeg_opt.c.

◆ opt_video_codec()

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

Definition at line 348 of file fftools_ffmpeg_opt.c.

◆ opt_video_filters()

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

Definition at line 3187 of file fftools_ffmpeg_opt.c.

◆ opt_video_frames()

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

Definition at line 3043 of file fftools_ffmpeg_opt.c.

◆ opt_video_standard()

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

Definition at line 336 of file fftools_ffmpeg_opt.c.

◆ opt_vstats()

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

Definition at line 3027 of file fftools_ffmpeg_opt.c.

◆ opt_vstats_file()

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

Definition at line 3020 of file fftools_ffmpeg_opt.c.

◆ opt_vsync()

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

Definition at line 3199 of file fftools_ffmpeg_opt.c.

◆ output_packet()

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

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

◆ print_final_stats()

static void print_final_stats ( int64_t  total_size)
static

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

◆ print_sdp()

static void print_sdp ( void  )
static

Definition at line 2992 of file fftools_ffmpeg.c.

◆ process_input()

static int process_input ( int  file_index)
static

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

◆ psnr()

static double psnr ( double  d)
static

Definition at line 1546 of file fftools_ffmpeg.c.

◆ read_key()

static int read_key ( void  )
static

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

◆ remove_avoptions()

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

Definition at line 784 of file fftools_ffmpeg.c.

◆ report_new_stream()

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

Definition at line 3908 of file fftools_ffmpeg.c.

◆ reset_eagain()

static void reset_eagain ( void  )
static

Definition at line 4444 of file fftools_ffmpeg.c.

◆ seek_to_start()

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

Definition at line 4473 of file fftools_ffmpeg.c.

◆ send_filter_eof()

static int send_filter_eof ( InputStream ist)
static

Definition at line 2784 of file fftools_ffmpeg.c.

◆ send_frame_to_filters()

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

Definition at line 2486 of file fftools_ffmpeg.c.

◆ set_encoder_id()

static void set_encoder_id ( OutputFile of,
OutputStream ost 
)
static

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

◆ set_tty_echo()

static void set_tty_echo ( int  on)
static

Definition at line 4162 of file fftools_ffmpeg.c.

◆ show_hwaccels()

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

Definition at line 257 of file fftools_ffmpeg_opt.c.

◆ sigterm_handler()

static void sigterm_handler ( int  sig)
static

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

◆ sub2video_flush()

static void sub2video_flush ( InputStream ist)
static

Definition at line 408 of file fftools_ffmpeg.c.

◆ sub2video_get_blank_frame()

static int sub2video_get_blank_frame ( InputStream ist)
static

Definition at line 272 of file fftools_ffmpeg.c.

◆ sub2video_heartbeat()

static void sub2video_heartbeat ( InputStream ist,
int64_t  pts 
)
static

Definition at line 376 of file fftools_ffmpeg.c.

◆ sub2video_push_ref()

static void sub2video_push_ref ( InputStream ist,
int64_t  pts 
)
static

Definition at line 318 of file fftools_ffmpeg.c.

◆ sub2video_update()

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

Definition at line 336 of file fftools_ffmpeg.c.

◆ term_exit()

void term_exit ( void  )

Definition at line 432 of file fftools_ffmpeg.c.

◆ term_exit_sigsafe()

static void term_exit_sigsafe ( void  )
static

Definition at line 424 of file fftools_ffmpeg.c.

◆ term_init()

void term_init ( void  )

Definition at line 497 of file fftools_ffmpeg.c.

◆ transcode()

static int transcode ( void  )
static

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

◆ transcode_init()

static int transcode_init ( void  )
static

Definition at line 3923 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 4878 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 2705 of file fftools_ffmpeg.c.

◆ update_benchmark()

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

Definition at line 807 of file fftools_ffmpeg.c.

◆ write_packet()

static void write_packet ( OutputFile of,
AVPacket *  pkt,
OutputStream ost,
int  unqueue 
)
static

Definition at line 837 of file fftools_ffmpeg.c.

Variable Documentation

◆ copy_ts_first_pts

__thread int64_t copy_ts_first_pts = AV_NOPTS_VALUE

Definition at line 443 of file fftools_ffmpeg.c.

◆ copy_unknown_streams

__thread int copy_unknown_streams
extern

Definition at line 204 of file fftools_ffmpeg_opt.c.

◆ current_time

__thread BenchmarkTimeStamps current_time

Definition at line 174 of file fftools_ffmpeg.c.

◆ decode_error_stat

__thread int64_t decode_error_stat[2]

Definition at line 169 of file fftools_ffmpeg.c.

◆ do_psnr

__thread int do_psnr
extern

Definition at line 200 of file fftools_ffmpeg_opt.c.

◆ dup_warning

__thread unsigned dup_warning = 1000

Definition at line 167 of file fftools_ffmpeg.c.

◆ ffmpeg_exited

__thread volatile int ffmpeg_exited = 0

Definition at line 441 of file fftools_ffmpeg.c.

◆ ffmpeg_options

__thread OptionDef* ffmpeg_options = NULL

Definition at line 5210 of file fftools_ffmpeg.c.

◆ file_overwrite

__thread int file_overwrite
extern

Definition at line 198 of file fftools_ffmpeg_opt.c.

◆ filtergraphs

__thread FilterGraph** filtergraphs

Definition at line 189 of file fftools_ffmpeg.c.

◆ first_report

__thread int first_report = 1

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

◆ globalSessionId

__thread volatile long globalSessionId
extern

Holds the id of the current session

Definition at line 106 of file ffmpegkit.c.

◆ handleSIGINT

volatile int handleSIGINT
extern

Definition at line 100 of file ffmpegkit.c.

◆ handleSIGPIPE

volatile int handleSIGPIPE
extern

Definition at line 103 of file ffmpegkit.c.

◆ handleSIGQUIT

volatile int handleSIGQUIT
extern

Fields that control the handling of SIGNALs

Definition at line 99 of file ffmpegkit.c.

◆ handleSIGTERM

volatile int handleSIGTERM
extern

Definition at line 101 of file ffmpegkit.c.

◆ handleSIGXCPU

volatile int handleSIGXCPU
extern

Definition at line 102 of file ffmpegkit.c.

◆ ignore_unknown_streams

__thread int ignore_unknown_streams
extern

Definition at line 203 of file fftools_ffmpeg_opt.c.

◆ input_files

__thread InputFile** input_files = NULL

Definition at line 181 of file fftools_ffmpeg.c.

◆ input_streams

__thread InputStream** input_streams = NULL

Definition at line 179 of file fftools_ffmpeg.c.

◆ input_sync

__thread int input_sync
extern

Definition at line 201 of file fftools_ffmpeg_opt.c.

◆ int_cb

__thread const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL }

Definition at line 619 of file fftools_ffmpeg.c.

◆ intra_only

__thread int intra_only
extern

Definition at line 197 of file fftools_ffmpeg_opt.c.

◆ keyboard_last_time

__thread int64_t keyboard_last_time = 0

Definition at line 193 of file fftools_ffmpeg.c.

◆ last_time

__thread int64_t last_time = -1

Definition at line 192 of file fftools_ffmpeg.c.

◆ longjmp_value

__thread volatile int longjmp_value
extern

Definition at line 110 of file fftools_cmdutils.c.

◆ main_ffmpeg_return_code

__thread volatile int main_ffmpeg_return_code = 0

Definition at line 442 of file fftools_ffmpeg.c.

◆ nb_filtergraphs

__thread int nb_filtergraphs

Definition at line 190 of file fftools_ffmpeg.c.

◆ nb_frames_drop

__thread int nb_frames_drop = 0

Definition at line 168 of file fftools_ffmpeg.c.

◆ nb_frames_dup

__thread int nb_frames_dup = 0

Definition at line 166 of file fftools_ffmpeg.c.

◆ nb_input_files

__thread int nb_input_files = 0

Definition at line 182 of file fftools_ffmpeg.c.

◆ nb_input_streams

__thread int nb_input_streams = 0

Definition at line 180 of file fftools_ffmpeg.c.

◆ nb_output_dumped

__thread unsigned nb_output_dumped = 0

Definition at line 170 of file fftools_ffmpeg.c.

◆ nb_output_files

__thread int nb_output_files = 0

Definition at line 187 of file fftools_ffmpeg.c.

◆ nb_output_streams

__thread int nb_output_streams = 0

Definition at line 185 of file fftools_ffmpeg.c.

◆ no_file_overwrite

__thread int no_file_overwrite
extern

Definition at line 199 of file fftools_ffmpeg_opt.c.

◆ output_files

__thread OutputFile** output_files = NULL

Definition at line 186 of file fftools_ffmpeg.c.

◆ output_streams

__thread OutputStream** output_streams = NULL

Definition at line 184 of file fftools_ffmpeg.c.

◆ progress_avio

__thread AVIOContext* progress_avio = NULL

Definition at line 175 of file fftools_ffmpeg.c.

◆ qp_histogram

__thread int qp_histogram[52]

Definition at line 195 of file fftools_ffmpeg.c.

◆ received_nb_signals

volatile int received_nb_signals = 0
static

Definition at line 439 of file fftools_ffmpeg.c.

◆ received_sigterm

volatile int received_sigterm = 0
static

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

◆ run_as_daemon

__thread int run_as_daemon = 0

Definition at line 165 of file fftools_ffmpeg.c.

◆ subtitle_out

__thread uint8_t* subtitle_out

Definition at line 177 of file fftools_ffmpeg.c.

◆ transcode_init_done

__thread atomic_int transcode_init_done = ATOMIC_VAR_INIT(0)

Definition at line 440 of file fftools_ffmpeg.c.

◆ vstats_file

FILE* vstats_file
static

Definition at line 143 of file fftools_ffmpeg.c.

◆ want_sdp

__thread int want_sdp = 1

Definition at line 172 of file fftools_ffmpeg.c.