[Libav-user] how to set mjpeg encoding quality programmatically?

YIRAN LI mrfun.china at gmail.com
Thu Jun 9 01:55:34 CEST 2016


2016-06-09 9:44 GMT+10:00 YIRAN LI <mrfun.china at gmail.com>:

> Hi,
>
> I'm  using command line
>
> ffmpeg.exe -i a.mp4 -vcodec mjpeg -q:v 3 to encode my video.
>
> Could anyone tell me how to set the q:v 3 via ffmpeg API programmatically?
>
> Thanks
>

​Hi, searching the mail list and seems I found the answer.

Just need to set

AVCodecContext.flags |= CODEC_FLAG_QSCALE
and AVCodecContext.global_quality  = qscale * FF_QP2LAMBDA, in my case
qscale = 3

Please correct me if anything wrong, thanks
​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20160609/11fe8118/attachment.html>


More information about the Libav-user mailing list