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/display.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 int | ost_get_filters (const OptionsContext *o, AVFormatContext *oc, OutputStream *ost, char **dst) |
static int | parse_matrix_coeffs (void *logctx, uint16_t *dest, const char *str) |
static int | fmt_in_list (const int *formats, int format) |
static enum AVPixelFormat | choose_pixel_fmt (const AVCodec *codec, enum AVPixelFormat target) |
static enum AVPixelFormat | pix_fmt_parse (OutputStream *ost, const char *name) |
static int | new_stream_video (Muxer *mux, const OptionsContext *o, OutputStream *ost) |
static int | new_stream_audio (Muxer *mux, const OptionsContext *o, OutputStream *ost) |
static int | new_stream_attachment (Muxer *mux, const OptionsContext *o, OutputStream *ost) |
static int | new_stream_subtitle (Muxer *mux, const OptionsContext *o, OutputStream *ost) |
static int | streamcopy_init (const Muxer *mux, OutputStream *ost) |
static int | ost_add (Muxer *mux, const OptionsContext *o, enum AVMediaType type, InputStream *ist, OutputFilter *ofilter, OutputStream **post) |
static int | map_auto_video (Muxer *mux, const OptionsContext *o) |
static int | map_auto_audio (Muxer *mux, const OptionsContext *o) |
static int | map_auto_subtitle (Muxer *mux, const OptionsContext *o) |
static int | map_auto_data (Muxer *mux, const OptionsContext *o) |
static int | map_manual (Muxer *mux, const OptionsContext *o, const StreamMap *map) |
static int | of_add_attachments (Muxer *mux, const OptionsContext *o) |
static int | create_streams (Muxer *mux, const OptionsContext *o) |
static int | setup_sync_queues (Muxer *mux, AVFormatContext *oc, int64_t buf_size_us) |
static int | of_add_programs (Muxer *mux, const OptionsContext *o) |
static int | 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 int | of_add_metadata (OutputFile *of, AVFormatContext *oc, const OptionsContext *o) |
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) |
static int | 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 int | parse_forced_key_frames (void *log, KeyframeForceCtx *kf, const Muxer *mux, const char *spec) |
static int | process_forced_keyframes (Muxer *mux, const OptionsContext *o) |
static int | validate_enc_avopt (Muxer *mux, const AVDictionary *codec_avopt) |
static int | init_output_stream_nofilter (OutputStream *ost) |
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 49 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 92 of file ffmpeg_mux_init.c.
|
static |
Definition at line 108 of file ffmpeg_mux_init.c.
Referenced by ost_add().
|
static |
Definition at line 151 of file ffmpeg_mux_init.c.
Referenced by ost_add().
|
static |
Definition at line 164 of file ffmpeg_mux_init.c.
Referenced by ost_add().
|
static |
Definition at line 202 of file ffmpeg_mux_init.c.
Referenced by enc_stats_init().
void of_enc_stats_close | ( | void | ) |
Definition at line 235 of file ffmpeg_mux_init.c.
Referenced by ffmpeg_cleanup().
|
static |
Definition at line 245 of file ffmpeg_mux_init.c.
Referenced by enc_stats_init().
|
static |
Definition at line 284 of file ffmpeg_mux_init.c.
Referenced by ost_add().
|
static |
Definition at line 410 of file ffmpeg_mux_init.c.
|
static |
Definition at line 424 of file ffmpeg_mux_init.c.
Referenced by ost_add().
|
static |
Definition at line 445 of file ffmpeg_mux_init.c.
Referenced by ost_add().
|
static |
Definition at line 492 of file ffmpeg_mux_init.c.
Referenced by new_stream_video().
Definition at line 512 of file ffmpeg_mux_init.c.
Referenced by pix_fmt_parse().
|
static |
Definition at line 521 of file ffmpeg_mux_init.c.
Referenced by pix_fmt_parse().
|
static |
Definition at line 546 of file ffmpeg_mux_init.c.
Referenced by new_stream_video().
|
static |
Definition at line 589 of file ffmpeg_mux_init.c.
Referenced by ost_add().
|
static |
Definition at line 834 of file ffmpeg_mux_init.c.
Referenced by ost_add().
|
static |
Definition at line 923 of file ffmpeg_mux_init.c.
Referenced by ost_add().
|
static |
Definition at line 930 of file ffmpeg_mux_init.c.
Referenced by ost_add().
|
static |
Definition at line 971 of file ffmpeg_mux_init.c.
Referenced by ost_add().
|
static |
Definition at line 1107 of file ffmpeg_mux_init.c.
Referenced by create_streams(), map_auto_audio(), map_auto_data(), map_auto_subtitle(), map_auto_video(), map_manual(), and of_add_attachments().
|
static |
Definition at line 1466 of file ffmpeg_mux_init.c.
Referenced by create_streams().
|
static |
Definition at line 1519 of file ffmpeg_mux_init.c.
Referenced by create_streams().
|
static |
Definition at line 1563 of file ffmpeg_mux_init.c.
Referenced by create_streams().
|
static |
Definition at line 1602 of file ffmpeg_mux_init.c.
Referenced by create_streams().
|
static |
Definition at line 1625 of file ffmpeg_mux_init.c.
Referenced by create_streams().
|
static |
Definition at line 1700 of file ffmpeg_mux_init.c.
Referenced by create_streams().
|
static |
Definition at line 1772 of file ffmpeg_mux_init.c.
Referenced by of_open().
|
static |
Definition at line 1849 of file ffmpeg_mux_init.c.
Referenced by of_open().
|
static |
Definition at line 1946 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 2015 of file ffmpeg_mux_init.c.
Referenced by copy_metadata(), and of_add_metadata().
|
static |
Definition at line 2045 of file ffmpeg_mux_init.c.
Referenced by of_open().
|
static |
Definition at line 2123 of file ffmpeg_mux_init.c.
Referenced by copy_meta().
|
static |
Definition at line 2166 of file ffmpeg_mux_init.c.
Referenced by copy_chapters(), and copy_meta().
|
static |
Definition at line 2253 of file ffmpeg_mux_init.c.
Referenced by of_open().
|
static |
Definition at line 2328 of file ffmpeg_mux_init.c.
Referenced by of_open().
|
static |
Definition at line 2408 of file ffmpeg_mux_init.c.
Referenced by parse_forced_key_frames().
|
static |
Definition at line 2413 of file ffmpeg_mux_init.c.
Referenced by process_forced_keyframes().
|
static |
Definition at line 2487 of file ffmpeg_mux_init.c.
Referenced by of_open().
|
static |
Definition at line 2532 of file ffmpeg_mux_init.c.
Referenced by of_open().
|
static |
Definition at line 2578 of file ffmpeg_mux_init.c.
Referenced by of_open().
|
static |
Definition at line 2595 of file ffmpeg_mux_init.c.
|
static |
Definition at line 2609 of file ffmpeg_mux_init.c.
Referenced by of_open().
int of_open | ( | const OptionsContext * | o, |
const char * | filename | ||
) |
Definition at line 2624 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 90 of file ffmpeg_mux_init.c.
|
static |
Definition at line 199 of file ffmpeg_mux_init.c.
Referenced by enc_stats_get_file(), and of_enc_stats_close().
|
static |
Definition at line 200 of file ffmpeg_mux_init.c.
Referenced by enc_stats_get_file(), and of_enc_stats_close().
|
static |
Definition at line 417 of file ffmpeg_mux_init.c.
Referenced by mux_stream_alloc().
const char* const forced_keyframes_const_names[] |
Definition at line 2399 of file ffmpeg_mux_init.c.
Referenced by process_forced_keyframes().
|
static |
Definition at line 2602 of file ffmpeg_mux_init.c.
Referenced by mux_alloc().