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 "sync_queue.h"
Go to the source code of this file.
Data Structures | |
struct | BenchmarkTimeStamps |
Macros | |
#define | SIGNAL(sig, func) signal(sig, func) |
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 |
unsigned | 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 |
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 1248 of file ffmpeg.c.
Referenced by main(), and update_benchmark().
|
static |
Definition at line 1274 of file ffmpeg.c.
Referenced by ffmpeg_cleanup().
|
static |
Definition at line 144 of file ffmpeg.c.
Referenced by process_input().
|
static |
Definition at line 163 of file ffmpeg.c.
Referenced by sigterm_handler(), and term_exit().
void term_exit | ( | void | ) |
Definition at line 171 of file ffmpeg.c.
Referenced by assert_file_overwrite(), ffmpeg_cleanup(), and transcode().
|
static |
Definition at line 184 of file ffmpeg.c.
Referenced by term_init().
void term_init | ( | void | ) |
Definition at line 241 of file ffmpeg.c.
Referenced by assert_file_overwrite().
|
static |
Definition at line 290 of file ffmpeg.c.
Referenced by check_keyboard_interaction().
|
static |
OutputStream* ost_iter | ( | OutputStream * | prev | ) |
Definition at line 397 of file ffmpeg.c.
Referenced by choose_output(), enc_flush(), print_report(), print_stream_maps(), and reset_eagain().
InputStream* ist_iter | ( | InputStream * | prev | ) |
Definition at line 413 of file ffmpeg.c.
Referenced by ist_find_unused(), map_auto_data(), map_auto_subtitle(), print_stream_maps(), and transcode().
Get our axiliary frame data attached to the frame, allocating it if needed.
Definition at line 429 of file ffmpeg.c.
Referenced by choose_out_timebase(), dwt_plane(), fg_output_step(), fg_transcode_step(), generate_raw_frame(), nvenc_retrieve_frame_data(), nvenc_store_frame_data(), and packet_decode().
void remove_avoptions | ( | AVDictionary ** | a, |
AVDictionary * | b | ||
) |
Definition at line 446 of file ffmpeg.c.
Referenced by ifile_open().
int check_avoptions | ( | AVDictionary * | m | ) |
Definition at line 455 of file ffmpeg.c.
Referenced by dec_open(), enc_open(), and ifile_open().
void update_benchmark | ( | const char * | fmt, |
... | |||
) |
Definition at line 466 of file ffmpeg.c.
Referenced by encode_frame(), and packet_decode().
void close_output_stream | ( | OutputStream * | ost | ) |
Definition at line 487 of file ffmpeg.c.
Referenced by check_recording_time(), fg_transcode_step(), and submit_encode_frame().
|
static |
Definition at line 496 of file ffmpeg.c.
Referenced by transcode().
int copy_av_subtitle | ( | AVSubtitle * | dst, |
const AVSubtitle * | src | ||
) |
Definition at line 651 of file ffmpeg.c.
Referenced by subtitle_wrap_frame().
|
static |
Definition at line 731 of file ffmpeg.c.
Referenced by subtitle_wrap_frame().
int subtitle_wrap_frame | ( | AVFrame * | frame, |
AVSubtitle * | subtitle, | ||
int | copy | ||
) |
Definition at line 738 of file ffmpeg.c.
Referenced by fix_sub_duration_heartbeat(), and transcode_subtitles().
int trigger_fix_sub_duration_heartbeat | ( | OutputStream * | ost, |
const AVPacket * | pkt | ||
) |
Definition at line 771 of file ffmpeg.c.
Referenced by encode_frame(), and of_streamcopy().
|
static |
Definition at line 803 of file ffmpeg.c.
Referenced by process_input(), and transcode().
|
static |
Definition at line 846 of file ffmpeg.c.
Referenced by transcode().
|
static |
Select the output stream to process.
0 | an output stream was selected |
AVERROR(EAGAIN) | need to wait until more input is available |
AVERROR_EOF | no more streams need output |
Definition at line 929 of file ffmpeg.c.
Referenced by transcode().
|
static |
Definition at line 959 of file ffmpeg.c.
Referenced by check_keyboard_interaction().
|
static |
Definition at line 971 of file ffmpeg.c.
Referenced by transcode().
|
static |
Definition at line 1030 of file ffmpeg.c.
Referenced by process_input(), and transcode().
|
static |
Definition at line 1039 of file ffmpeg.c.
Referenced by process_input().
Definition at line 1058 of file ffmpeg.c.
Referenced by transcode_step().
|
static |
Run a single step of transcoding.
Definition at line 1127 of file ffmpeg.c.
Referenced by transcode().
const char program_name[] = "ffmpeg" |
program name, defined by the program for show_version().
Definition at line 104 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 107 of file ffmpeg.c.
Referenced by ffmpeg_cleanup(), and update_video_stats().
unsigned nb_output_dumped = 0 |
Definition at line 118 of file ffmpeg.c.
Referenced by mux_check_init(), and print_report().
|
static |
Definition at line 120 of file ffmpeg.c.
Referenced by main(), and update_benchmark().
AVIOContext* progress_avio = NULL |
Definition at line 121 of file ffmpeg.c.
Referenced by print_report().
Definition at line 123 of file ffmpeg.c.
Referenced by apply_sync_offsets(), assert_file_overwrite(), configure_input_audio_filter(), configure_input_video_filter(), copy_meta(), correct_input_start_times(), decoder_thread(), demux_alloc(), ffmpeg_cleanup(), fg_transcode_step(), init_input_filter(), input_packet_process(), ist_iter(), map_auto_audio(), map_auto_video(), map_manual(), new_stream_video(), opt_map(), opt_map_channel(), opt_target(), packet_decode(), process_input(), process_input_packet(), reset_eagain(), streamcopy_init(), transcode(), transcode_step(), and video_duration_estimate().
int nb_input_files = 0 |
Definition at line 124 of file ffmpeg.c.
Referenced by apply_sync_offsets(), assert_file_overwrite(), copy_meta(), correct_input_start_times(), demux_alloc(), ffmpeg_cleanup(), init_input_filter(), ist_iter(), main(), map_auto_audio(), map_auto_video(), opt_map(), opt_map_channel(), opt_target(), reset_eagain(), and thread_start().
OutputFile** output_files = NULL |
Definition at line 126 of file ffmpeg.c.
Referenced by check_recording_time(), close_output_stream(), configure_output_audio_filter(), configure_output_video_filter(), enc_flush(), enc_frame(), enc_open(), enc_subtitle(), ffmpeg_cleanup(), init_output_stream_nofilter(), mux_alloc(), mux_check_init(), new_stream_video(), of_streamcopy(), ofilter_bind_ost(), ost_iter(), print_report(), print_sdp(), process_input(), process_subtitle(), transcode(), and trigger_fix_sub_duration_heartbeat().
int nb_output_files = 0 |
Definition at line 127 of file ffmpeg.c.
Referenced by create_streams(), ffmpeg_cleanup(), main(), mux_alloc(), mux_check_init(), ost_iter(), print_report(), print_sdp(), and transcode().
FilterGraph** filtergraphs |
Definition at line 129 of file ffmpeg.c.
Referenced by check_filter_outputs(), check_keyboard_interaction(), create_streams(), ffmpeg_cleanup(), fg_create(), init_complex_filters(), map_manual(), and transcode_step().
int nb_filtergraphs |
Definition at line 130 of file ffmpeg.c.
Referenced by check_filter_outputs(), check_keyboard_interaction(), create_streams(), ffmpeg_cleanup(), fg_create(), init_complex_filters(), map_manual(), print_stream_maps(), and transcode_step().
|
static |
Definition at line 177 of file ffmpeg.c.
Referenced by ffmpeg_cleanup(), sigterm_handler(), and transcode().
|
static |
Definition at line 178 of file ffmpeg.c.
Referenced by check_keyboard_interaction(), decode_interrupt_cb(), main(), and sigterm_handler().
|
static |
Definition at line 179 of file ffmpeg.c.
Referenced by decode_interrupt_cb(), ffmpeg_cleanup(), and transcode().
|
static |
Definition at line 180 of file ffmpeg.c.
Referenced by ffmpeg_cleanup().
|
static |
Definition at line 181 of file ffmpeg.c.
Referenced by print_report().
const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL } |
Definition at line 346 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().