[vlc-commits] avcodec: define coded_width/height on encoding

Ilkka Ollakka git at videolan.org
Tue Feb 12 08:51:05 CET 2019


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Mon Feb 11 10:49:37 2019 +0200| [935869641cab5be6869345b7d9258d761bebf937] | committer: Ilkka Ollakka

avcodec: define coded_width/height on encoding

With this change, transcoding to multiple outputs with intermediate encode works.

Example sout-chain used to test:
--sout="#transcode{vcodec=I420,deinterlace}:duplicate{dst={transcode{vcodec=h264,vfilter=canvas{width=640,height=320}}},dst={transcode{vcodec=h264,vfilter=canvas{width=320,height=240}}}}:file{dst=test_output.ts}"

Without this change, rawvideo codec will complain about invalid frame size.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=935869641cab5be6869345b7d9258d761bebf937
---

 modules/codec/avcodec/encoder.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index 2b824d0af3..2f8e2d8a14 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -500,6 +500,8 @@ int InitVideoEnc( vlc_object_t *p_this )
 
         p_context->codec_type = AVMEDIA_TYPE_VIDEO;
 
+        p_context->coded_width = p_enc->fmt_in.video.i_width;
+        p_context->coded_height = p_enc->fmt_in.video.i_height;
         p_context->width = p_enc->fmt_in.video.i_visible_width;
         p_context->height = p_enc->fmt_in.video.i_visible_height;
 



More information about the vlc-commits mailing list