Merge commit '9580818c5d934bde65a95efd2cee61c174721092'
* commit '9580818c5d934bde65a95efd2cee61c174721092': avconv: rename OutputStream.opts to OutputStream.encoder_opts Conflicts: ffmpeg.c ffmpeg.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
d5ec1ddf7b
14
ffmpeg.c
14
ffmpeg.c
@ -2716,7 +2716,7 @@ static int transcode_init(void)
|
|||||||
DEFAULT_PASS_LOGFILENAME_PREFIX,
|
DEFAULT_PASS_LOGFILENAME_PREFIX,
|
||||||
i);
|
i);
|
||||||
if (!strcmp(ost->enc->name, "libx264")) {
|
if (!strcmp(ost->enc->name, "libx264")) {
|
||||||
av_dict_set(&ost->opts, "stats", logfilename, AV_DICT_DONT_OVERWRITE);
|
av_dict_set(&ost->encoder_opts, "stats", logfilename, AV_DICT_DONT_OVERWRITE);
|
||||||
} else {
|
} else {
|
||||||
if (enc_ctx->flags & CODEC_FLAG_PASS2) {
|
if (enc_ctx->flags & CODEC_FLAG_PASS2) {
|
||||||
char *logbuffer;
|
char *logbuffer;
|
||||||
@ -2761,9 +2761,9 @@ static int transcode_init(void)
|
|||||||
memcpy(ost->st->codec->subtitle_header, dec->subtitle_header, dec->subtitle_header_size);
|
memcpy(ost->st->codec->subtitle_header, dec->subtitle_header, dec->subtitle_header_size);
|
||||||
ost->st->codec->subtitle_header_size = dec->subtitle_header_size;
|
ost->st->codec->subtitle_header_size = dec->subtitle_header_size;
|
||||||
}
|
}
|
||||||
if (!av_dict_get(ost->opts, "threads", NULL, 0))
|
if (!av_dict_get(ost->encoder_opts, "threads", NULL, 0))
|
||||||
av_dict_set(&ost->opts, "threads", "auto", 0);
|
av_dict_set(&ost->encoder_opts, "threads", "auto", 0);
|
||||||
if ((ret = avcodec_open2(ost->st->codec, codec, &ost->opts)) < 0) {
|
if ((ret = avcodec_open2(ost->st->codec, codec, &ost->encoder_opts)) < 0) {
|
||||||
if (ret == AVERROR_EXPERIMENTAL)
|
if (ret == AVERROR_EXPERIMENTAL)
|
||||||
abort_codec_experimental(codec, 1);
|
abort_codec_experimental(codec, 1);
|
||||||
snprintf(error, sizeof(error), "Error while opening encoder for output stream #%d:%d - maybe incorrect parameters such as bit_rate, rate, width or height",
|
snprintf(error, sizeof(error), "Error while opening encoder for output stream #%d:%d - maybe incorrect parameters such as bit_rate, rate, width or height",
|
||||||
@ -2774,12 +2774,12 @@ static int transcode_init(void)
|
|||||||
!(ost->enc->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE))
|
!(ost->enc->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE))
|
||||||
av_buffersink_set_frame_size(ost->filter->filter,
|
av_buffersink_set_frame_size(ost->filter->filter,
|
||||||
ost->st->codec->frame_size);
|
ost->st->codec->frame_size);
|
||||||
assert_avoptions(ost->opts);
|
assert_avoptions(ost->encoder_opts);
|
||||||
if (ost->st->codec->bit_rate && ost->st->codec->bit_rate < 1000)
|
if (ost->st->codec->bit_rate && ost->st->codec->bit_rate < 1000)
|
||||||
av_log(NULL, AV_LOG_WARNING, "The bitrate parameter is set too low."
|
av_log(NULL, AV_LOG_WARNING, "The bitrate parameter is set too low."
|
||||||
" It takes bits/s as argument, not kbits/s\n");
|
" It takes bits/s as argument, not kbits/s\n");
|
||||||
} else {
|
} else {
|
||||||
av_opt_set_dict(ost->st->codec, &ost->opts);
|
av_opt_set_dict(ost->st->codec, &ost->encoder_opts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3646,7 +3646,7 @@ static int transcode(void)
|
|||||||
av_freep(&ost->st->codec->subtitle_header);
|
av_freep(&ost->st->codec->subtitle_header);
|
||||||
av_freep(&ost->forced_kf_pts);
|
av_freep(&ost->forced_kf_pts);
|
||||||
av_freep(&ost->apad);
|
av_freep(&ost->apad);
|
||||||
av_dict_free(&ost->opts);
|
av_dict_free(&ost->encoder_opts);
|
||||||
av_dict_free(&ost->swr_opts);
|
av_dict_free(&ost->swr_opts);
|
||||||
av_dict_free(&ost->resample_opts);
|
av_dict_free(&ost->resample_opts);
|
||||||
}
|
}
|
||||||
|
2
ffmpeg.h
2
ffmpeg.h
@ -410,7 +410,7 @@ typedef struct OutputStream {
|
|||||||
char *filters_script; ///< filtergraph script associated to the -filter_script option
|
char *filters_script; ///< filtergraph script associated to the -filter_script option
|
||||||
|
|
||||||
int64_t sws_flags;
|
int64_t sws_flags;
|
||||||
AVDictionary *opts;
|
AVDictionary *encoder_opts;
|
||||||
AVDictionary *swr_opts;
|
AVDictionary *swr_opts;
|
||||||
AVDictionary *resample_opts;
|
AVDictionary *resample_opts;
|
||||||
char *apad;
|
char *apad;
|
||||||
|
@ -99,7 +99,7 @@ void choose_sample_fmt(AVStream *st, AVCodec *codec)
|
|||||||
|
|
||||||
static char *choose_pix_fmts(OutputStream *ost)
|
static char *choose_pix_fmts(OutputStream *ost)
|
||||||
{
|
{
|
||||||
AVDictionaryEntry *strict_dict = av_dict_get(ost->opts, "strict", NULL, 0);
|
AVDictionaryEntry *strict_dict = av_dict_get(ost->encoder_opts, "strict", NULL, 0);
|
||||||
if (strict_dict)
|
if (strict_dict)
|
||||||
// used by choose_pixel_fmt() and below
|
// used by choose_pixel_fmt() and below
|
||||||
av_opt_set(ost->st->codec, "strict", strict_dict->value, 0);
|
av_opt_set(ost->st->codec, "strict", strict_dict->value, 0);
|
||||||
@ -874,7 +874,7 @@ int configure_filtergraph(FilterGraph *fg)
|
|||||||
args[strlen(args) - 1] = '\0';
|
args[strlen(args) - 1] = '\0';
|
||||||
fg->graph->resample_lavr_opts = av_strdup(args);
|
fg->graph->resample_lavr_opts = av_strdup(args);
|
||||||
|
|
||||||
e = av_dict_get(ost->opts, "threads", NULL, 0);
|
e = av_dict_get(ost->encoder_opts, "threads", NULL, 0);
|
||||||
if (e)
|
if (e)
|
||||||
av_opt_set(fg->graph, "threads", e->value, 0);
|
av_opt_set(fg->graph, "threads", e->value, 0);
|
||||||
}
|
}
|
||||||
|
12
ffmpeg_opt.c
12
ffmpeg_opt.c
@ -1054,7 +1054,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
|
|||||||
AVIOContext *s = NULL;
|
AVIOContext *s = NULL;
|
||||||
char *buf = NULL, *arg = NULL, *preset = NULL;
|
char *buf = NULL, *arg = NULL, *preset = NULL;
|
||||||
|
|
||||||
ost->opts = filter_codec_opts(o->g->codec_opts, ost->enc->id, oc, st, ost->enc);
|
ost->encoder_opts = filter_codec_opts(o->g->codec_opts, ost->enc->id, oc, st, ost->enc);
|
||||||
|
|
||||||
MATCH_PER_STREAM_OPT(presets, str, preset, oc, st);
|
MATCH_PER_STREAM_OPT(presets, str, preset, oc, st);
|
||||||
if (preset && (!(ret = get_preset_file_2(preset, ost->enc->name, &s)))) {
|
if (preset && (!(ret = get_preset_file_2(preset, ost->enc->name, &s)))) {
|
||||||
@ -1069,7 +1069,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
|
|||||||
exit_program(1);
|
exit_program(1);
|
||||||
}
|
}
|
||||||
*arg++ = 0;
|
*arg++ = 0;
|
||||||
av_dict_set(&ost->opts, buf, arg, AV_DICT_DONT_OVERWRITE);
|
av_dict_set(&ost->encoder_opts, buf, arg, AV_DICT_DONT_OVERWRITE);
|
||||||
av_free(buf);
|
av_free(buf);
|
||||||
} while (!s->eof_reached);
|
} while (!s->eof_reached);
|
||||||
avio_close(s);
|
avio_close(s);
|
||||||
@ -1081,7 +1081,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
|
|||||||
exit_program(1);
|
exit_program(1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ost->opts = filter_codec_opts(o->g->codec_opts, AV_CODEC_ID_NONE, oc, st, NULL);
|
ost->encoder_opts = filter_codec_opts(o->g->codec_opts, AV_CODEC_ID_NONE, oc, st, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
avcodec_get_context_defaults3(st->codec, ost->enc);
|
avcodec_get_context_defaults3(st->codec, ost->enc);
|
||||||
@ -1357,11 +1357,11 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
|
|||||||
if (do_pass) {
|
if (do_pass) {
|
||||||
if (do_pass & 1) {
|
if (do_pass & 1) {
|
||||||
video_enc->flags |= CODEC_FLAG_PASS1;
|
video_enc->flags |= CODEC_FLAG_PASS1;
|
||||||
av_dict_set(&ost->opts, "flags", "+pass1", AV_DICT_APPEND);
|
av_dict_set(&ost->encoder_opts, "flags", "+pass1", AV_DICT_APPEND);
|
||||||
}
|
}
|
||||||
if (do_pass & 2) {
|
if (do_pass & 2) {
|
||||||
video_enc->flags |= CODEC_FLAG_PASS2;
|
video_enc->flags |= CODEC_FLAG_PASS2;
|
||||||
av_dict_set(&ost->opts, "flags", "+pass2", AV_DICT_APPEND);
|
av_dict_set(&ost->encoder_opts, "flags", "+pass2", AV_DICT_APPEND);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1952,7 +1952,7 @@ loop_end:
|
|||||||
unused_opts = strip_specifiers(o->g->codec_opts);
|
unused_opts = strip_specifiers(o->g->codec_opts);
|
||||||
for (i = of->ost_index; i < nb_output_streams; i++) {
|
for (i = of->ost_index; i < nb_output_streams; i++) {
|
||||||
e = NULL;
|
e = NULL;
|
||||||
while ((e = av_dict_get(output_streams[i]->opts, "", e,
|
while ((e = av_dict_get(output_streams[i]->encoder_opts, "", e,
|
||||||
AV_DICT_IGNORE_SUFFIX)))
|
AV_DICT_IGNORE_SUFFIX)))
|
||||||
av_dict_set(&unused_opts, e->key, NULL, 0);
|
av_dict_set(&unused_opts, e->key, NULL, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user