[Live-devel] H.264 live video streaming

Ross Finlayson finlayson at live555.com
Fri Nov 18 22:24:23 PST 2011


> I am trying to use Live555 to implement an RTSP  server in our IP camera.
>  
> Our H.264 encoder produces NAL units preceded by a 00 00 00 01 start code.
>  
> The encoding main thread then writes the NAL units to a linux pipe where they can be read by the RTSP Server thread for streaming out.
>  
> My questions are:-
> 1.       Is the linux pipe method a good enough mechanism for getting the data to the server?

Yes.  In fact, it's an excellent mechanism, because it allows the server to treat the input stream as if it were a file.  This means that the existing "testOnDemandRTSPServer" code will work; you need make only minor changes (set "reuseFirstSource" to True, and change the input file name).  See http://www.live555.com/liveMedia/faq.html#liveInput-unicast


> 
> 2.       Which H264 framer class do I need? The new H264VideoStreamDiscreteFramer class doesn’t seem right because I have these start codes on each NAL unit. If I base a new class on H264VideoStreamFramer, do I need to remove the start codes?

Because you're reading H.264 from an unstructured byte stream, you'd use a "H264VideoStreamFramer", and the input data is assumed to include start codes at the front of each NAL unit.


> 3.       What else does the framer class need to do?

In this case you *don't* need to write any new 'framer' code (or subclass) of your own.  Just use "H264VideoStreamFramer" as is.


> Is there an example of this anywhere?

Yes, see "testProgs/testOnDemandRTSPServer.cpp", and "liveMedia/H264VideoFileServerMediaSubsession.cpp".  (Because you're reading from a pipe (i.e., as if it were a file), then you should be able to use the "H264VideoFileServerMediaSubsession" class, without modification.)


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20111118/a759ebe2/attachment.html>


More information about the live-devel mailing list