问题
In order to add NAL headers to a raw H264 stream, what do I need to do? Ultimately, I want to take the video file and mux it with an audio file.
2 related questions:
1.) I've looked at this post: H.264 conversion with FFmpeg (from a RTP stream)
However, when I look at the first two bytes of each frame, I'm seeing 0 and 0 for any frame I record, which doesn't say anything about the NAL contents.
Am I looking at the right place? Is there another way I can create and write in NAL headers to a H264 stream?
2.) Also, does the NAl header contain any timing information? How could I sync it with the audio?
Thanks!
回答1:
I have no idea what you mean when you say NAL headers. However, your stream is most likely in annexb format. In annexB format each NALU is preceded with a start code. Usually it is a 3 (0x000001) or 4 (0x00000001) byte startcode. Simply skip past these bytes.
来源:https://stackoverflow.com/questions/17324086/adding-nal-headers-to-raw-h264-stream