本文验证下面的帖子
http://www.mentby.com/Group/ffmpeg-user/h264-byte-patterns-format.html
内容为
The h.264 standard is complicated, so the simple algorithm you imply
with this question will almost never work.
The first problem you will face is that there are two different binary
formats defined by the standard: mpeg4 (also called atom), and Annex B.
You somehow need to figure out (or be told) which type of stream you are
receiving.
Then you need to know if your SPS and PPS are in-band or out-of-band. If
they are out-of-band you need to obtain them.
Once you have these things, the rules for finding start-of-frame are
*also* complicated (and are described in the standard.)
For Annex B format, ffmpeg already implements these rules in the
h264