[Live-devel] Can live library play JPEG file?

Ross Finlayson finlayson at live.com
Thu Jan 27 01:38:52 PST 2005

>Can live library play JPEG file or row data?

Do you mean: Can the library *stream* JPEG data (i.e., outgoing)?  If so, 
then yes.

To do this, you would use (i) "JPEGVideoRTPSink", which will be fed by (ii) 
a *subclass* of "JPEGVideoSource".

Note that "JPEGVideoSource" is an abstract base class.  You must define and 
implement your own subclass of this class that delivers (in the 
"doGetNextFrame()" virtual function) complete JPEG video frames (but 
without the usual JPEG header).

Note also that - in addition to "doGetNextFrame()" - your subclass will 
also need to provide your own implementations of the pure virtual functions 
"type()", "qFactor()", "width()", and "height()".  (If you're planning to 
read from files, then the "qFactor()" function could be the tricky one, 
because the 'Q factor' value is not directly present in files' JPEG header.)

For an example of such a subclass (of "JPEGVideoSource"), can could take a 
look at the "ElphelJPEGDeviceSource" class that we developed to stream from 
the Elphel MJPEG camera: <http://www.live555.com/Elphel/>  (Note the "source 
code" link.)

	Ross Finlayson

More information about the live-devel mailing list