<div dir="ltr">Hi,<div><br></div><div>I've solved this problem by setting codecCtx->flags |= CODEC_FLAG_QSCALE;</div><div>and set codecCtx->global_quality = 1180 to get the best quality!</div><div><br></div><div>
because in libtheoraenc.c line 215: t_info.quality = av_clip(avc_context->global_quality /(float)FF_QP2LAMBDA, 0, 10) * 6.3</div><div style>and #define FF_QP2LAMBDA 118</div><div style><br></div><div style>so av_clip( 1180/118, 0, 10 ) * 6.3 = 63 get the best quality.</div>
<div style><br></div><div style>Please correct me if I'm wrong, thanks!</div><div><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">YIRAN LI</b> <span dir="ltr"><<a href="mailto:mrfun.china@gmail.com">mrfun.china@gmail.com</a>></span><br>
Date: 2013/5/15<br>Subject: How to set video quality when opening encoder<br>To: "This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter." <<a href="mailto:libav-user@ffmpeg.org">libav-user@ffmpeg.org</a>><br>
<br><br><div dir="ltr">Hi friends,<div><br></div><div>I'm trying to encode using libtheora, I'm able to using command line argument -q:v 0-10 to set video quality. But I had problem when setting it in my program.</div>
<div>
<br></div><div>My code looks like below:</div><div><br></div><div>AVDictionary* options = NULL;</div><div>av_dict_set(&options, "qscale", "0", 0); // also tried "q:v"</div>
<div>avcodec_open() </div><div><br></div><div>but seems encoder can't understand the keys.</div><div><br></div><div>Could anyone let me know how to set the video qscale in this case?</div>
<div><br></div><div>Great thanks</div></div>
</div><br></div></div>