FFmpeg
|
#include "config.h"
#include <errno.h>
#include <limits.h>
#include <stdatomic.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "libavutil/bprint.h"
#include "libavutil/dict.h"
#include "libavutil/mem.h"
#include "libavformat/avformat.h"
#include "libavdevice/avdevice.h"
#include "cmdutils.h"
#include "ffmpeg.h"
#include "ffmpeg_sched.h"
#include "ffmpeg_utils.h"
Go to the source code of this file.
Data Structures | |
struct | BenchmarkTimeStamps |
Macros | |
#define | SIGNAL(sig, func) signal(sig, func) |
Functions | |
static BenchmarkTimeStamps | get_benchmark_time_stamps (void) |
static int64_t | getmaxrss (void) |
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) |
OutputStream * | ost_iter (OutputStream *prev) |
InputStream * | ist_iter (InputStream *prev) |
static void | frame_data_free (void *opaque, uint8_t *data) |
static int | frame_data_ensure (AVBufferRef **dst, int writable) |
FrameData * | frame_data (AVFrame *frame) |
Get our axiliary frame data attached to the frame, allocating it if needed. More... | |
const FrameData * | frame_data_c (AVFrame *frame) |
FrameData * | packet_data (AVPacket *pkt) |
const FrameData * | packet_data_c (AVPacket *pkt) |
int | check_avoptions_used (const AVDictionary *opts, const AVDictionary *opts_used, void *logctx, int decode) |
void | update_benchmark (const char *fmt,...) |
static void | print_report (int is_last_report, int64_t timer_start, int64_t cur_time, int64_t pts) |
static void | print_stream_maps (void) |
static void | set_tty_echo (int on) |
static int | check_keyboard_interaction (int64_t cur_time) |
static int | transcode (Scheduler *sch) |
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... | |
FILE * | vstats_file |
atomic_uint | nb_output_dumped = 0 |
static BenchmarkTimeStamps | current_time |
AVIOContext * | progress_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 |
Decoder ** | decoders |
int | nb_decoders |
static volatile int | received_sigterm = 0 |
static volatile int | received_nb_signals = 0 |
static atomic_int | transcode_init_done = 0 |
static volatile int | ffmpeg_exited = 0 |
static int64_t | copy_ts_first_pts = AV_NOPTS_VALUE |
const AVIOInterruptCB | int_cb = { decode_interrupt_cb, NULL } |
multimedia converter based on the FFmpeg libraries
Definition in file ffmpeg.c.
|
static |
Definition at line 902 of file ffmpeg.c.
Referenced by main(), and update_benchmark().
|
static |
Definition at line 928 of file ffmpeg.c.
Referenced by ffmpeg_cleanup().
|
static |
Definition at line 123 of file ffmpeg.c.
Referenced by sigterm_handler(), and term_exit().
void term_exit | ( | void | ) |
Definition at line 131 of file ffmpeg.c.
Referenced by assert_file_overwrite(), ffmpeg_cleanup(), and transcode().
|
static |
Definition at line 144 of file ffmpeg.c.
Referenced by term_init().
void term_init | ( | void | ) |
Definition at line 201 of file ffmpeg.c.
Referenced by assert_file_overwrite().
|
static |
Definition at line 250 of file ffmpeg.c.
Referenced by check_keyboard_interaction().
|
static |
OutputStream* ost_iter | ( | OutputStream * | prev | ) |
Definition at line 360 of file ffmpeg.c.
Referenced by check_keyboard_interaction(), print_report(), and print_stream_maps().
InputStream* ist_iter | ( | InputStream * | prev | ) |
Definition at line 376 of file ffmpeg.c.
Referenced by ist_find_unused(), map_auto_data(), map_auto_subtitle(), and print_stream_maps().
|
static |
Definition at line 392 of file ffmpeg.c.
Referenced by frame_data_ensure().
|
static |
Definition at line 401 of file ffmpeg.c.
Referenced by frame_data(), frame_data_c(), packet_data(), and packet_data_c().
Get our axiliary frame data attached to the frame, allocating it if needed.
Definition at line 453 of file ffmpeg.c.
Referenced by close_output(), dwt_plane(), encode_frame(), fg_output_step(), generate_raw_frame(), mc(), nvenc_retrieve_frame_data(), nvenc_store_frame_data(), packet_decode(), and send_frame().
Definition at line 459 of file ffmpeg.c.
Referenced by choose_out_timebase().
Definition at line 465 of file ffmpeg.c.
Referenced by encode_frame(), input_packet_process(), and packet_decode().
int check_avoptions_used | ( | const AVDictionary * | opts, |
const AVDictionary * | opts_used, | ||
void * | logctx, | ||
int | decode | ||
) |
Definition at line 477 of file ffmpeg.c.
Referenced by ifile_open(), and of_open().
void update_benchmark | ( | const char * | fmt, |
... | |||
) |
Definition at line 527 of file ffmpeg.c.
Referenced by encode_frame(), and packet_decode().
|
static |
Definition at line 548 of file ffmpeg.c.
Referenced by transcode().
|
static |
Definition at line 700 of file ffmpeg.c.
Referenced by transcode().
|
static |
Definition at line 776 of file ffmpeg.c.
Referenced by check_keyboard_interaction().
|
static |
Definition at line 788 of file ffmpeg.c.
Referenced by transcode().
|
static |
const char program_name[] = "ffmpeg" |
program name, defined by the program for show_version().
Definition at line 85 of file ffmpeg.c.
Referenced by main().
const int program_birth_year = 2000 |
program birth year, defined by the program for show_banner()
FILE* vstats_file |
Definition at line 88 of file ffmpeg.c.
Referenced by ffmpeg_cleanup(), and update_video_stats().
atomic_uint nb_output_dumped = 0 |
Definition at line 99 of file ffmpeg.c.
Referenced by mux_check_init(), and print_report().
|
static |
Definition at line 101 of file ffmpeg.c.
Referenced by main(), and update_benchmark().
AVIOContext* progress_avio = NULL |
Definition at line 102 of file ffmpeg.c.
Referenced by print_report().
Definition at line 104 of file ffmpeg.c.
Referenced by apply_sync_offsets(), assert_file_overwrite(), copy_meta(), correct_input_start_times(), demux_alloc(), ffmpeg_cleanup(), fg_complex_bind_input(), ist_iter(), map_auto_audio(), map_auto_video(), map_manual(), of_map_group(), opt_map(), and opt_target().
int nb_input_files = 0 |
Definition at line 105 of file ffmpeg.c.
Referenced by apply_sync_offsets(), assert_file_overwrite(), copy_meta(), correct_input_start_times(), demux_alloc(), ffmpeg_cleanup(), fg_complex_bind_input(), ist_iter(), main(), map_auto_audio(), map_auto_video(), of_map_group(), opt_map(), and opt_target().
OutputFile** output_files = NULL |
Definition at line 107 of file ffmpeg.c.
Referenced by dec_create(), ffmpeg_cleanup(), mux_alloc(), new_stream_video(), ost_iter(), print_report(), print_sdp(), and transcode().
int nb_output_files = 0 |
Definition at line 108 of file ffmpeg.c.
Referenced by create_streams(), dec_create(), ffmpeg_cleanup(), main(), mux_alloc(), ost_iter(), print_report(), print_sdp(), and transcode().
FilterGraph** filtergraphs |
Definition at line 110 of file ffmpeg.c.
Referenced by check_keyboard_interaction(), create_streams(), ffmpeg_cleanup(), fg_complex_bind_input(), fg_create(), fg_finalise_bindings(), and map_manual().
int nb_filtergraphs |
Definition at line 111 of file ffmpeg.c.
Referenced by check_keyboard_interaction(), create_streams(), ffmpeg_cleanup(), fg_complex_bind_input(), fg_create(), fg_finalise_bindings(), map_manual(), and print_stream_maps().
Decoder** decoders |
Definition at line 113 of file ffmpeg.c.
Referenced by dec_create(), ffmpeg_cleanup(), and fg_complex_bind_input().
int nb_decoders |
Definition at line 114 of file ffmpeg.c.
Referenced by dec_create(), ffmpeg_cleanup(), and fg_complex_bind_input().
|
static |
Definition at line 137 of file ffmpeg.c.
Referenced by ffmpeg_cleanup(), and sigterm_handler().
|
static |
Definition at line 138 of file ffmpeg.c.
Referenced by check_keyboard_interaction(), decode_interrupt_cb(), main(), and sigterm_handler().
|
static |
Definition at line 139 of file ffmpeg.c.
Referenced by decode_interrupt_cb(), ffmpeg_cleanup(), and transcode().
|
static |
Definition at line 140 of file ffmpeg.c.
Referenced by ffmpeg_cleanup().
|
static |
Definition at line 141 of file ffmpeg.c.
Referenced by print_report().
const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL } |
Definition at line 307 of file ffmpeg.c.
Referenced by avio_open2(), dump_attachment(), enc_stats_get_file(), ff_network_sleep_interruptible(), ff_network_wait_fd_timeout(), ffio_open_whitelist(), ffurl_alloc(), ffurl_open_whitelist(), get_preset_file_2(), ifile_open(), libsrt_network_wait_fd_timeout(), of_add_attachments(), of_open(), print_sdp(), read_binary(), url_alloc_for_protocol(), and zmq_proto_wait_timeout().