Thank you for the quick reply.

If I understand correctly, the AVCodecContext is instantiated separately from 
the FormatContext and Streams.
So what I have to do is:

1- Instanciate the codec context and configure it as you suggested
2- Instanciate an AVFormatContext
3- Add a stream without codec using avformat_new_stream(fmt_ctx, NULL)
4- set stream id and update codecpar using avcodec_parameters_from_context
5- generate the format header with avformat_write_header
6- proceed to the frame encoding loop

right?

Le jeudi 13 février 2020 à 11:07 +0100, Strahinja Radman a écrit :
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);


_______________________________________________
Libav-user mailing list
[email protected]<mailto:[email protected]>
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[email protected]<mailto:[email protected]> with 
subject "unsubscribe".
_______________________________________________
Libav-user mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to