<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
I need to encode images into an mkv container file using the h264<br>
codec. I would like to set codec-specific options such as '-crf'<br>
but I don't know how to do it. So far I have found/considered several<br>
ways:<br>
<br></blockquote></div><div><br></div><div>Before you call avcodec_open2 set the property by calling the</div><div> </div><div>     av_opt_set_double(enc_ctx->priv_data, "crf", 23.0, 0);<br></div><div><br></div><div>Some of the options need to be set on the "priv_data", ones that are </div><div>codec related, others can be set directly to the enc_ctx </div><div><br></div><div>     av_opt_set_int(enc_ctx, "sc_threshold", 1, 0);<br></div><div><br></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><br>Regards<br>Strahinja Radman</div></div>