Hi Hendrik, I had a quick test, and seems it doesn't work.
I guess that's because crf is longer a member of AVCodecContext. I'll try to set AVOptions when opening codecs. Thanks 2013/5/20 YIRAN LI <[email protected]> > Thanks Hendrik! > > And I found that member variable crf has been removed from AVCodecContext, > so I assume that unless I add that back to AVCodecConetxt, using > av_option_set is the only way to set that. > > Great thanks! > > > 2013/5/20 Hendrik Leppkes <[email protected]> > >> On Mon, May 20, 2013 at 10:23 AM, YIRAN LI <[email protected]> wrote: >> > Hi guys, >> > >> > I've downloaded latest libvpx code and built it into ffmpeg, so that my >> > application can use ffmpeg dlls. >> > >> > Vp8 encoding works correctly and my application can generate webm >> videos. >> > >> > But what I want to know is, how can I set crf when encoding? >> > >> > What I do in my application is just calling ffmpeg interface >> > 1. AVStream* pVideoStream = av_new_stream(pFormatCtx, 0); >> > 2. AVCodec* pVideoCodec = avcodec_find_encoder(AVCODE_ID_VP8) >> > 3. AVCodecContext* pVideoCodecCtx = pVideoStream->codec; >> > >> > pVideoCodexCtx->bit_rate = >> > ->rc_min_rate= >> > ->rc_max_rate= (set all these bit rate >> control >> > param) >> > >> > I checked libvpxenc.c under libavcodec and seems when initing the >> encoder, >> > it doesn't directly refer to any member >> > of AVCodecContext to set crf. >> > >> > So could anyone tell me, how to set crf when open vp8 encoder >> > programmatically? >> > >> > Great thanks! >> > >> >> This should do it: >> av_opt_set_int(pVideoCodexCtx, "crf", 10, AV_OPT_SEARCH_CHILDREN) >> _______________________________________________ >> Libav-user mailing list >> [email protected] >> http://ffmpeg.org/mailman/listinfo/libav-user >> > >
_______________________________________________ Libav-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/libav-user
