FFmpeg
Data Structures | Macros | Functions | Variables
ffmpeg.c File Reference
#include "config.h"
#include <ctype.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <errno.h>
#include <limits.h>
#include <stdatomic.h>
#include <stdint.h>
#include "libavformat/avformat.h"
#include "libavdevice/avdevice.h"
#include "libswresample/swresample.h"
#include "libavutil/opt.h"
#include "libavutil/channel_layout.h"
#include "libavutil/parseutils.h"
#include "libavutil/samplefmt.h"
#include "libavutil/fifo.h"
#include "libavutil/hwcontext.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/dict.h"
#include "libavutil/display.h"
#include "libavutil/mathematics.h"
#include "libavutil/pixdesc.h"
#include "libavutil/avstring.h"
#include "libavutil/libm.h"
#include "libavutil/imgutils.h"
#include "libavutil/timestamp.h"
#include "libavutil/bprint.h"
#include "libavutil/time.h"
#include "libavutil/thread.h"
#include "libavutil/threadmessage.h"
#include "libavcodec/mathops.h"
#include "libavcodec/version.h"
#include "libavformat/os_support.h"
#include "libavfilter/avfilter.h"
#include "libavfilter/buffersrc.h"
#include "libavfilter/buffersink.h"
#include "ffmpeg.h"
#include "cmdutils.h"
#include "sync_queue.h"
#include "libavutil/avassert.h"

Go to the source code of this file.

Data Structures

struct  FrameData
 
struct  BenchmarkTimeStamps
 

Macros

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

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)
 
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)
 
static 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)
 
static void enc_stats_write (OutputStream *ost, EncStats *es, const AVFrame *frame, const AVPacket *pkt)
 
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)
 
static 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)
 Get and encode new output from any of the filtergraphs, without causing activity. More...
 
static void print_final_stats (int64_t total_size)
 
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, 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)
 Select the output stream to process. More...
 
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)
 Perform a step of transcoding for the specified filter graph. More...
 
static int transcode_step (void)
 Run a single step of transcoding. More...
 
static int transcode (void)
 
int main (int argc, char **argv)
 

Variables

const char program_name [] = "ffmpeg"
 program name, defined by the program for show_version(). More...
 
const int program_birth_year = 2000
 program birth year, defined by the program for show_banner() More...
 
static FILE * vstats_file
 
static int64_t nb_frames_dup = 0
 
static uint64_t dup_warning = 1000
 
static int64_t nb_frames_drop = 0
 
static int64_t decode_error_stat [2]
 
unsigned nb_output_dumped = 0
 
static BenchmarkTimeStamps current_time
 
AVIOContextprogress_avio = NULL
 
InputFile ** input_files = NULL
 
int nb_input_files = 0
 
OutputFile ** output_files = NULL
 
int nb_output_files = 0
 
FilterGraph ** filtergraphs
 
int nb_filtergraphs
 
static volatile int received_sigterm = 0
 
static volatile int received_nb_signals = 0
 
static atomic_int transcode_init_done = ATOMIC_VAR_INIT(0)
 
static volatile int ffmpeg_exited = 0
 
int main_return_code = 0
 
static int64_t copy_ts_first_pts = AV_NOPTS_VALUE
 
const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL }
 

Detailed Description

multimedia converter based on the FFmpeg libraries

Definition in file ffmpeg.c.

Macro Definition Documentation

◆ SIGNAL

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

Definition at line 391 of file ffmpeg.c.

Function Documentation

◆ trigger_fix_sub_duration_heartbeat()

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

Definition at line 2475 of file ffmpeg.c.

Referenced by do_streamcopy(), and encode_frame().

◆ get_benchmark_time_stamps()

static BenchmarkTimeStamps get_benchmark_time_stamps ( void  )
static

Definition at line 4090 of file ffmpeg.c.

Referenced by main(), and update_benchmark().

◆ getmaxrss()

static int64_t getmaxrss ( void  )
static

Definition at line 4116 of file ffmpeg.c.

Referenced by ffmpeg_cleanup().

◆ ifilter_has_all_input_formats()

static int ifilter_has_all_input_formats ( FilterGraph fg)
static

Definition at line 1957 of file ffmpeg.c.

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

◆ sub2video_get_blank_frame()

static int sub2video_get_blank_frame ( InputStream ist)
static

Definition at line 164 of file ffmpeg.c.

Referenced by sub2video_update().

◆ sub2video_copy_rect()

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

Definition at line 179 of file ffmpeg.c.

Referenced by sub2video_update().

◆ sub2video_push_ref()

static void sub2video_push_ref ( InputStream ist,
int64_t  pts 
)
static

