What does Elementary Stream mean in Terms of H264

让人想犯罪 __ 提交于 2019-12-03 21:12:11
Ralf

If you're using ffmpeg you could use something similar to the following:

ffmpeg -f video4linux2 -s 320x240 -i /dev/video0 -vcodec libx264 -f h264 test.264   

You'll have to adapt the command line for the file type you're exporting the video from. This generates a file containing H.264 access units where each access unit consists of one or more NAL units with each NAL unit prefixed with a start code (0001 or 001). You can open the file using a hex editor to take a look at it.

You can also create an H.264 elementary stream file (.264) by using the the H.264 reference encoder from raw YUV input files.

If you copy the generated .264 file into the live555 testOnDemandRTSPServer directory, you can test streaming the file over RTSP/RTP.

Can you give some references to read more about NAL / H.264 elementary Stream. How can I quickly check if the stream is an elementary stream?

Generally anything in a container (avi or mp4) is not an elementary stream. The typical extension used for elementary streams is ".264". The quickest way to double check that a file is an elementary stream is to open the file in a hex editor and look for a start code at the beginning of the file (00000001). Note that there should be 3 (000001) and 4 (00000001) byte start codes through out the file (before every NAL unit)

Why does live555 not play h264 streams which are not elementary?

This is purely if live555 has not implemented the required demux (e.g. avi or mp4). AFAIK live555 does support demuxing H.264 from the matroska container.

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