[FFmpeg-devel] [PATCH]lavc/avcodec: Allow libavcodec to overwrite profile and level

Jeyapal, Karthick kjeyapal at akamai.com
Fri Nov 24 04:54:41 EET 2017



On 11/24/17, 5:17 AM, "Carl Eugen Hoyos" <ceffmpeg at gmail.com> wrote:

>2017-11-23 22:58 GMT+01:00 Michael Niedermayer <michael at niedermayer.cc>:
>> On Thu, Nov 23, 2017 at 04:01:06PM +0100, Carl Eugen Hoyos wrote:
>>> Hi!
>>>
>>> The (external) encoders may overwrite level and profile because of
>>> requested encoding properties, allowing libavcodec to (also) overwrite
>>> them in the context makes sense (and is already done in some cases
>>> afaict).
>>>
>>> Please comment, Carl Eugen
>>
>> If a user needs to generate a file with a specific profile/level
>> for example because its for broadcast, some specification or a hw
>> decoder.
>> How could he after this patch ensure that exactly the needed profile
>> is used?
There is no way of ensuring the same even without this patch.

>Afair, x264 does change profile and / or level depending on properties
>set by the user. Currently there is no way for the libavcodec user to
>know that libx264 changed something.
>With this change the user can know that he does not get the
>requested values.
>
>Or am I wrong and libx264 never overwrites requested values
>for level and / or profile?
>

I just tested x264 by giving contradicting profiles and levels. 
Following are the results:
Case 1:
Input : 1080p30, 420p
Config : Set level wrongly to 1.1
Output : Throws some warnings, but level is still written wrongly as 1.1 is the SPS header.
Impact of overwrite : None. Both the user set value and header’s value are same.

Case 2:1080p30, 422p
Config : Set profile wrongly to baseline
Output : Throws errors, doesn’t encode
Impact of overwrite : None. 

Case 3:1080p30, 420p
Config : Set profile wrongly to high422
Output : No warnings or errors. Automatically switches to high profile. SPS header also has high profile.
Impact of overwrite : User will get to know the correct profile being encoded.

Regards,
Karthick





More information about the ffmpeg-devel mailing list