[FFmpeg-cvslog] libavcodec/qsvenc.c: Set mjpeg height and width alignment

JonCookCubic git at videolan.org
Tue Feb 18 04:32:13 EET 2020


ffmpeg | branch: master | JonCookCubic <jon.cook at cubicmotion.com> | Tue Jan 21 13:06:43 2020 +0000| [566de255992a0727aa0cbafb08b366e36ea2adc9] | committer: Zhong Li

libavcodec/qsvenc.c: Set mjpeg height and width alignment

Currently width_align and height_align are zero when encoding with mjpeg_qsv,
which causes "Error submitting the frame for encoding". This patch sets the alignments.

There is a little bit more about the problem here http://ffmpeg.org/pipermail/ffmpeg-user/2019-November/046143.html

Signed-off-by: JonCookCubic <jon.cook at cubicmotion.com>
Signed-off-by: Zhong Li <zhongli_dev at 126.com>

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

 libavcodec/qsvenc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 9e416500e9..40904af388 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -470,6 +470,12 @@ static int init_video_param_jpeg(AVCodecContext *avctx, QSVEncContext *q)
     q->param.mfx.Quality              = av_clip(avctx->global_quality, 1, 100);
     q->param.mfx.RestartInterval      = 0;
 
+    q->width_align = 16;
+    q->height_align = 16;
+
+    q->param.mfx.FrameInfo.Width = FFALIGN(avctx->width, q->width_align);
+    q->param.mfx.FrameInfo.Height = FFALIGN(avctx->height, q->height_align);
+
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list