FFmpeg
|
multimedia converter based on the FFmpeg libraries More...
#include "config.h"
#include <ctype.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <errno.h>
#include <limits.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/intreadwrite.h"
#include "libavutil/dict.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 "libavformat/os_support.h"
#include "libavformat/ffm.h"
#include "libavfilter/avcodec.h"
#include "libavfilter/avfilter.h"
#include "libavfilter/buffersrc.h"
#include "libavfilter/buffersink.h"
#include "ffmpeg.h"
#include "cmdutils.h"
#include "libavutil/avassert.h"
Go to the source code of this file.
Macros | |
#define | DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass" |
Variables | |
const char | program_name [] = "ffmpeg" |
program name, defined by the program for show_version(). | |
const int | program_birth_year = 2000 |
program birth year, defined by the program for show_banner() | |
static FILE * | vstats_file |
const char *const | forced_keyframes_const_names [] |
static int | run_as_daemon = 0 |
static int64_t | video_size = 0 |
static int64_t | audio_size = 0 |
static int64_t | data_size = 0 |
static int64_t | subtitle_size = 0 |
static int64_t | extra_size = 0 |
static int | nb_frames_dup = 0 |
static int | nb_frames_drop = 0 |
static int64_t | decode_error_stat [2] |
static int | current_time |
AVIOContext * | progress_avio = NULL |
static uint8_t * | subtitle_out |
InputStream ** | input_streams = NULL |
int | nb_input_streams = 0 |
InputFile ** | input_files = NULL |
int | nb_input_files = 0 |
OutputStream ** | output_streams = NULL |
int | nb_output_streams = 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 int | main_return_code = 0 |
const AVIOInterruptCB | int_cb = { decode_interrupt_cb, NULL } |
multimedia converter based on the FFmpeg libraries
Definition in file ffmpeg.c.
#define DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass" |
Definition at line 145 of file ffmpeg.c.
Referenced by transcode_init().
|
static |
Definition at line 1056 of file ffmpeg.c.
Referenced by do_video_out(), and flush_encoders().
|
static |
Definition at line 3527 of file ffmpeg.c.
Referenced by main(), and update_benchmark().
|
static |
Definition at line 3545 of file ffmpeg.c.
Referenced by ffmpeg_cleanup().
Referenced by ffmpeg_cleanup(), and transcode().
|
static |
Definition at line 175 of file ffmpeg.c.
Referenced by sub2video_update().
|
static |
Definition at line 190 of file ffmpeg.c.
Referenced by sub2video_update().
|
static |
Definition at line 219 of file ffmpeg.c.
Referenced by sub2video_heartbeat(), and sub2video_update().
|
static |
Definition at line 232 of file ffmpeg.c.
Referenced by sub2video_heartbeat(), and transcode_subtitles().
|
static |
Definition at line 267 of file ffmpeg.c.
Referenced by process_input().
|
static |
Definition at line 296 of file ffmpeg.c.
Referenced by transcode_subtitles().
Definition at line 306 of file ffmpeg.c.
Referenced by assert_file_overwrite(), ffmpeg_cleanup(), sigterm_handler(), and transcode().
|
static |
Definition at line 320 of file ffmpeg.c.
Referenced by term_init().
Definition at line 329 of file ffmpeg.c.
Referenced by assert_file_overwrite(), and main().
|
static |
Definition at line 366 of file ffmpeg.c.
Referenced by check_keyboard_interaction().
|
static |
void assert_avoptions | ( | AVDictionary * | m | ) |
Definition at line 521 of file ffmpeg.c.
Referenced by init_input_stream(), and open_input_file().
Definition at line 530 of file ffmpeg.c.
Referenced by init_input_stream().
|
static |
Definition at line 535 of file ffmpeg.c.
Referenced by decode_audio(), decode_video(), do_audio_out(), do_video_out(), and flush_encoders().
|
static |
Definition at line 552 of file ffmpeg.c.
Referenced by write_frame().
|
static |
Definition at line 561 of file ffmpeg.c.
Referenced by do_audio_out(), do_video_out(), and flush_encoders().
|
static |
Definition at line 666 of file ffmpeg.c.
Referenced by check_recording_time(), do_streamcopy(), need_output(), process_input(), and transcode_from_filter().
|
static |
Definition at line 677 of file ffmpeg.c.
Referenced by do_audio_out(), do_subtitle_out(), and do_video_out().
|
static |
Definition at line 690 of file ffmpeg.c.
Referenced by reap_filters().
|
static |
Definition at line 744 of file ffmpeg.c.
Referenced by transcode_subtitles().
|
static |
Definition at line 817 of file ffmpeg.c.
Referenced by reap_filters().
|
static |
Definition at line 1051 of file ffmpeg.c.
Referenced by avfilter_register_all(), do_video_stats(), main(), print_report(), and run_psnr().
|
static |
Get and encode new output from any of the filtergraphs, without causing activity.
Definition at line 1098 of file ffmpeg.c.
Referenced by transcode_from_filter(), and transcode_step().
|
static |
Definition at line 1181 of file ffmpeg.c.
Referenced by transcode().
Definition at line 1363 of file ffmpeg.c.
Referenced by transcode().
|
static |
Definition at line 1450 of file ffmpeg.c.
Referenced by output_packet(), and transcode_subtitles().
|
static |
Definition at line 1467 of file ffmpeg.c.
Referenced by output_packet().
int guess_input_channel_layout | ( | InputStream * | ist | ) |
Definition at line 1576 of file ffmpeg.c.
Referenced by add_input_streams(), and decode_audio().
|
static |
Definition at line 1596 of file ffmpeg.c.
Referenced by output_packet().
|
static |
Definition at line 1736 of file ffmpeg.c.
Referenced by output_packet().
|
static |
Definition at line 1851 of file ffmpeg.c.
Referenced by output_packet().
|
static |
Definition at line 1909 of file ffmpeg.c.
Referenced by encode_audio_frame(), process_input(), and transcode().
|
static |
Definition at line 2065 of file ffmpeg.c.
Referenced by get_format().
|
static |
Definition at line 2074 of file ffmpeg.c.
Referenced by init_input_stream().
|
static |
Definition at line 2112 of file ffmpeg.c.
Referenced by init_input_stream().
|
static |
|
static |
Definition at line 2163 of file ffmpeg.c.
Referenced by transcode_init().
Definition at line 2170 of file ffmpeg.c.
Referenced by parse_forced_key_frames().
|
static |
Definition at line 2176 of file ffmpeg.c.
Referenced by transcode_init().
Definition at line 2239 of file ffmpeg.c.
Referenced by process_input().
|
static |
Definition at line 2254 of file ffmpeg.c.
Referenced by transcode().
|
static |
Definition at line 2798 of file ffmpeg.c.
Referenced by transcode().
|
static |
Select the output stream to process.
Definition at line 2828 of file ffmpeg.c.
Referenced by transcode_step().
|
static |
Definition at line 2846 of file ffmpeg.c.
Referenced by transcode().
Definition at line 3069 of file ffmpeg.c.
Referenced by process_input().
|
static |
Definition at line 3089 of file ffmpeg.c.
Referenced by transcode_step().
Definition at line 3098 of file ffmpeg.c.
Referenced by process_input(), and transcode_step().
|
static |
Definition at line 3114 of file ffmpeg.c.
Referenced by transcode_step().
|
static |
Perform a step of transcoding for the specified filter graph.
[in] | graph | filter graph to consider |
[out] | best_ist | input stream where a frame would allow to continue |
Definition at line 3316 of file ffmpeg.c.
Referenced by transcode_step().
|
static |
Run a single step of transcoding.
Definition at line 3362 of file ffmpeg.c.
Referenced by transcode().
|
static |
const char program_name[] = "ffmpeg" |
program name, defined by the program for show_version().
const int program_birth_year = 2000 |
program birth year, defined by the program for show_banner()
|
static |
Definition at line 110 of file ffmpeg.c.
Referenced by do_video_stats(), and ffmpeg_cleanup().
const char* const forced_keyframes_const_names[] |
Definition at line 112 of file ffmpeg.c.
Referenced by transcode_init().
|
static |
Definition at line 125 of file ffmpeg.c.
Referenced by check_keyboard_interaction(), main(), and term_init().
|
static |
Definition at line 126 of file ffmpeg.c.
Referenced by bfi_read_packet(), cdxl_read_packet(), decode_0(), decode_frame(), do_streamcopy(), do_video_out(), do_video_stats(), flush_encoders(), print_report(), and rpl_read_header().
|
static |
Definition at line 127 of file ffmpeg.c.
Referenced by bfi_read_packet(), bmv_read_packet(), cdxl_read_packet(), do_audio_out(), do_streamcopy(), flush_encoders(), print_report(), read_packet(), rl2_read_header(), rpl_read_header(), and sdl_audio_callback().
|
static |
Definition at line 128 of file ffmpeg.c.
Referenced by asf_write_trailer(), audio_decode_example(), audio_decode_frame(), av_samples_copy(), av_samples_set_silence(), avcodec_decode_audio3(), cllc_decode_frame(), commit_bitstream_and_slice_buffer(), decode_block(), decode_frame(), decode_frame_headers(), decode_plane(), do_streamcopy(), encode_block(), filter_frame(), flv_write_header(), flv_write_packet(), get_metadata(), iff_read_header(), mov_read_custom_metadata(), mov_read_udta_string(), nut_write_packet(), print_report(), put_wav_header(), rm_write_trailer(), roq_dpcm_encode_frame(), seq_fill_buffer(), seqvideo_decode(), vp8_lossless_decode_frame(), vp8_lossy_decode_frame(), wavpack_encode_block(), and xmv_fetch_audio_packet().
|
static |
Definition at line 129 of file ffmpeg.c.
Referenced by do_streamcopy(), and print_report().
|
static |
Definition at line 130 of file ffmpeg.c.
Referenced by ape_read_packet(), asf_write_header1(), print_report(), and transcode_init().
|
static |
Definition at line 131 of file ffmpeg.c.
Referenced by do_video_out(), and print_report().
|
static |
Definition at line 132 of file ffmpeg.c.
Referenced by do_video_out(), and print_report().
|
static |
Definition at line 133 of file ffmpeg.c.
Referenced by decode_audio(), decode_video(), main(), and transcode_subtitles().
|
static |
Definition at line 135 of file ffmpeg.c.
Referenced by main(), and update_benchmark().
AVIOContext* progress_avio = NULL |
Definition at line 136 of file ffmpeg.c.
Referenced by opt_progress().
|
static |
Definition at line 138 of file ffmpeg.c.
Referenced by do_subtitle_out(), and ffmpeg_cleanup().
InputStream** input_streams = NULL |
Definition at line 147 of file ffmpeg.c.
Referenced by add_input_streams(), init_input_filter(), new_audio_stream(), new_output_stream(), open_input_file(), and open_output_file().
int nb_input_streams = 0 |
Definition at line 148 of file ffmpeg.c.
Referenced by add_input_streams(), check_keyboard_interaction(), ffmpeg_cleanup(), init_input_filter(), open_input_file(), open_output_file(), transcode(), and transcode_init().
InputFile** input_files = NULL |
Definition at line 149 of file ffmpeg.c.
Referenced by configure_input_audio_filter(), configure_input_video_filter(), init_input_filter(), open_input_file(), open_output_file(), opt_map(), opt_map_channel(), opt_target(), and sub2video_prepare().
int nb_input_files = 0 |
Definition at line 150 of file ffmpeg.c.
Referenced by add_input_streams(), dump_attachment(), ffmpeg_cleanup(), init_input_filter(), open_input_file(), open_output_file(), opt_map(), opt_map_channel(), opt_target(), reset_eagain(), and transcode_init().
OutputStream** output_streams = NULL |
Definition at line 152 of file ffmpeg.c.
Referenced by new_output_stream(), and open_output_file().
int nb_output_streams = 0 |
Definition at line 153 of file ffmpeg.c.
Referenced by check_keyboard_interaction(), choose_output(), close_all_output_streams(), ffmpeg_cleanup(), flush_encoders(), got_eagain(), need_output(), new_output_stream(), open_output_file(), output_packet(), print_report(), process_input(), reap_filters(), reset_eagain(), transcode(), transcode_init(), and transcode_subtitles().
OutputFile** output_files = NULL |
Definition at line 154 of file ffmpeg.c.
Referenced by configure_output_audio_filter(), configure_output_video_filter(), and open_output_file().
int nb_output_files = 0 |
Definition at line 155 of file ffmpeg.c.
Referenced by ffmpeg_cleanup(), get_ost_filters(), new_output_stream(), open_output_file(), print_sdp(), transcode(), and transcode_init().
FilterGraph** filtergraphs |
Definition at line 157 of file ffmpeg.c.
Referenced by configure_complex_filters(), DEF_CHOOSE_FORMAT(), open_output_file(), opt_filter_complex(), and opt_filter_complex_script().
int nb_filtergraphs |
Definition at line 158 of file ffmpeg.c.
Referenced by check_keyboard_interaction(), configure_complex_filters(), decode_audio(), decode_video(), DEF_CHOOSE_FORMAT(), ffmpeg_cleanup(), open_output_file(), opt_filter_complex(), opt_filter_complex_script(), and transcode_init().
|
static |
Definition at line 315 of file ffmpeg.c.
Referenced by ffmpeg_cleanup(), sigterm_handler(), and transcode().
|
static |
Definition at line 316 of file ffmpeg.c.
Referenced by check_keyboard_interaction(), decode_interrupt_cb(), main(), and sigterm_handler().
|
static |
Definition at line 317 of file ffmpeg.c.
Referenced by main(), and write_frame().
const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL } |
Definition at line 426 of file ffmpeg.c.
Referenced by dump_attachment(), get_preset_file_2(), open_input_file(), open_output_file(), opt_progress(), read_ffserver_streams(), and url_alloc_for_protocol().