mirror of https://git.ffmpeg.org/ffmpeg.git
avconv: pass the hw context from filters to the encoder
This commit is contained in:
parent
871d0930d4
commit
c15f6098b1
6
avconv.c
6
avconv.c
|
@ -1581,6 +1581,12 @@ static int init_output_stream(OutputStream *ost, char *error, int error_len)
|
||||||
if (!av_dict_get(ost->encoder_opts, "threads", NULL, 0))
|
if (!av_dict_get(ost->encoder_opts, "threads", NULL, 0))
|
||||||
av_dict_set(&ost->encoder_opts, "threads", "auto", 0);
|
av_dict_set(&ost->encoder_opts, "threads", "auto", 0);
|
||||||
|
|
||||||
|
if (ost->filter && ost->filter->filter->inputs[0]->hw_frames_ctx) {
|
||||||
|
ost->enc_ctx->hw_frames_ctx = av_buffer_ref(ost->filter->filter->inputs[0]->hw_frames_ctx);
|
||||||
|
if (!ost->enc_ctx->hw_frames_ctx)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
|
}
|
||||||
|
|
||||||
if ((ret = avcodec_open2(ost->enc_ctx, codec, &ost->encoder_opts)) < 0) {
|
if ((ret = avcodec_open2(ost->enc_ctx, codec, &ost->encoder_opts)) < 0) {
|
||||||
if (ret == AVERROR_EXPERIMENTAL)
|
if (ret == AVERROR_EXPERIMENTAL)
|
||||||
abort_codec_experimental(codec, 1);
|
abort_codec_experimental(codec, 1);
|
||||||
|
|
Loading…
Reference in New Issue