Definition at line 210 of file ffmpeg.c.

Referenced by sub2video_heartbeat(), and sub2video_update().

◆ sub2video_update()

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

◆ sub2video_heartbeat()

static void sub2video_heartbeat ( InputStream ist,
int64_t  pts 
)
static

Definition at line 268 of file ffmpeg.c.

Referenced by process_input().

◆ sub2video_flush()

static void sub2video_flush ( InputStream ist)
static

Definition at line 300 of file ffmpeg.c.

Referenced by transcode_subtitles().

◆ term_exit_sigsafe()

static void term_exit_sigsafe ( void  )
static

Definition at line 316 of file ffmpeg.c.

Referenced by sigterm_handler(), and term_exit().

◆ term_exit()

void term_exit ( void  )

Definition at line 324 of file ffmpeg.c.

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

◆ sigterm_handler()

static void sigterm_handler ( int  sig)
static

Definition at line 338 of file ffmpeg.c.

Referenced by term_init().

◆ term_init()

void term_init ( void  )

Definition at line 395 of file ffmpeg.c.

Referenced by assert_file_overwrite().

◆ read_key()

static int read_key ( void  )
static

Definition at line 444 of file ffmpeg.c.

Referenced by check_keyboard_interaction().

◆ decode_interrupt_cb()

static int decode_interrupt_cb ( void *  ctx)
static

Definition at line 495 of file ffmpeg.c.

◆ ffmpeg_cleanup()

static void ffmpeg_cleanup ( int  ret)
static

Definition at line 502 of file ffmpeg.c.

Referenced by main().

◆ ost_iter()

static OutputStream* ost_iter ( OutputStream prev)
static

◆ ist_iter()

InputStream* ist_iter ( InputStream prev)

◆ remove_avoptions()

void remove_avoptions ( AVDictionary **  a,
AVDictionary b 
)

Definition at line 620 of file ffmpeg.c.

Referenced by ifile_open().

◆ assert_avoptions()

void assert_avoptions ( AVDictionary m)

Definition at line 629 of file ffmpeg.c.

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

◆ abort_codec_experimental()

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

Definition at line 638 of file ffmpeg.c.

Referenced by init_input_stream(), and init_output_stream().

◆ update_benchmark()

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

Definition at line 643 of file ffmpeg.c.

Referenced by decode_audio(), decode_video(), and encode_frame().

◆ close_output_stream()

static void close_output_stream ( OutputStream ost)
static

◆ check_recording_time()

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

Definition at line 673 of file ffmpeg.c.

Referenced by do_audio_out(), do_subtitle_out(), and do_video_out().

◆ adjust_frame_pts_to_encoder_tb()

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

Definition at line 685 of file ffmpeg.c.

Referenced by video_sync_process().

◆ init_output_stream()

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

Definition at line 3199 of file ffmpeg.c.

Referenced by init_output_stream_wrapper().

◆ init_output_stream_wrapper()

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

Definition at line 730 of file ffmpeg.c.

Referenced by do_video_out(), flush_encoders(), reap_filters(), transcode_init(), and transcode_step().

◆ psnr()

static double psnr ( double  d)
static

Definition at line 751 of file ffmpeg.c.

Referenced by main(), print_report(), run_psnr(), and update_video_stats().

◆ update_video_stats()

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

Definition at line 756 of file ffmpeg.c.

Referenced by encode_frame().

◆ enc_stats_write()

static void enc_stats_write ( OutputStream ost,
EncStats es,
const AVFrame frame,
const AVPacket pkt 
)
static

Definition at line 811 of file ffmpeg.c.

Referenced by encode_frame().

◆ encode_frame()

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

Definition at line 877 of file ffmpeg.c.

Referenced by submit_encode_frame().

◆ submit_encode_frame()

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

Definition at line 974 of file ffmpeg.c.

Referenced by do_audio_out(), do_video_out(), and flush_encoders().

◆ do_audio_out()

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

Definition at line 1020 of file ffmpeg.c.

Referenced by reap_filters().

◆ do_subtitle_out()

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

Definition at line 1046 of file ffmpeg.c.

Referenced by process_subtitle().

◆ 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 1125 of file ffmpeg.c.

Referenced by do_video_out().

◆ forced_kf_apply()

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

Definition at line 1194 of file ffmpeg.c.

Referenced by do_video_out().

◆ do_video_out()

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

Definition at line 1246 of file ffmpeg.c.

Referenced by reap_filters().

◆ 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 1354 of file ffmpeg.c.

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

◆ print_final_stats()

static void print_final_stats ( int64_t  total_size)
static

Definition at line 1442 of file ffmpeg.c.

Referenced by print_report().

