Adding NAL headers to raw H264 stream

痴心易碎 提交于 2019-12-25 10:55:26

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!