1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-21 23:23:19 +00:00

New option --no-ometadata to opt out of including metadata when encoding.

This re-allows the previous behaviour of being able to reencode with
metadata removed, which is useful when encoding "inconsistently" tagged
data for a device/player that shows file names when tags are not
present.
This commit is contained in:
Rudolf Polzer 2014-04-14 20:29:23 +02:00
parent 7178257bb6
commit a7c6c4656d
4 changed files with 11 additions and 1 deletions

View File

@ -149,3 +149,7 @@ You can encode files from one format/codec to another using this facility.
container formats, e.g. AVI). In this mode, discontinuities are not fixed
and all pts are passed through as-is. Never seek backwards or use multiple
input files in this mode!
``--no-ometadata``
Turns off copying of metadata from input files to output files when
encoding (which is enabled by default).

View File

@ -247,7 +247,8 @@ struct encode_lavc_context *encode_lavc_init(struct encode_output_conf *options,
void encode_lavc_set_metadata(struct encode_lavc_context *ctx,
struct mp_tags *metadata)
{
ctx->metadata = metadata;
if (ctx->options->metadata)
ctx->metadata = metadata;
}
int encode_lavc_start(struct encode_lavc_context *ctx)

View File

@ -635,6 +635,7 @@ const m_option_t mp_opts[] = {
OPT_FLAG("oneverdrop", encode_output.neverdrop, CONF_GLOBAL),
OPT_FLAG("ovfirst", encode_output.video_first, CONF_GLOBAL),
OPT_FLAG("oafirst", encode_output.audio_first, CONF_GLOBAL),
OPT_FLAG("ometadata", encode_output.metadata, CONF_GLOBAL),
#endif
{NULL, NULL, 0, 0, 0, 0, NULL}
@ -766,6 +767,9 @@ const struct MPOpts mp_default_opts = {
#endif
.default_bindings = 1,
},
.encode_output = {
.metadata = 1,
},
};
#endif /* MPLAYER_CFG_MPLAYER_H */

View File

@ -302,6 +302,7 @@ typedef struct MPOpts {
int neverdrop;
int video_first;
int audio_first;
int metadata;
} encode_output;
} MPOpts;