<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif"><span style="font-family:arial,sans-serif">2016-06-09 9:44 GMT+10:00 YIRAN LI </span><span dir="ltr" style="font-family:arial,sans-serif"><<a href="mailto:mrfun.china@gmail.com" target="_blank">mrfun.china@gmail.com</a>></span><span style="font-family:arial,sans-serif">:</span><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:georgia,serif">Hi,</div><div style="font-family:georgia,serif"><br></div><div style="font-family:georgia,serif">I'm using command line</div><div style="font-family:georgia,serif"><br></div><div style="font-family:georgia,serif">ffmpeg.exe -i a.mp4 -vcodec mjpeg -q:v 3 to encode my video.</div><div style="font-family:georgia,serif"><br></div><div style="font-family:georgia,serif">Could anyone tell me how to set the q:v 3 via ffmpeg API programmatically?</div><div style="font-family:georgia,serif"><br></div><div style="font-family:georgia,serif">Thanks</div></div>
</blockquote></div><br></div><div class="gmail_extra"><div class="gmail_default" style="font-family:georgia,serif">Hi, searching the mail list and seems I found the answer.</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif">Just need to set</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif"><div class="gmail_default">AVCodecContext.flags |= CODEC_FLAG_QSCALE</div><div class="gmail_default">and AVCodecContext.global_quality = qscale * FF_QP2LAMBDA, in my case qscale = 3</div><div class="gmail_default"><br></div><div class="gmail_default">Please correct me if anything wrong, thanks</div></div><div class="gmail_default" style="font-family:georgia,serif"></div><br></div></div>