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/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "libavutil/channel_layout.h"
#include "libavutil/dict.h"
#include "libavutil/display.h"
#include "libavutil/fifo.h"
#include "libavutil/hwcontext.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/libm.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/samplefmt.h"
#include "libavutil/thread.h"
#include "libavutil/threadmessage.h"
#include "libavutil/timestamp.h"
#include "libavcodec/version.h"
#include "libavformat/avformat.h"
#include "libavdevice/avdevice.h"
#include "libswresample/swresample.h"
#include "cmdutils.h"
#include "ffmpeg.h"
#include "ffmpeg_sched.h"
#include "ffmpeg_utils.h"
#include "sync_queue.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) |
void | remove_avoptions (AVDictionary **a, AVDictionary *b) |
int | check_avoptions (AVDictionary *m) |
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 = ATOMIC_VAR_INIT(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 885 of file ffmpeg.c.
Referenced by main(), and update_benchmark().
|
static |
Definition at line 911 of file ffmpeg.c.
Referenced by ffmpeg_cleanup().
|
static |
Definition at line 144 of file ffmpeg.c.
Referenced by sigterm_handler(), and term_exit().
void term_exit | ( | void | ) |
Definition at line 152 of file ffmpeg.c.
Referenced by assert_file_overwrite(), ffmpeg_cleanup(), and transcode().
|
static |
Definition at line 165 of file ffmpeg.c.
Referenced by term_init().
void term_init | ( | void | ) |
Definition at line 222 of file ffmpeg.c.
Referenced by assert_file_overwrite().
|
static |
Definition at line 271 of file ffmpeg.c.
Referenced by check_keyboard_interaction().
|
static |
OutputStream* ost_iter | ( | OutputStream * | prev | ) |
Definition at line 380 of file ffmpeg.c.
Referenced by print_report(), and print_stream_maps().
InputStream* ist_iter | ( | InputStream * | prev | ) |
Definition at line 396 of file ffmpeg.c.
Referenced by ist_find_unused(), map_auto_data(), map_auto_subtitle(), and print_stream_maps().
|
static |
Definition at line 412 of file ffmpeg.c.
Referenced by frame_data_ensure().
|
static |
Definition at line 421 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 473 of file ffmpeg.c.
Referenced by close_output(), dwt_plane(), encode_frame(), fg_output_step(), generate_raw_frame(), nvenc_retrieve_frame_data(), nvenc_store_frame_data(), packet_decode(), and send_frame().
Definition at line 479 of file ffmpeg.c.
Referenced by choose_out_timebase().
Definition at line 485 of file ffmpeg.c.
Referenced by encode_frame(), input_packet_process(), and packet_decode().
void remove_avoptions | ( | AVDictionary ** | a, |
AVDictionary * | b | ||
) |
Definition at line 497 of file ffmpeg.c.
Referenced by ifile_open().
int check_avoptions | ( | AVDictionary * | m | ) |
Definition at line 506 of file ffmpeg.c.
Referenced by dec_open(), enc_open(), and ifile_open().
void update_benchmark | ( | const char * | fmt, |
... | |||
) |
Definition at line 517 of file ffmpeg.c.
Referenced by encode_frame(), and packet_decode().
|
static |
Definition at line 538 of file ffmpeg.c.
Referenced by transcode().
|
static |
Definition at line 688 of file ffmpeg.c.
Referenced by transcode().
|
static |
Definition at line 764 of file ffmpeg.c.
Referenced by check_keyboard_interaction().
|
static |
Definition at line 776 of file ffmpeg.c.
Referenced by transcode().
const char program_name[] = "ffmpeg" |
program name, defined by the program for show_version().
Definition at line 106 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 109 of file ffmpeg.c.
Referenced by ffmpeg_cleanup(), and update_video_stats().
atomic_uint nb_output_dumped = 0 |
Definition at line 120 of file ffmpeg.c.
Referenced by mux_check_init(), and print_report().
|
static |
Definition at line 122 of file ffmpeg.c.
Referenced by main(), and update_benchmark().
AVIOContext* progress_avio = NULL |
Definition at line 123 of file ffmpeg.c.
Referenced by print_report().
Definition at line 125 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(), opt_map(), and opt_target().
int nb_input_files = 0 |
Definition at line 126 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(), opt_map(), and opt_target().
OutputFile** output_files = NULL |
Definition at line 128 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 129 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 131 of file ffmpeg.c.
Referenced by check_keyboard_interaction(), create_streams(), ffmpeg_cleanup(), fg_create(), fg_finalise_bindings(), and map_manual().
int nb_filtergraphs |
Definition at line 132 of file ffmpeg.c.
Referenced by check_keyboard_interaction(), create_streams(), ffmpeg_cleanup(), fg_create(), map_manual(), and print_stream_maps().
Decoder** decoders |
Definition at line 134 of file ffmpeg.c.
Referenced by dec_create(), ffmpeg_cleanup(), and fg_complex_bind_input().
int nb_decoders |
Definition at line 135 of file ffmpeg.c.
Referenced by dec_create(), ffmpeg_cleanup(), and fg_complex_bind_input().
|
static |
Definition at line 158 of file ffmpeg.c.
Referenced by ffmpeg_cleanup(), and sigterm_handler().
|
static |
Definition at line 159 of file ffmpeg.c.
Referenced by check_keyboard_interaction(), decode_interrupt_cb(), main(), and sigterm_handler().
|
static |
Definition at line 160 of file ffmpeg.c.
Referenced by decode_interrupt_cb(), ffmpeg_cleanup(), and transcode().
|
static |
Definition at line 161 of file ffmpeg.c.
Referenced by ffmpeg_cleanup().
|
static |
Definition at line 162 of file ffmpeg.c.
Referenced by print_report().
const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL } |
Definition at line 327 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().