Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Remove "zero byte stuffing" filler bytes from MPEG2-ES #734
Original reporter: Basic.Master
(a request especially regarding digital television via DVB:)
mkvmerge already has support for removing filler bytes from H.264 streams. The MPEG2 specification implicit also allows a kind of filler bytes called "zero byte stuffing". This means that after a block finished, it is possible to insert any amount of null bytes until the next startcode comes along in the stream.
I will upload two samples to the FTP server, with the prefix "mpeg2_zero_stuffing". You will find that null byte blocks everytime before the beginning of a new picture.
Here is also a thread I start in a german digital television board regarding that topic, with bitrate diagram comparison regarding a whole movie:
If that feature seems to be helpful for mkvmerge, I could try to make a patch; alternatively I could provide the source code of my tiny program that fulfils this single task. Or both.
[BTW to ease communication, I also speak german as my first language]
referenced this issue
Jan 24, 2015
added a commit
Jul 15, 2017
The sample file I have gets broken by my code because too many 0 bytes are removed from the end of a slice. The same file shows the same corruption with the removal code you yourself had provided way back when it was implemented. Removing 0 bytes from the end that way is simply broken. That it works most of the time is nice and all, but that doesn't make it any more correct.