[Libav-user] Idiomatic way to set encoding codec options for a stream

Strahinja Radman dr.strashni at gmail.com
Thu Feb 13 12:07:15 EET 2020


>
>
> I need to encode images into an mkv container file using the h264
> codec. I would like to set codec-specific options such as '-crf'
> but I don't know how to do it. So far I have found/considered several
> ways:
>
>
Before you call avcodec_open2 set the property by calling the

     av_opt_set_double(enc_ctx->priv_data, "crf", 23.0, 0);

Some of the options need to be set on the "priv_data", ones that are
codec related, others can be set directly to the enc_ctx

     av_opt_set_int(enc_ctx, "sc_threshold", 1, 0);


-- 

Regards
Strahinja Radman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20200213/a1d68243/attachment.html>


More information about the Libav-user mailing list