I read what an Elementary Stream is on Wikipedia. A tool i am using "Live555" is demanding "H.264 Video Elementary Stream File". So when exporting a Video from a Video Application, do i have to choose specific preferences to generate a "Elementery Stream" ?
1 Answers
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.

- 2,076
- 4
- 25
- 46

- 9,405
- 2
- 28
- 46
-
I am on Windows, und downloaded the live555 binary. After converting the file with ffmpeg as you stated, i still cannot connect. I can play mp3 files, so connection is there. – user1767754 Nov 23 '14 at 21:24
-
Does "you cannot connect" mean you get an RTSP error code e.g. 404 or that you can't connect to the RTSP server i.e. socket issue? Things to check: Did you put the .264 in the same dir as testOnDemandRTSPServer? Is it named "test.264" and did you try to access it using the "rtsp://x.x.x.x:8554/h264ESVideoTest" URI? Note that the default port used by that app is 8554 instead of 554. Also, you can check the validity of the .264 file. – Ralf Nov 23 '14 at 21:56
-
I am starting on Windows "Live555MediaServer.exe", then it says "Play streams from this server using the URL" rtsp://192.168.0.10:8554/
. In my case it's ''rtsp://192.168.0.10:8554/test.h264'' I don't have the "testOnDemandRTSPServer" i have the prebuilt exe. And I am using VLC to read in the stream, as i stated, i can open mp3 files without any problem – user1767754 Nov 23 '14 at 22:04 -
Note that the file extension for an H264 elementary stream is ".264" without the "h". Just tested with the media server. – Ralf Nov 24 '14 at 11:14
-
Perfect its working now! Can you give some referenes to read more about NAL / H.264 elementary Stream. How can i fastly check if the stream is elementary stream and why does live555 not play h264 streams which are not elementary? I've downloaded the h264 files from: http://www.h264info.com/clips.html – user1767754 Nov 24 '14 at 16:34
-
1Added some comments in answer. – Ralf Nov 25 '14 at 11:25
-
Hey Ralph, i've created a new thread, maybe you want to have a look onit? http://stackoverflow.com/questions/27677525/what-are-the-advtanages-of-live555-over-ffserver-vv wold be nice – user1767754 Dec 28 '14 at 14:56