FFmpeg
|
#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 "libavutil/avassert.h"
Go to the source code of this file.
Data Structures | |
struct | BenchmarkTimeStamps |
Macros | |
#define | SIGNAL(sig, func) signal(sig, func) |
multimedia converter based on the FFmpeg libraries
Definition in file ffmpeg.c.
|
static |
Definition at line 4472 of file ffmpeg.c.
Referenced by main(), and update_benchmark().
|
static |
Definition at line 4498 of file ffmpeg.c.
Referenced by ffmpeg_cleanup().
|
static |
Definition at line 1926 of file ffmpeg.c.
Referenced by flush_encoders(), ifilter_send_frame(), and transcode_step().
|
static |
Definition at line 176 of file ffmpeg.c.
Referenced by sub2video_update().
|
static |
Definition at line 191 of file ffmpeg.c.
Referenced by sub2video_update().
|
static |
Definition at line 222 of file ffmpeg.c.
Referenced by sub2video_heartbeat(), and sub2video_update().
void sub2video_update | ( | InputStream * | ist, |
int64_t | heartbeat_pts, | ||
AVSubtitle * | sub | ||
) |
Definition at line 240 of file ffmpeg.c.
Referenced by configure_filtergraph(), sub2video_flush(), sub2video_heartbeat(), and transcode_subtitles().
|
static |
Definition at line 280 of file ffmpeg.c.
Referenced by process_input().
|
static |
Definition at line 312 of file ffmpeg.c.
Referenced by transcode_subtitles().
|
static |
Definition at line 328 of file ffmpeg.c.
Referenced by sigterm_handler(), and term_exit().
void term_exit | ( | void | ) |
Definition at line 336 of file ffmpeg.c.
Referenced by assert_file_overwrite(), ffmpeg_cleanup(), and transcode().
|
static |
Definition at line 350 of file ffmpeg.c.
Referenced by term_init().
void term_init | ( | void | ) |
Definition at line 407 of file ffmpeg.c.
Referenced by assert_file_overwrite().
|
static |
Definition at line 456 of file ffmpeg.c.
Referenced by check_keyboard_interaction().
|
static |
void remove_avoptions | ( | AVDictionary ** | a, |
AVDictionary * | b | ||
) |
Definition at line 658 of file ffmpeg.c.
Referenced by open_input_file().
void assert_avoptions | ( | AVDictionary * | m | ) |
Definition at line 667 of file ffmpeg.c.
Referenced by init_input_stream(), init_output_stream(), and open_input_file().
Definition at line 676 of file ffmpeg.c.
Referenced by init_input_stream(), and init_output_stream().
|
static |
Definition at line 681 of file ffmpeg.c.
Referenced by decode_audio(), decode_video(), and encode_frame().
|
static |
Definition at line 702 of file ffmpeg.c.
Referenced by check_recording_time(), do_streamcopy(), need_output(), and transcode_from_filter().
|
static |
Definition at line 725 of file ffmpeg.c.
Referenced by do_streamcopy(), do_subtitle_out(), encode_audio_frame(), and encode_frame().
|
static |
Definition at line 751 of file ffmpeg.c.
Referenced by do_audio_out(), do_subtitle_out(), and do_video_out().
|
static |
Definition at line 764 of file ffmpeg.c.
Referenced by do_audio_out(), and do_video_out().
|
static |
Definition at line 3117 of file ffmpeg.c.
Referenced by init_output_stream_wrapper().
|
static |
Definition at line 811 of file ffmpeg.c.
Referenced by do_video_out(), flush_encoders(), reap_filters(), transcode_init(), and transcode_step().
Definition at line 832 of file ffmpeg.c.
Referenced by main(), print_report(), run_psnr(), and update_video_stats().
|
static |
Definition at line 837 of file ffmpeg.c.
Referenced by encode_frame().
|
static |
Definition at line 892 of file ffmpeg.c.
Referenced by do_audio_out(), do_video_out(), and flush_encoders().
|
static |
Definition at line 974 of file ffmpeg.c.
Referenced by reap_filters().
|
static |
Definition at line 994 of file ffmpeg.c.
Referenced by transcode_subtitles().
|
static |
Definition at line 1078 of file ffmpeg.c.
Referenced by reap_filters().
|
static |
Definition at line 1294 of file ffmpeg.c.
Referenced by flush_encoders(), and process_input().
Get and encode new output from any of the filtergraphs, without causing activity.
Definition at line 1313 of file ffmpeg.c.
Referenced by ifilter_send_frame(), transcode_from_filter(), and transcode_step().
|
static |
Definition at line 1390 of file ffmpeg.c.
Referenced by print_report().
|
static |
Definition at line 1507 of file ffmpeg.c.
Referenced by transcode().
|
static |
Definition at line 1717 of file ffmpeg.c.
Referenced by flush_encoders(), and ifilter_send_eof().
|
static |
Definition at line 1735 of file ffmpeg.c.
Referenced by transcode().
|
static |
Definition at line 1794 of file ffmpeg.c.
Referenced by process_input_packet(), and transcode_subtitles().
|
static |
Definition at line 1811 of file ffmpeg.c.
Referenced by process_input_packet().
int guess_input_channel_layout | ( | InputStream * | ist | ) |
Definition at line 1888 of file ffmpeg.c.
Referenced by add_input_streams().
|
static |
Definition at line 1907 of file ffmpeg.c.
Referenced by decode_audio(), decode_video(), and transcode_subtitles().
|
static |
Definition at line 1937 of file ffmpeg.c.
Referenced by send_frame_to_filters().
|
static |
Definition at line 2017 of file ffmpeg.c.
Referenced by send_filter_eof().
|
static |
Definition at line 2047 of file ffmpeg.c.
Referenced by decode_audio(), and decode_video().
|
static |
Definition at line 2070 of file ffmpeg.c.
Referenced by decode_audio(), and decode_video().
|
static |
Definition at line 2088 of file ffmpeg.c.
Referenced by process_input_packet().
|
static |
Definition at line 2148 of file ffmpeg.c.
Referenced by process_input_packet().
|
static |
Definition at line 2273 of file ffmpeg.c.
Referenced by process_input_packet().
|
static |
Definition at line 2348 of file ffmpeg.c.
Referenced by process_input_packet().
|
static |
Definition at line 2364 of file ffmpeg.c.
Referenced by process_input(), and transcode().
|
static |
Definition at line 2552 of file ffmpeg.c.
Referenced by init_input_stream().
Definition at line 2601 of file ffmpeg.c.
Referenced by transcode_init().
|
static |
Definition at line 2666 of file ffmpeg.c.
Referenced by init_encoder_time_base(), init_output_stream(), init_output_stream_encode(), and init_output_stream_streamcopy().
|
static |
Definition at line 2673 of file ffmpeg.c.
Referenced by parse_forced_key_frames().
|
static |
Definition at line 2678 of file ffmpeg.c.
Referenced by init_output_stream().
|
static |
Definition at line 2707 of file ffmpeg.c.
Referenced by init_output_stream().
|
static |
Definition at line 2826 of file ffmpeg.c.
Referenced by init_output_stream_encode().
|
static |
Definition at line 2867 of file ffmpeg.c.
Referenced by init_output_stream_encode().
|
static |
Definition at line 2930 of file ffmpeg.c.
Referenced by init_output_stream_encode().
|
static |
Definition at line 2954 of file ffmpeg.c.
Referenced by init_output_stream().
Definition at line 3261 of file ffmpeg.c.
Referenced by process_input().
|
static |
Definition at line 3276 of file ffmpeg.c.
Referenced by transcode().
|
static |
Definition at line 3458 of file ffmpeg.c.
Referenced by mf_negotiate_types(), and transcode().
|
static |
Select the output stream to process.
Definition at line 3488 of file ffmpeg.c.
Referenced by transcode_step().
|
static |
Definition at line 3515 of file ffmpeg.c.
Referenced by check_keyboard_interaction().
|
static |
Definition at line 3527 of file ffmpeg.c.
Referenced by transcode().
Definition at line 3762 of file ffmpeg.c.
Referenced by process_input().
|
static |
Definition at line 3791 of file ffmpeg.c.
Referenced by movie_request_frame(), and transcode_step().
|
static |
Definition at line 3800 of file ffmpeg.c.
Referenced by process_input(), and transcode_step().
|
static |
Definition at line 3810 of file ffmpeg.c.
Referenced by seek_to_start().
|
static |
Definition at line 3829 of file ffmpeg.c.
Referenced by process_input().
Definition at line 3895 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 4191 of file ffmpeg.c.
Referenced by transcode_step().
|
static |
Run a single step of transcoding.
Definition at line 4237 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 110 of file ffmpeg.c.
Referenced by main().
const int program_birth_year = 2000 |
program birth year, defined by the program for show_banner()
|
static |
Definition at line 113 of file ffmpeg.c.
Referenced by ffmpeg_cleanup(), and update_video_stats().
const char* const forced_keyframes_const_names[] |
Definition at line 115 of file ffmpeg.c.
Referenced by init_output_stream_encode().
|
static |
Definition at line 134 of file ffmpeg.c.
Referenced by do_video_out(), and print_report().
|
static |
Definition at line 135 of file ffmpeg.c.
Referenced by do_video_out().
|
static |
Definition at line 136 of file ffmpeg.c.
Referenced by do_video_out(), and print_report().
|
static |
Definition at line 137 of file ffmpeg.c.
Referenced by check_decode_result(), and main().
unsigned nb_output_dumped = 0 |
Definition at line 138 of file ffmpeg.c.
Referenced by of_check_init(), and print_report().
int want_sdp = 1 |
Definition at line 140 of file ffmpeg.c.
Referenced by main(), and of_check_init().
|
static |
Definition at line 142 of file ffmpeg.c.
Referenced by main(), and update_benchmark().
AVIOContext* progress_avio = NULL |
Definition at line 143 of file ffmpeg.c.
Referenced by print_report().
|
static |
Definition at line 145 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(), check_keyboard_interaction(), do_video_out(), ffmpeg_cleanup(), get_input_packet(), get_input_stream(), init_input_filter(), init_input_stream(), init_output_stream_encode(), new_audio_stream(), new_output_stream(), new_video_stream(), open_input_file(), open_output_file(), opt_map(), opt_map_channel(), print_final_stats(), process_input(), seek_to_start(), set_dispositions(), sub2video_heartbeat(), transcode(), transcode_init(), and transcode_step().
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().
Definition at line 149 of file ffmpeg.c.
Referenced by apply_sync_offsets(), assert_file_overwrite(), check_decode_result(), check_output_constraints(), configure_input_audio_filter(), configure_input_video_filter(), do_streamcopy(), ffmpeg_cleanup(), init_input_filter(), new_video_stream(), open_input_file(), open_output_file(), opt_map(), opt_map_channel(), opt_target(), print_final_stats(), process_input(), report_new_stream(), reset_eagain(), sub2video_heartbeat(), sub2video_prepare(), transcode(), transcode_from_filter(), transcode_init(), and transcode_step().
int nb_input_files = 0 |
Definition at line 150 of file ffmpeg.c.
Referenced by add_input_streams(), apply_sync_offsets(), assert_file_overwrite(), dump_attachment(), ffmpeg_cleanup(), init_input_filter(), main(), open_input_file(), open_output_file(), opt_map(), opt_map_channel(), opt_target(), print_final_stats(), reset_eagain(), and transcode_init().
OutputStream** output_streams = NULL |
Definition at line 152 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(), of_check_init(), open_output_file(), print_final_stats(), print_report(), process_input(), process_input_packet(), reap_filters(), reset_eagain(), set_dispositions(), transcode(), transcode_init(), and transcode_subtitles().
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(), new_video_stream(), open_output_file(), print_final_stats(), print_report(), process_input(), process_input_packet(), reap_filters(), reset_eagain(), transcode(), transcode_init(), and transcode_subtitles().
OutputFile** output_files = NULL |
Definition at line 154 of file ffmpeg.c.
Referenced by check_output_constraints(), check_recording_time(), close_output_stream(), configure_output_audio_filter(), configure_output_video_filter(), do_streamcopy(), do_subtitle_out(), ffmpeg_cleanup(), finish_output_stream(), flush_encoders(), init_encoder_time_base(), init_output_stream(), init_output_stream_encode(), init_output_stream_streamcopy(), main(), need_output(), open_output_file(), parse_forced_key_frames(), print_final_stats(), print_report(), print_sdp(), reap_filters(), transcode(), transcode_init(), and transcode_subtitles().
int nb_output_files = 0 |
Definition at line 155 of file ffmpeg.c.
Referenced by ffmpeg_cleanup(), get_ost_filters(), main(), new_output_stream(), open_output_file(), print_final_stats(), print_report(), print_sdp(), transcode(), and transcode_init().
FilterGraph** filtergraphs |
Definition at line 157 of file ffmpeg.c.
Referenced by check_filter_outputs(), check_keyboard_interaction(), do_video_out(), ffmpeg_cleanup(), init_complex_filters(), init_simple_filtergraph(), open_output_file(), opt_filter_complex(), opt_filter_complex_script(), and transcode_init().
int nb_filtergraphs |
Definition at line 158 of file ffmpeg.c.
Referenced by check_filter_outputs(), check_keyboard_interaction(), do_video_out(), ffmpeg_cleanup(), init_complex_filters(), init_simple_filtergraph(), open_output_file(), opt_filter_complex(), opt_filter_complex_script(), and transcode_init().
|
static |
Definition at line 342 of file ffmpeg.c.
Referenced by ffmpeg_cleanup(), sigterm_handler(), and transcode().
|
static |
Definition at line 343 of file ffmpeg.c.
Referenced by check_keyboard_interaction(), decode_interrupt_cb(), main(), and sigterm_handler().
|
static |
Definition at line 344 of file ffmpeg.c.
Referenced by decode_interrupt_cb(), ffmpeg_cleanup(), and transcode_init().
|
static |
Definition at line 345 of file ffmpeg.c.
Referenced by ffmpeg_cleanup().
int main_return_code = 0 |
Definition at line 346 of file ffmpeg.c.
Referenced by main(), and of_write_packet().
|
static |
Definition at line 347 of file ffmpeg.c.
Referenced by print_report().
const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL } |
Definition at line 512 of file ffmpeg.c.
Referenced by avio_open2(), dump_attachment(), ff_network_sleep_interruptible(), ff_network_wait_fd_timeout(), ffio_open_whitelist(), ffurl_alloc(), ffurl_open_whitelist(), get_preset_file_2(), libsrt_network_wait_fd_timeout(), open_input_file(), open_output_file(), print_sdp(), url_alloc_for_protocol(), and zmq_proto_wait_timeout().