Hi, I've solved this problem by setting codecCtx->flags |= CODEC_FLAG_QSCALE; and set codecCtx->global_quality = 1180 to get the best quality!
because in libtheoraenc.c line 215: t_info.quality = av_clip(avc_context->global_quality /(float)FF_QP2LAMBDA, 0, 10) * 6.3 and #define FF_QP2LAMBDA 118 so av_clip( 1180/118, 0, 10 ) * 6.3 = 63 get the best quality. Please correct me if I'm wrong, thanks! ---------- Forwarded message ---------- From: YIRAN LI <[email protected]> Date: 2013/5/15 Subject: How to set video quality when opening encoder To: "This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter." <[email protected]> Hi friends, 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. My code looks like below: AVDictionary* options = NULL; av_dict_set(&options, "qscale", "0", 0); // also tried "q:v" avcodec_open() but seems encoder can't understand the keys. Could anyone let me know how to set the video qscale in this case? Great thanks
_______________________________________________ Libav-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/libav-user
