-
Notifications
You must be signed in to change notification settings - Fork 163
Solve HEVC Buffer Overflow Bug #94
Conversation
Currently, buffer overflow is not avoided in all cases, i.e. nextNal can have end buffer value instead of start of next nal value. This results in the AUD NAL not being always at the begining of a PES packet. This patch solves this by ensuring that when nextNal == bufEnd, data is always added to buffer.
|
Has this been tested with very large files? I think a good test would be to get "Samsung 7 Wonders Of The World 4K Demo" in HEVC format and check the mediainfo for the before and after files. |
|
@justdan96 thanks for pointing me to "Samsung 7 Wonders Of The World 4K Demo.ts" : actually many frame VCL Nals are followed by FD_NUT (filler data) Nals, which only use is to keep a constant bitrate. The presence of these Nals is not covered by tsMuxer. So yes, I will have to complete the patch to take into account the filler data Nals. Please put the patch as "wip". |
|
No problem, we really need to come up with a proper test suite at some point, to make sure we are covering all example cases. |
Currently tsMuxer does not detect suffix nals (non VCL nals placed after the VCL nals in the nal unit). Therefore these nals are placed first in the TS PES, before the AUD or next frame nal. This patch fixes the above.
Currently tsMuxer does not detect suffix nals (non VCL nals placed after the VCL nals in the nal unit). Therefore these nals are placed first in the TS PES, before the AUD or next frame nal. This patch fixes the above.
Currently tsMuxer does not detect suffix nals (non VCL nals placed after the VCL nals in the nal unit). Therefore these nals are placed first in the TS PES, before the AUD or next frame nal. This patch fixes the above.
|
@justdan96 I have tested this fix with several m2ts (Blu-rays and others), it is working well and ready to be merged. This solves the BD-ROM Part3 Verifier errors HEVC0112 and HEVC0115: Note that when muxing hevc files to Blu-ray which do not have any AUD nal, indeed there won't be any AUD at the beginning of the GOP. Adding AUD nals when not present should be addressed later. |
Currently, buffer overflow is not avoided in all cases, i.e. nextNal can have end buffer value instead of start of next nal value.
This results in the AUD NAL not being always at the begining of a PES packet.
This patch solves this by ensuring that when nextNal == bufEnd, data is always added to buffer.