[FFmpeg-cvslog] avconv: pass the hw context from filters to the encoder

Anton Khirnov git at videolan.org
Wed Feb 24 18:18:02 CET 2016


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Tue Feb  2 10:38:58 2016 +0100| [c15f6098b1b25689dd5e86aeb5ce69bc12efe1e1] | committer: Anton Khirnov

avconv: pass the hw context from filters to the encoder

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c15f6098b1b25689dd5e86aeb5ce69bc12efe1e1
---

 avconv.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/avconv.c b/avconv.c
index 6b37d6e..a84a345 100644
--- a/avconv.c
+++ b/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))
             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 == AVERROR_EXPERIMENTAL)
                 abort_codec_experimental(codec, 1);



More information about the ffmpeg-cvslog mailing list