[FFmpeg-devel] [PATCH 2/3] avcodec/libx264:setting profile and level in avcodec context

Jeyapal, Karthick kjeyapal at akamai.com
Thu Nov 23 13:47:41 EET 2017


On 11/23/17, 4:21 PM, "Carl Eugen Hoyos" <ceffmpeg at gmail.com> wrote:

>2017-11-23 4:37 GMT+01:00  <vdixit at akamai.com>:
>
>> +    s = x264_encoder_headers(x4->enc, &nal, &nnal);
>> +    if (avctx->profile == FF_PROFILE_UNKNOWN)
>> +        avctx->profile = nal->p_payload[5];
>> +    if (avctx->level == FF_LEVEL_UNKNOWN)
>> +        avctx->level = nal->p_payload[7];
>
>Why are these conditional?
We didn’t want to overwrite profile and level, if user had already set it.
Comments in avcodec.h mentioned, ‘encoding: Set by user’, for profile and level.
>
>(Do we really guarantee that our profile and level
>fields contain the exact same values as the nal
>payload?)
There is no guarantee. 
But instead of unknown profile and level, setting profile and level whenever possible could enhance feature-set of certain muxers, like hlsenc.
>
>Carl Eugen

regards,
Karthick




More information about the ffmpeg-devel mailing list