[FFmpeg-devel] [PATCH] nvenc: Make AUD optional for h264_nvenc and hevc_nvenc

Mark Thompson sw at jkqxz.net
Fri Dec 30 16:29:33 EET 2016


On 30/12/16 11:00, Ali KIZIL wrote:
> 2016-12-30 12:07 GMT+03:00 Miroslav Slugeň <thunder.m at email.cz>:
> 
>> Dne 30.12.2016 v 05:48 Ali KIZIL napsal(a):
>>
>>> 2016-12-30 0:02 GMT+03:00 Miroslav Slugeň <thunder.m at email.cz>:
>>>
>>>
>>> Somebody changed AUD to active in NVENC by default, which is not very
>>>> clever, libx264 also has this future disabled, so we should stay in sync
>>>> with libx264 behavior.
>>>>
>>>> Enabled AUD will work only without B-frames. There is BUG in Nvidia NVENC
>>>> when you use AUD for H264 with B-frames, it will return corrupted stream,
>>>> because NVIDIA is inserting AUD type 0 (I-frame) before B-frames instead
>>>> of
>>>> AUD type 7 (any-frame).
>>>>
>>>> H264 encoded with B-frames and AUD active will not play for example on
>>>> Panasonic TX-AS640E, other decoders just ignore wrong AUD type.
>>>>
>>>>
>>>> --
>>>> Miroslav Slugeň
>>>>
>>>>
>>>> AUD set to active by default was for LG and Sony like UHD TVs which could
>>> not decode NVENC encoded HEVC MPEGTS properly.
>>> If patch sets AUD active by default if there is no B-Frames (as so in
>>> NVENC
>>> HEVC encoding), patch will be ok in common.
>>>
>>> I checked how libx264 and libx265 works
>>
>> For libx265 default is off:
>>
>> void x265_param_default(x265_param* param) {
>> param->bEnableAccessUnitDelimiters = 0;
>> }
>>
>> Only for UHD BLURAY is on:
>>
>> if (p->uhdBluray) {
>> p->bEnableAccessUnitDelimiters = 1;
>> }
>>
>> For libx264 default is off:
>>
>> void x264_param_default( x264_param_t *param ) {
>> param->b_aud = 0;
>> }
>>
>> Only for BLURAY and AVC-Intra compat
>>
>> if( h->param.b_bluray_compat ) {
>> h->param.b_aud = 1;
>> }
>>
>> /* 200,100,50 */
>> if( h->param.i_avcintra_class ) {
>> h->param.b_aud = 1;
>> }
>>
>> So how we should implement this to NVENC? :)
>>
>> I still think we should default AUD to off and set in on only in special
>> cases like BLURAY and AVC-Intra.
>>
> 
> From my opinion, we can set AUD on by default for HEVC as there is no
> B-Frames. When AUD is on at HEVC, I checked many TVs (Samsung, LG, Sony,
> Philips etc.) all look OK.
> It will be better to hear comments from others as well.

Wouldn't that then revisit the same problem with some future implementation which adds support for B frames in H.265?  (I assume that's an implementation omission, not an API one.)

To my mind AUDs are a niche feature which should not be enabled by default unless specifically requested (hence the code in x26[45] enabling it only for bluray encodes, which do require them).  If some broken decoders are unable to function without them that is unfortunate, but not really ffmpeg's problem (and the workaround is known for anyone encountering it).

Therefore, I agree with the original patch.

Thanks,

- Mark


More information about the ffmpeg-devel mailing list