I am making h264 stream analyzer and have found strange ffmpeg behaviour while writing and reading same frame packetized with MPEG-TS.
I have dumped both encoding and decoding frame data in HEX and found these differences:
At the beginning of frame there is NAL delimiter added:
+ 00
+ 00
+ 00
+ 01
+ 09
+ f0
that looks absolutely legit to me.
But here comes strange things:
If current packet is not the last one than some suffix is added (i.e. there is no this suffix in the last written frame). And this suffix is added to current read frame (i.e. this is not prefix to next frame).
+ e0
+ 00
+ 00
+ 00
+ 01
+ ce
+ 8c
+ 4d
+ 9d
+ 10
+ 8e
+ 25
+ e9
+ fe
(exactly starting with e0 byte added)
I am trying to understand what that could mean. If 00000001 is NAL header than it is followed by ce byte with forbidden zero-bit equals 1 that is absolutely broken.
I am using fork from ffmpeg github repo last merged with 89092fafdde894c6ba4d4f8e3cd1cce0d68bfc22 commit.
ffmpeg is built with --disable-everything --enable-encoder=libopenh264 --enable-muxer=mpegts --enable-demuxer=mpegts --enable-protocol=file --enable-parser=h264 --enable-decoder=libopenh264 --enable-shared --disable-static --disable-programs --disable-doc --enable-libopenh264 options
00 00 00 01 cesequence is not present in the file you posted. - szatmary