◆ print_report()

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

Definition at line 1562 of file ffmpeg.c.

Referenced by transcode().

◆ ifilter_parameters_from_codecpar()

static int ifilter_parameters_from_codecpar ( InputFilter ifilter,
AVCodecParameters par 
)
static

Definition at line 1759 of file ffmpeg.c.

Referenced by flush_encoders(), and ifilter_send_eof().

◆ flush_encoders()

static void flush_encoders ( void  )
static

Definition at line 1777 of file ffmpeg.c.

Referenced by transcode().

◆ check_output_constraints()

static int check_output_constraints ( InputStream ist,
OutputStream ost 
)
static

Definition at line 1840 of file ffmpeg.c.

Referenced by process_input_packet(), and process_subtitle().

◆ do_streamcopy()

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

Definition at line 1856 of file ffmpeg.c.

Referenced by process_input_packet().

◆ check_decode_result()

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

Definition at line 1938 of file ffmpeg.c.

Referenced by decode_audio(), decode_video(), and transcode_subtitles().

◆ ifilter_send_frame()

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

Definition at line 1968 of file ffmpeg.c.

Referenced by send_frame_to_filters().

◆ ifilter_send_eof()

static int ifilter_send_eof ( InputFilter ifilter,
int64_t  pts 
)
static

Definition at line 2048 of file ffmpeg.c.

Referenced by send_filter_eof().

◆ decode()

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

Definition at line 2078 of file ffmpeg.c.

Referenced by decode_audio(), and decode_video().

◆ send_frame_to_filters()

static int send_frame_to_filters ( InputStream ist,
AVFrame decoded_frame 
)
static

Definition at line 2118 of file ffmpeg.c.

Referenced by decode_audio(), and decode_video().

◆ decode_audio()

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

Definition at line 2136 of file ffmpeg.c.

Referenced by process_input_packet().

◆ 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 2193 of file ffmpeg.c.

Referenced by process_input_packet().

◆ process_subtitle()

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

Definition at line 2317 of file ffmpeg.c.

Referenced by fix_sub_duration_heartbeat(), and transcode_subtitles().

◆ copy_av_subtitle()

static int copy_av_subtitle ( AVSubtitle dst,
AVSubtitle src 
)
static

Definition at line 2376 of file ffmpeg.c.

Referenced by fix_sub_duration_heartbeat().

◆ fix_sub_duration_heartbeat()

static int fix_sub_duration_heartbeat ( InputStream ist,
int64_t  signal_pts 
)
static

Definition at line 2456 of file ffmpeg.c.

Referenced by new_output_stream(), and trigger_fix_sub_duration_heartbeat().

◆ transcode_subtitles()

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

Definition at line 2506 of file ffmpeg.c.

Referenced by process_input_packet().

◆ send_filter_eof()

static int send_filter_eof ( InputStream ist)
static

Definition at line 2527 of file ffmpeg.c.

Referenced by process_input_packet().

◆ process_input_packet()

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

Definition at line 2543 of file ffmpeg.c.

Referenced by decode_flush(), process_input(), and transcode().

◆ get_format()

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

Definition at line 2735 of file ffmpeg.c.

Referenced by init_input_stream().

◆ init_input_stream()

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

Definition at line 2784 of file ffmpeg.c.

Referenced by transcode_init().

◆ init_output_stream_streamcopy()

static int init_output_stream_streamcopy ( OutputStream ost)
static

Definition at line 2848 of file ffmpeg.c.

Referenced by init_output_stream().

◆ set_encoder_id()

static void set_encoder_id ( OutputFile of,
OutputStream ost 
)
static

Definition at line 2978 of file ffmpeg.c.

Referenced by init_output_stream_encode().

◆ init_encoder_time_base()

static void init_encoder_time_base ( OutputStream ost,
AVRational  default_time_base 
)
static

Definition at line 3001 of file ffmpeg.c.

Referenced by init_output_stream_encode().

◆ init_output_stream_encode()

static int init_output_stream_encode ( OutputStream ost,
AVFrame frame 
)
static

Definition at line 3024 of file ffmpeg.c.

Referenced by init_output_stream().

◆ transcode_init()

static int transcode_init ( void  )
static

Definition at line 3311 of file ffmpeg.c.

Referenced by transcode().

◆ need_output()

static int need_output ( void  )
static

Definition at line 3451 of file ffmpeg.c.

Referenced by mf_negotiate_types(), and transcode().

◆ 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 3468 of file ffmpeg.c.

Referenced by transcode_step().

◆ set_tty_echo()

static void set_tty_echo ( int  on)
static

Definition at line 3498 of file ffmpeg.c.

