FFmpeg
|
#include <string.h>
#include "cmdutils.h"
#include "ffmpeg.h"
#include "ffmpeg_mux.h"
#include "fopen_utf8.h"
#include "libavformat/avformat.h"
#include "libavformat/avio.h"
#include "libavcodec/avcodec.h"
#include "libavfilter/avfilter.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/avutil.h"
#include "libavutil/bprint.h"
#include "libavutil/dict.h"
#include "libavutil/getenv_utf8.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
Go to the source code of this file.
Data Structures | |
struct | EncStatsFile |
Macros | |
#define | DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass" |
#define | IS_AV_ENC(ost, type) (ost->enc_ctx && (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO)) |
#define | IS_INTERLEAVED(type) (type != AVMEDIA_TYPE_ATTACHMENT) |
#define | METADATA_CHECK_INDEX(index, nb_elems, desc) |
#define | SET_DICT(type, meta, context, index) |
Functions | |
static int | check_opt_bitexact (void *ctx, const AVDictionary *opts, const char *opt_name, int flag) |
static int | choose_encoder (const OptionsContext *o, AVFormatContext *s, OutputStream *ost, const AVCodec **enc) |
static char * | get_line (AVIOContext *s, AVBPrint *bprint) |
static int | get_preset_file_2 (const char *preset_name, const char *codec_name, AVIOContext **s) |
static int | enc_stats_get_file (AVIOContext **io, const char *path) |
void | of_enc_stats_close (void) |
static int | unescape (char **pdst, size_t *dst_len, const char **pstr, char delim) |
static int | enc_stats_init (OutputStream *ost, EncStats *es, int pre, const char *path, const char *fmt_spec) |
static const char * | output_stream_item_name (void *obj) |
static MuxStream * | mux_stream_alloc (Muxer *mux, enum AVMediaType type) |
static OutputStream * | new_output_stream (Muxer *mux, const OptionsContext *o, enum AVMediaType type, InputStream *ist) |
static char * | get_ost_filters (const OptionsContext *o, AVFormatContext *oc, OutputStream *ost) |
static void | check_streamcopy_filters (const OptionsContext *o, AVFormatContext *oc, OutputStream *ost, enum AVMediaType type) |
static void | parse_matrix_coeffs (void *logctx, uint16_t *dest, const char *str) |
static OutputStream * | new_video_stream (Muxer *mux, const OptionsContext *o, InputStream *ist) |
static OutputStream * | new_audio_stream (Muxer *mux, const OptionsContext *o, InputStream *ist) |
static OutputStream * | new_data_stream (Muxer *mux, const OptionsContext *o, InputStream *ist) |
static OutputStream * | new_unknown_stream (Muxer *mux, const OptionsContext *o, InputStream *ist) |
static OutputStream * | new_attachment_stream (Muxer *mux, const OptionsContext *o, InputStream *ist) |
static OutputStream * | new_subtitle_stream (Muxer *mux, const OptionsContext *o, InputStream *ist) |
static void | init_output_filter (OutputFilter *ofilter, const OptionsContext *o, Muxer *mux) |
static void | map_auto_video (Muxer *mux, const OptionsContext *o) |
static void | map_auto_audio (Muxer *mux, const OptionsContext *o) |
static void | map_auto_subtitle (Muxer *mux, const OptionsContext *o) |
static void | map_auto_data (Muxer *mux, const OptionsContext *o) |
static void | map_manual (Muxer *mux, const OptionsContext *o, const StreamMap *map) |
static void | of_add_attachments (Muxer *mux, const OptionsContext *o) |
static void | create_streams (Muxer *mux, const OptionsContext *o) |
static int | setup_sync_queues (Muxer *mux, AVFormatContext *oc, int64_t buf_size_us) |
static void | of_add_programs (Muxer *mux, const OptionsContext *o) |
static void | parse_meta_type (void *logctx, const char *arg, char *type, int *index, const char **stream_spec) |
Parse a metadata specifier passed as 'arg' parameter. More... | |
static void | of_add_metadata (OutputFile *of, AVFormatContext *oc, const OptionsContext *o) |
static void | set_channel_layout (OutputFilter *f, OutputStream *ost) |
static int | copy_chapters (InputFile *ifile, OutputFile *ofile, AVFormatContext *os, int copy_metadata) |
static int | copy_metadata (Muxer *mux, AVFormatContext *ic, const char *outspec, const char *inspec, int *metadata_global_manual, int *metadata_streams_manual, int *metadata_chapters_manual, const OptionsContext *o) |
static void | copy_meta (Muxer *mux, const OptionsContext *o) |
static int | set_dispositions (Muxer *mux, const OptionsContext *o) |
static int | compare_int64 (const void *a, const void *b) |
static void | parse_forced_key_frames (KeyframeForceCtx *kf, const Muxer *mux, const char *spec) |
static int | process_forced_keyframes (Muxer *mux, const OptionsContext *o) |
static void | validate_enc_avopt (Muxer *mux, const AVDictionary *codec_avopt) |
static const char * | output_file_item_name (void *obj) |
static Muxer * | mux_alloc (void) |
int | of_open (const OptionsContext *o, const char *filename) |
Variables | |
static const char *const | opt_name_apad [] = {"apad", NULL} |
static const char *const | opt_name_autoscale [] = {"autoscale", NULL} |
static const char *const | opt_name_bits_per_raw_sample [] = {"bits_per_raw_sample", NULL} |
static const char *const | opt_name_bitstream_filters [] = {"bsf", "absf", "vbsf", NULL} |
static const char *const | opt_name_copy_initial_nonkeyframes [] = {"copyinkf", NULL} |
static const char *const | opt_name_copy_prior_start [] = {"copypriorss", NULL} |
static const char *const | opt_name_disposition [] = {"disposition", NULL} |
static const char *const | opt_name_enc_time_bases [] = {"enc_time_base", NULL} |
static const char *const | opt_name_enc_stats_pre [] = {"enc_stats_pre", NULL} |
static const char *const | opt_name_enc_stats_post [] = {"enc_stats_post", NULL} |
static const char *const | opt_name_mux_stats [] = {"mux_stats", NULL} |
static const char *const | opt_name_enc_stats_pre_fmt [] = {"enc_stats_pre_fmt", NULL} |
static const char *const | opt_name_enc_stats_post_fmt [] = {"enc_stats_post_fmt", NULL} |
static const char *const | opt_name_mux_stats_fmt [] = {"mux_stats_fmt", NULL} |
static const char *const | opt_name_filters [] = {"filter", "af", "vf", NULL} |
static const char *const | opt_name_filter_scripts [] = {"filter_script", NULL} |
static const char *const | opt_name_fix_sub_duration_heartbeat [] = {"fix_sub_duration_heartbeat", NULL} |
static const char *const | opt_name_fps_mode [] = {"fps_mode", NULL} |
static const char *const | opt_name_force_fps [] = {"force_fps", NULL} |
static const char *const | opt_name_forced_key_frames [] = {"forced_key_frames", NULL} |
static const char *const | opt_name_frame_aspect_ratios [] = {"aspect", NULL} |
static const char *const | opt_name_intra_matrices [] = {"intra_matrix", NULL} |
static const char *const | opt_name_inter_matrices [] = {"inter_matrix", NULL} |
static const char *const | opt_name_chroma_intra_matrices [] = {"chroma_intra_matrix", NULL} |
static const char *const | opt_name_max_frame_rates [] = {"fpsmax", NULL} |
static const char *const | opt_name_max_frames [] = {"frames", "aframes", "vframes", "dframes", NULL} |
static const char *const | opt_name_max_muxing_queue_size [] = {"max_muxing_queue_size", NULL} |
static const char *const | opt_name_muxing_queue_data_threshold [] = {"muxing_queue_data_threshold", NULL} |
static const char *const | opt_name_pass [] = {"pass", NULL} |
static const char *const | opt_name_passlogfiles [] = {"passlogfile", NULL} |
static const char *const | opt_name_presets [] = {"pre", "apre", "vpre", "spre", NULL} |
static const char *const | opt_name_qscale [] = {"q", "qscale", NULL} |
static const char *const | opt_name_rc_overrides [] = {"rc_override", NULL} |
static const char *const | opt_name_time_bases [] = {"time_base", NULL} |
static const char *const | opt_name_audio_channels [] = {"ac", NULL} |
static const char *const | opt_name_audio_ch_layouts [] = {"channel_layout", "ch_layout", NULL} |
static const char *const | opt_name_audio_sample_rate [] = {"ar", NULL} |
static const char *const | opt_name_frame_sizes [] = {"s", NULL} |
static const char *const | opt_name_frame_pix_fmts [] = {"pix_fmt", NULL} |
static const char *const | opt_name_sample_fmts [] = {"sample_fmt", NULL} |
static EncStatsFile * | enc_stats_files |
static int | nb_enc_stats_files |
static const AVClass | output_stream_class |
const char *const | forced_keyframes_const_names [] |
static const AVClass | output_file_class |
#define DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass" |
Definition at line 48 of file ffmpeg_mux_init.c.
#define IS_AV_ENC | ( | ost, | |
type | |||
) | (ost->enc_ctx && (type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO)) |
#define IS_INTERLEAVED | ( | type | ) | (type != AVMEDIA_TYPE_ATTACHMENT) |
|
static |
Definition at line 91 of file ffmpeg_mux_init.c.
Referenced by new_output_stream(), and of_open().
|
static |
Definition at line 107 of file ffmpeg_mux_init.c.
Referenced by new_output_stream().
|
static |
Definition at line 137 of file ffmpeg_mux_init.c.
Referenced by new_output_stream().
|
static |
Definition at line 149 of file ffmpeg_mux_init.c.
Referenced by new_output_stream().
|
static |
Definition at line 187 of file ffmpeg_mux_init.c.
Referenced by enc_stats_init().
void of_enc_stats_close | ( | void | ) |
Definition at line 218 of file ffmpeg_mux_init.c.
Referenced by ffmpeg_cleanup().
|
static |
Definition at line 228 of file ffmpeg_mux_init.c.
Referenced by enc_stats_init().
|
static |
Definition at line 267 of file ffmpeg_mux_init.c.
Referenced by new_output_stream().
|
static |
Definition at line 390 of file ffmpeg_mux_init.c.
|
static |
Definition at line 404 of file ffmpeg_mux_init.c.
Referenced by new_output_stream().
|
static |
Definition at line 421 of file ffmpeg_mux_init.c.
Referenced by new_attachment_stream(), new_audio_stream(), new_data_stream(), new_subtitle_stream(), new_unknown_stream(), and new_video_stream().
|
static |
Definition at line 656 of file ffmpeg_mux_init.c.
Referenced by new_audio_stream(), and new_video_stream().
|
static |
Definition at line 675 of file ffmpeg_mux_init.c.
Referenced by new_audio_stream(), and new_video_stream().
|
static |
Definition at line 688 of file ffmpeg_mux_init.c.
Referenced by new_video_stream().
|
static |
Definition at line 706 of file ffmpeg_mux_init.c.
Referenced by init_output_filter(), map_auto_video(), and map_manual().
|
static |
Definition at line 946 of file ffmpeg_mux_init.c.
Referenced by init_output_filter(), map_auto_audio(), and map_manual().
|
static |
Definition at line 1044 of file ffmpeg_mux_init.c.
Referenced by map_auto_data(), and map_manual().
|
static |
Definition at line 1057 of file ffmpeg_mux_init.c.
Referenced by map_manual().
|
static |
Definition at line 1070 of file ffmpeg_mux_init.c.
Referenced by map_manual(), and of_add_attachments().
|
static |
Definition at line 1077 of file ffmpeg_mux_init.c.
Referenced by map_auto_subtitle(), and map_manual().
|
static |
Definition at line 1099 of file ffmpeg_mux_init.c.
Referenced by create_streams(), and map_manual().
|
static |
Definition at line 1140 of file ffmpeg_mux_init.c.
Referenced by create_streams().
|
static |
Definition at line 1191 of file ffmpeg_mux_init.c.
Referenced by create_streams().
|
static |
Definition at line 1233 of file ffmpeg_mux_init.c.
Referenced by create_streams().
|
static |
Definition at line 1271 of file ffmpeg_mux_init.c.
Referenced by create_streams().
|
static |
Definition at line 1289 of file ffmpeg_mux_init.c.
Referenced by create_streams().
|
static |
Definition at line 1360 of file ffmpeg_mux_init.c.
Referenced by create_streams().
|
static |
Definition at line 1401 of file ffmpeg_mux_init.c.
Referenced by of_open().
|
static |
Definition at line 1451 of file ffmpeg_mux_init.c.
Referenced by of_open().
|
static |
Definition at line 1545 of file ffmpeg_mux_init.c.
Referenced by of_open().
|
static |
Parse a metadata specifier passed as 'arg' parameter.
arg | metadata string to parse |
type | metadata type is written here – g(lobal)/s(tream)/c(hapter)/p(rogram) |
index | for type c/p, chapter/program index is written here |
stream_spec | for type s, the stream specifier is written here |
Definition at line 1624 of file ffmpeg_mux_init.c.
Referenced by copy_metadata(), and of_add_metadata().
|
static |
Definition at line 1652 of file ffmpeg_mux_init.c.
Referenced by of_open().
|
static |
Definition at line 1725 of file ffmpeg_mux_init.c.
Referenced by of_open().
|
static |
Definition at line 1763 of file ffmpeg_mux_init.c.
Referenced by copy_meta().
|
static |
Definition at line 1806 of file ffmpeg_mux_init.c.
Referenced by copy_chapters(), and copy_meta().
|
static |
Definition at line 1890 of file ffmpeg_mux_init.c.
Referenced by of_open().
|
static |
Definition at line 1960 of file ffmpeg_mux_init.c.
Referenced by of_open().
|
static |
Definition at line 2039 of file ffmpeg_mux_init.c.
Referenced by parse_forced_key_frames().
|
static |
Definition at line 2044 of file ffmpeg_mux_init.c.
Referenced by process_forced_keyframes().
|
static |
Definition at line 2098 of file ffmpeg_mux_init.c.
Referenced by of_open().
|
static |
Definition at line 2137 of file ffmpeg_mux_init.c.
Referenced by of_open().
|
static |
Definition at line 2181 of file ffmpeg_mux_init.c.
|
static |
Definition at line 2195 of file ffmpeg_mux_init.c.
Referenced by of_open().
int of_open | ( | const OptionsContext * | o, |
const char * | filename | ||
) |
Definition at line 2207 of file ffmpeg_mux_init.c.
|
static |
Definition at line 50 of file ffmpeg_mux_init.c.
|
static |
Definition at line 51 of file ffmpeg_mux_init.c.
|
static |
Definition at line 52 of file ffmpeg_mux_init.c.
|
static |
Definition at line 53 of file ffmpeg_mux_init.c.
|
static |
Definition at line 54 of file ffmpeg_mux_init.c.
|
static |
Definition at line 55 of file ffmpeg_mux_init.c.
|
static |
Definition at line 56 of file ffmpeg_mux_init.c.
|
static |
Definition at line 57 of file ffmpeg_mux_init.c.
|
static |
Definition at line 58 of file ffmpeg_mux_init.c.
|
static |
Definition at line 59 of file ffmpeg_mux_init.c.
|
static |
Definition at line 60 of file ffmpeg_mux_init.c.
|
static |
Definition at line 61 of file ffmpeg_mux_init.c.
|
static |
Definition at line 62 of file ffmpeg_mux_init.c.
|
static |
Definition at line 63 of file ffmpeg_mux_init.c.
|
static |
Definition at line 64 of file ffmpeg_mux_init.c.
|
static |
Definition at line 65 of file ffmpeg_mux_init.c.
|
static |
Definition at line 66 of file ffmpeg_mux_init.c.
|
static |
Definition at line 67 of file ffmpeg_mux_init.c.
|
static |
Definition at line 68 of file ffmpeg_mux_init.c.
|
static |
Definition at line 69 of file ffmpeg_mux_init.c.
|
static |
Definition at line 70 of file ffmpeg_mux_init.c.
|
static |
Definition at line 71 of file ffmpeg_mux_init.c.
|
static |
Definition at line 72 of file ffmpeg_mux_init.c.
|
static |
Definition at line 73 of file ffmpeg_mux_init.c.
|
static |
Definition at line 74 of file ffmpeg_mux_init.c.
|
static |
Definition at line 75 of file ffmpeg_mux_init.c.
|
static |
Definition at line 76 of file ffmpeg_mux_init.c.
|
static |
Definition at line 77 of file ffmpeg_mux_init.c.
|
static |
Definition at line 78 of file ffmpeg_mux_init.c.
|
static |
Definition at line 79 of file ffmpeg_mux_init.c.
|
static |
Definition at line 80 of file ffmpeg_mux_init.c.
|
static |
Definition at line 81 of file ffmpeg_mux_init.c.
|
static |
Definition at line 82 of file ffmpeg_mux_init.c.
|
static |
Definition at line 83 of file ffmpeg_mux_init.c.
|
static |
Definition at line 84 of file ffmpeg_mux_init.c.
|
static |
Definition at line 85 of file ffmpeg_mux_init.c.
|
static |
Definition at line 86 of file ffmpeg_mux_init.c.
|
static |
Definition at line 87 of file ffmpeg_mux_init.c.
|
static |
Definition at line 88 of file ffmpeg_mux_init.c.
|
static |
Definition at line 89 of file ffmpeg_mux_init.c.
|
static |
Definition at line 184 of file ffmpeg_mux_init.c.
Referenced by enc_stats_get_file(), and of_enc_stats_close().
|
static |
Definition at line 185 of file ffmpeg_mux_init.c.
Referenced by enc_stats_get_file(), and of_enc_stats_close().
|
static |
Definition at line 397 of file ffmpeg_mux_init.c.
Referenced by mux_stream_alloc().
const char* const forced_keyframes_const_names[] |
Definition at line 2030 of file ffmpeg_mux_init.c.
Referenced by process_forced_keyframes().
|
static |
Definition at line 2188 of file ffmpeg_mux_init.c.
Referenced by mux_alloc().