We have a device that creates video files in MP4 file format containing H.264 video data.
Now we notice that within the first AVCC chunk, after the SPS there are 4 null-bytes (00 00 00 00). (I know that the SPS is technically not needed in the video data, but not disallowed either) Within the stsd header, in the AVCConfigurationBox, we also see these extra null bytes.
The question is: are these technically allowed by the standard? We have some python code checking this and complaining. So do we need to change the code in the device, or the checking code?
In an Annex-B byte-stream, they would be allowed, but not here, I think.
They can't be part of a NALU, or they should have been emulation-prevented into 00 00 03 00 00.
ffmpeg and vlc don't complain in the least about it, but they might just be more robust in order to allow as much video files to be played as possible.
It turned out some part of the code was doing 64-bit alignment for some unneeded legacy reasons, before passing it on to the ffmpeg libs.
So the null-bytes did not belong there, and were certainly not part of the SPS