Referenced by check_keyboard_interaction().

◆ check_keyboard_interaction()

static int check_keyboard_interaction ( int64_t  cur_time)
static

Definition at line 3510 of file ffmpeg.c.

Referenced by transcode().

◆ got_eagain()

static int got_eagain ( void  )
static

Definition at line 3619 of file ffmpeg.c.

Referenced by movie_request_frame(), and transcode_step().

◆ reset_eagain()

static void reset_eagain ( void  )
static

Definition at line 3627 of file ffmpeg.c.

Referenced by process_input(), and transcode_step().

◆ decode_flush()

static void decode_flush ( InputFile ifile)
static

Definition at line 3636 of file ffmpeg.c.

Referenced by process_input().

◆ ts_discontinuity_detect()

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

Definition at line 3667 of file ffmpeg.c.

Referenced by ts_discontinuity_process().

◆ ts_discontinuity_process()

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

Definition at line 3731 of file ffmpeg.c.

Referenced by process_input().

◆ process_input()

static int process_input ( int  file_index)
static

Definition at line 3758 of file ffmpeg.c.

Referenced by transcode_step().

◆ 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 3868 of file ffmpeg.c.

Referenced by transcode_step().

◆ transcode_step()

static int transcode_step ( void  )
static

Run a single step of transcoding.

Returns
0 for success, <0 for error

Definition at line 3914 of file ffmpeg.c.

Referenced by transcode().

◆ transcode()

static int transcode ( void  )
static

Definition at line 4004 of file ffmpeg.c.

Referenced by main().

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 4134 of file ffmpeg.c.

Variable Documentation

◆ program_name

const char program_name[] = "ffmpeg"

program name, defined by the program for show_version().

Definition at line 111 of file ffmpeg.c.

Referenced by main().

◆ program_birth_year

const int program_birth_year = 2000

program birth year, defined by the program for show_banner()

Definition at line 112 of file ffmpeg.c.

◆ vstats_file

FILE* vstats_file
static

Definition at line 114 of file ffmpeg.c.

Referenced by ffmpeg_cleanup(), and update_video_stats().

◆ nb_frames_dup

int64_t nb_frames_dup = 0
static

Definition at line 134 of file ffmpeg.c.

Referenced by do_video_out(), and print_report().

◆ dup_warning

uint64_t dup_warning = 1000
static

Definition at line 135 of file ffmpeg.c.

Referenced by do_video_out().

◆ nb_frames_drop

int64_t nb_frames_drop = 0
static

Definition at line 136 of file ffmpeg.c.

Referenced by do_video_out(), and print_report().

◆ decode_error_stat

int64_t decode_error_stat[2]
static

Definition at line 137 of file ffmpeg.c.

Referenced by check_decode_result(), and main().

◆ nb_output_dumped

unsigned nb_output_dumped = 0

Definition at line 138 of file ffmpeg.c.

Referenced by mux_check_init(), and print_report().

◆ current_time

BenchmarkTimeStamps current_time
static

Definition at line 140 of file ffmpeg.c.

Referenced by main(), and update_benchmark().

◆ progress_avio

AVIOContext* progress_avio = NULL

Definition at line 141 of file ffmpeg.c.

Referenced by print_report().

◆ input_files

InputFile** input_files = NULL

◆ nb_input_files

int nb_input_files = 0

◆ output_files

OutputFile** output_files = NULL

◆ nb_output_files

int nb_output_files = 0

◆ filtergraphs

FilterGraph** filtergraphs

◆ nb_filtergraphs

int nb_filtergraphs

◆ received_sigterm

volatile int received_sigterm = 0
static

Definition at line 330 of file ffmpeg.c.

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

◆ received_nb_signals

volatile int received_nb_signals = 0
static

Definition at line 331 of file ffmpeg.c.

Referenced by check_keyboard_interaction(), decode_interrupt_cb(), main(), and sigterm_handler().

◆ transcode_init_done

atomic_int transcode_init_done = ATOMIC_VAR_INIT(0)
static

Definition at line 332 of file ffmpeg.c.

Referenced by decode_interrupt_cb(), ffmpeg_cleanup(), and transcode_init().

◆ ffmpeg_exited

volatile int ffmpeg_exited = 0
static

Definition at line 333 of file ffmpeg.c.

Referenced by ffmpeg_cleanup().

◆ main_return_code

int main_return_code = 0

Definition at line 334 of file ffmpeg.c.

Referenced by main(), and of_write_trailer().

◆ copy_ts_first_pts

int64_t copy_ts_first_pts = AV_NOPTS_VALUE
static

Definition at line 335 of file ffmpeg.c.

Referenced by print_report().

◆ int_cb