mirror of
https://github.com/mpv-player/mpv
synced 2025-03-24 04:08:19 +00:00
encode_lavc strings: use new option syntax
This commit is contained in:
parent
7ae4242820
commit
dcd36c79c7
@ -72,7 +72,7 @@ static int init(struct ao *ao, char *params)
|
|||||||
|
|
||||||
if (!encode_lavc_available(ao->encode_lavc_ctx)) {
|
if (!encode_lavc_available(ao->encode_lavc_ctx)) {
|
||||||
mp_msg(MSGT_ENCODE, MSGL_ERR,
|
mp_msg(MSGT_ENCODE, MSGL_ERR,
|
||||||
"ao-lavc: the option -o (output file) must be specified\n");
|
"ao-lavc: the option --o (output file) must be specified\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -479,8 +479,8 @@ AVStream *encode_lavc_alloc_stream(struct encode_lavc_context *ctx,
|
|||||||
else if (ctx->options->autofps && ctx->vo_fps > 0) {
|
else if (ctx->options->autofps && ctx->vo_fps > 0) {
|
||||||
r = av_d2q(ctx->vo_fps, ctx->vo_fps * 1001 + 2);
|
r = av_d2q(ctx->vo_fps, ctx->vo_fps * 1001 + 2);
|
||||||
mp_msg(
|
mp_msg(
|
||||||
MSGT_ENCODE, MSGL_INFO, "vo-lavc: option -ofps not specified "
|
MSGT_ENCODE, MSGL_INFO, "vo-lavc: option --ofps not specified "
|
||||||
"but -oautofps is active, using guess of %u/%u\n",
|
"but --oautofps is active, using guess of %u/%u\n",
|
||||||
(unsigned)r.num, (unsigned)r.den);
|
(unsigned)r.num, (unsigned)r.den);
|
||||||
} else {
|
} else {
|
||||||
// we want to handle:
|
// we want to handle:
|
||||||
@ -493,7 +493,7 @@ AVStream *encode_lavc_alloc_stream(struct encode_lavc_context *ctx,
|
|||||||
r.num = 24000;
|
r.num = 24000;
|
||||||
r.den = 1;
|
r.den = 1;
|
||||||
mp_msg(
|
mp_msg(
|
||||||
MSGT_ENCODE, MSGL_INFO, "vo-lavc: option -ofps not specified "
|
MSGT_ENCODE, MSGL_INFO, "vo-lavc: option --ofps not specified "
|
||||||
"and fps could not be inferred, using guess of %u/%u\n",
|
"and fps could not be inferred, using guess of %u/%u\n",
|
||||||
(unsigned)r.num, (unsigned)r.den);
|
(unsigned)r.num, (unsigned)r.den);
|
||||||
}
|
}
|
||||||
@ -618,7 +618,7 @@ int encode_lavc_open_codec(struct encode_lavc_context *ctx, AVStream *stream)
|
|||||||
"- Codec implementation in ffmpeg/libav is not finished yet.\n"
|
"- Codec implementation in ffmpeg/libav is not finished yet.\n"
|
||||||
" Try updating ffmpeg or libav.\n"
|
" Try updating ffmpeg or libav.\n"
|
||||||
"- Bad picture quality, blocks, blurriness.\n"
|
"- Bad picture quality, blocks, blurriness.\n"
|
||||||
" Experiment with codec settings (-ovcopts) to maybe still get the\n"
|
" Experiment with codec settings (--ovcopts) to maybe still get the\n"
|
||||||
" desired quality output at the expense of bitrate.\n"
|
" desired quality output at the expense of bitrate.\n"
|
||||||
"- Slow compression.\n"
|
"- Slow compression.\n"
|
||||||
" Bear with it.\n"
|
" Bear with it.\n"
|
||||||
@ -654,7 +654,7 @@ int encode_lavc_open_codec(struct encode_lavc_context *ctx, AVStream *stream)
|
|||||||
"- Codec implementation in ffmpeg/libav is not finished yet.\n"
|
"- Codec implementation in ffmpeg/libav is not finished yet.\n"
|
||||||
" Try updating ffmpeg or libav.\n"
|
" Try updating ffmpeg or libav.\n"
|
||||||
"- Bad sound quality, noise, clicking, whistles, choppiness.\n"
|
"- Bad sound quality, noise, clicking, whistles, choppiness.\n"
|
||||||
" Experiment with codec settings (-oacopts) to maybe still get the\n"
|
" Experiment with codec settings (--oacopts) to maybe still get the\n"
|
||||||
" desired quality output at the expense of bitrate.\n"
|
" desired quality output at the expense of bitrate.\n"
|
||||||
"- Slow compression.\n"
|
"- Slow compression.\n"
|
||||||
" Bear with it.\n"
|
" Bear with it.\n"
|
||||||
@ -867,7 +867,7 @@ bool encode_lavc_showhelp(struct MPOpts *opts)
|
|||||||
AVOutputFormat *c = NULL;
|
AVOutputFormat *c = NULL;
|
||||||
mp_msg(MSGT_ENCODE, MSGL_INFO, "Available output formats:\n");
|
mp_msg(MSGT_ENCODE, MSGL_INFO, "Available output formats:\n");
|
||||||
while ((c = av_oformat_next(c)))
|
while ((c = av_oformat_next(c)))
|
||||||
mp_msg(MSGT_ENCODE, MSGL_INFO, " -of %-13s %s\n", c->name,
|
mp_msg(MSGT_ENCODE, MSGL_INFO, " --of=%-13s %s\n", c->name,
|
||||||
c->long_name ? c->long_name : "");
|
c->long_name ? c->long_name : "");
|
||||||
av_free(c);
|
av_free(c);
|
||||||
}
|
}
|
||||||
@ -876,16 +876,16 @@ bool encode_lavc_showhelp(struct MPOpts *opts)
|
|||||||
AVOutputFormat *format = NULL;
|
AVOutputFormat *format = NULL;
|
||||||
mp_msg(MSGT_ENCODE, MSGL_INFO,
|
mp_msg(MSGT_ENCODE, MSGL_INFO,
|
||||||
"Available output format ctx->options:\n");
|
"Available output format ctx->options:\n");
|
||||||
encode_lavc_printoptions(c, " -ofopts ", " ", NULL,
|
encode_lavc_printoptions(c, " --ofopts=", " ", NULL,
|
||||||
AV_OPT_FLAG_ENCODING_PARAM,
|
AV_OPT_FLAG_ENCODING_PARAM,
|
||||||
AV_OPT_FLAG_ENCODING_PARAM);
|
AV_OPT_FLAG_ENCODING_PARAM);
|
||||||
av_free(c);
|
av_free(c);
|
||||||
while ((format = av_oformat_next(format))) {
|
while ((format = av_oformat_next(format))) {
|
||||||
if (format->priv_class) {
|
if (format->priv_class) {
|
||||||
mp_msg(MSGT_ENCODE, MSGL_INFO, "Additionally, for -of %s:\n",
|
mp_msg(MSGT_ENCODE, MSGL_INFO, "Additionally, for --of=%s:\n",
|
||||||
format->name);
|
format->name);
|
||||||
encode_lavc_printoptions(&format->priv_class, " -ofopts ",
|
encode_lavc_printoptions(&format->priv_class, " --ofopts=",
|
||||||
" ", NULL,
|
" ", NULL,
|
||||||
AV_OPT_FLAG_ENCODING_PARAM,
|
AV_OPT_FLAG_ENCODING_PARAM,
|
||||||
AV_OPT_FLAG_ENCODING_PARAM);
|
AV_OPT_FLAG_ENCODING_PARAM);
|
||||||
}
|
}
|
||||||
@ -897,7 +897,7 @@ bool encode_lavc_showhelp(struct MPOpts *opts)
|
|||||||
mp_msg(MSGT_ENCODE, MSGL_INFO,
|
mp_msg(MSGT_ENCODE, MSGL_INFO,
|
||||||
"Available output video codec ctx->options:\n");
|
"Available output video codec ctx->options:\n");
|
||||||
encode_lavc_printoptions(
|
encode_lavc_printoptions(
|
||||||
c, " -ovcopts ", " ", NULL,
|
c, " --ovcopts=", " ", NULL,
|
||||||
AV_OPT_FLAG_ENCODING_PARAM |
|
AV_OPT_FLAG_ENCODING_PARAM |
|
||||||
AV_OPT_FLAG_VIDEO_PARAM,
|
AV_OPT_FLAG_VIDEO_PARAM,
|
||||||
AV_OPT_FLAG_ENCODING_PARAM |
|
AV_OPT_FLAG_ENCODING_PARAM |
|
||||||
@ -912,11 +912,11 @@ bool encode_lavc_showhelp(struct MPOpts *opts)
|
|||||||
strcmp(opts->encode_output.vcodec, codec->name) != 0)
|
strcmp(opts->encode_output.vcodec, codec->name) != 0)
|
||||||
continue;
|
continue;
|
||||||
if (codec->priv_class) {
|
if (codec->priv_class) {
|
||||||
mp_msg(MSGT_ENCODE, MSGL_INFO, "Additionally, for -ovc %s:\n",
|
mp_msg(MSGT_ENCODE, MSGL_INFO, "Additionally, for --ovc=%s:\n",
|
||||||
codec->name);
|
codec->name);
|
||||||
encode_lavc_printoptions(
|
encode_lavc_printoptions(
|
||||||
&codec->priv_class, " -ovcopts ",
|
&codec->priv_class, " --ovcopts=",
|
||||||
" ", NULL,
|
" ", NULL,
|
||||||
AV_OPT_FLAG_ENCODING_PARAM |
|
AV_OPT_FLAG_ENCODING_PARAM |
|
||||||
AV_OPT_FLAG_VIDEO_PARAM,
|
AV_OPT_FLAG_VIDEO_PARAM,
|
||||||
AV_OPT_FLAG_ENCODING_PARAM |
|
AV_OPT_FLAG_ENCODING_PARAM |
|
||||||
@ -930,7 +930,7 @@ bool encode_lavc_showhelp(struct MPOpts *opts)
|
|||||||
mp_msg(MSGT_ENCODE, MSGL_INFO,
|
mp_msg(MSGT_ENCODE, MSGL_INFO,
|
||||||
"Available output audio codec ctx->options:\n");
|
"Available output audio codec ctx->options:\n");
|
||||||
encode_lavc_printoptions(
|
encode_lavc_printoptions(
|
||||||
c, " -oacopts ", " ", NULL,
|
c, " --oacopts=", " ", NULL,
|
||||||
AV_OPT_FLAG_ENCODING_PARAM |
|
AV_OPT_FLAG_ENCODING_PARAM |
|
||||||
AV_OPT_FLAG_AUDIO_PARAM,
|
AV_OPT_FLAG_AUDIO_PARAM,
|
||||||
AV_OPT_FLAG_ENCODING_PARAM |
|
AV_OPT_FLAG_ENCODING_PARAM |
|
||||||
@ -945,10 +945,10 @@ bool encode_lavc_showhelp(struct MPOpts *opts)
|
|||||||
strcmp(opts->encode_output.acodec, codec->name) != 0)
|
strcmp(opts->encode_output.acodec, codec->name) != 0)
|
||||||
continue;
|
continue;
|
||||||
if (codec->priv_class) {
|
if (codec->priv_class) {
|
||||||
mp_msg(MSGT_ENCODE, MSGL_INFO, "Additionally, for -oac %s:\n",
|
mp_msg(MSGT_ENCODE, MSGL_INFO, "Additionally, for --oac=%s:\n",
|
||||||
codec->name);
|
codec->name);
|
||||||
encode_lavc_printoptions(
|
encode_lavc_printoptions(
|
||||||
&codec->priv_class, " -oacopts ",
|
&codec->priv_class, " --oacopts=",
|
||||||
" ", NULL,
|
" ", NULL,
|
||||||
AV_OPT_FLAG_ENCODING_PARAM |
|
AV_OPT_FLAG_ENCODING_PARAM |
|
||||||
AV_OPT_FLAG_AUDIO_PARAM,
|
AV_OPT_FLAG_AUDIO_PARAM,
|
||||||
@ -965,7 +965,7 @@ bool encode_lavc_showhelp(struct MPOpts *opts)
|
|||||||
continue;
|
continue;
|
||||||
if (c->type != AVMEDIA_TYPE_VIDEO)
|
if (c->type != AVMEDIA_TYPE_VIDEO)
|
||||||
continue;
|
continue;
|
||||||
mp_msg(MSGT_ENCODE, MSGL_INFO, " -ovc %-12s %s\n", c->name,
|
mp_msg(MSGT_ENCODE, MSGL_INFO, " --ovc=%-12s %s\n", c->name,
|
||||||
c->long_name ? c->long_name : "");
|
c->long_name ? c->long_name : "");
|
||||||
}
|
}
|
||||||
av_free(c);
|
av_free(c);
|
||||||
@ -978,7 +978,7 @@ bool encode_lavc_showhelp(struct MPOpts *opts)
|
|||||||
continue;
|
continue;
|
||||||
if (c->type != AVMEDIA_TYPE_AUDIO)
|
if (c->type != AVMEDIA_TYPE_AUDIO)
|
||||||
continue;
|
continue;
|
||||||
mp_msg(MSGT_ENCODE, MSGL_INFO, " -oac %-12s %s\n", c->name,
|
mp_msg(MSGT_ENCODE, MSGL_INFO, " --oac=%-12s %s\n", c->name,
|
||||||
c->long_name ? c->long_name : "");
|
c->long_name ? c->long_name : "");
|
||||||
}
|
}
|
||||||
av_free(c);
|
av_free(c);
|
||||||
|
@ -66,7 +66,7 @@ static int preinit(struct vo *vo, const char *arg)
|
|||||||
struct priv *vc;
|
struct priv *vc;
|
||||||
if (!encode_lavc_available(vo->encode_lavc_ctx)) {
|
if (!encode_lavc_available(vo->encode_lavc_ctx)) {
|
||||||
mp_msg(MSGT_ENCODE, MSGL_ERR,
|
mp_msg(MSGT_ENCODE, MSGL_ERR,
|
||||||
"vo-lavc: the option -o (output file) must be specified\n");
|
"vo-lavc: the option --o (output file) must be specified\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
vo->priv = talloc_zero(vo, struct priv);
|
vo->priv = talloc_zero(vo, struct priv);
|
||||||
@ -399,7 +399,7 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
|
|||||||
int64_t step = vc->mindeltapts ? vc->mindeltapts : 1;
|
int64_t step = vc->mindeltapts ? vc->mindeltapts : 1;
|
||||||
if (frameipts < vc->lastipts + step) {
|
if (frameipts < vc->lastipts + step) {
|
||||||
mp_msg(MSGT_ENCODE, MSGL_INFO,
|
mp_msg(MSGT_ENCODE, MSGL_INFO,
|
||||||
"vo-lavc: -oneverdrop increased pts by %d\n",
|
"vo-lavc: --oneverdrop increased pts by %d\n",
|
||||||
(int) (vc->lastipts - frameipts + step));
|
(int) (vc->lastipts - frameipts + step));
|
||||||
frameipts = vc->lastipts + step;
|
frameipts = vc->lastipts + step;
|
||||||
vc->lastpts = frameipts * timeunit - encode_lavc_getoffset(ectx, vc->stream);
|
vc->lastpts = frameipts * timeunit - encode_lavc_getoffset(ectx, vc->stream);
|
||||||
|
Loading…
Reference in New Issue
Block a user