[Live-devel] live streaming: FAQ or MPEG4VideoStreamDiscreteFramer
Ross Finlayson
finlayson at live.com
Tue Jan 25 11:50:06 PST 2005
>I'm trying to use liveMedia to stream video frame grabbed from a camera
>in unicast.
>I have written my object to grab frame from a camera and using
>libavcodec I can obtain e m4v stream (or mp4).
>Now I'm a bit confused, reading these mails and the FAQ page it seems
>that I have to redefine:
>
>-a class from OnDemandServerMediaSubsession
Yes. More specifically, it will be a class very similar to the existing
"MPEG4VideoFileServerMediaSubsession" (perhaps differing only in its
implementation of "createNewStreamSource()").
> (but in the
>testOnDemandRTSPServer I cannot understand who is creating this obj, it
>seems it uses MPEG4VideoFileServerMediaSubsession instead)
Yes, this object is created by the server. (So, if you wanted to use
"testOnDemandRTSPServer", you would need to change the code to create an
object of your new class, instead of "MPEG4VideoFileServerMediaSubsession").
>-a class from FramedSource where I can encapsulate my encoder or copy
Yes.
>Then I 've found the class MPEG4VideoStreamDiscreteFramer that seems to
>do the work I need: stream, frame by frame, an mpeg4 video, so I don't
>understand if this class is made to do that job or not.
Your new subclass of "ServerMediaSession" - in its implementation of the
"createNewStreamSource()" member function - will need to
1/ Create a new object of your data source class (i.e., that
encapsulates your encoder), and
2/ Feed it to a 'framer' filter (that, among other things,
computes correct presentation times for 'B' frames).
(See the existing
"MPEG4VideoFileServerMediaSubsession::createNewStreamSource()" for guidance
here.)
To be on the safe side, you can use the same 'framer' filter:
"MPEG4VideoStreamFramer". If, however, your encoder delivers discrete
MPEG-4 video frames (rather than just a byte stream with no frame
boundaries), then - to be a bit more efficient - you can use
"MPEG4VideoStreamDiscreteFramer" instead.
Ross Finlayson
LIVE.COM
<http://www.live.com/>
More information about the live-devel
mailing list