[Ffmpeg-devel] Any pointers on how to connect to an MJPEG stream?

Michael Niedermayer michaelni
Thu Feb 22 18:30:36 CET 2007


Hi

On Thu, Feb 22, 2007 at 05:17:58PM +0000, Robert Harle wrote:
> 
> >>I have a camera that outputs an MJPEG stream to my network  
> >>(connecting to http://camera_ip/mjpegstream).  I want to be able to 
> >>obtain frames from the video using libavformat.  I can do this from a 
> >>video file using av_open_input_file(), but I'm not sure how to 
> >>convert to a stream.  At present I have:
> >>
> >>av_open_input_file(&formatctx, filename, NULL, 0, NULL);
> >>
> >>I see there is an av_open_input_stream() but I'm unsure as to the 
> >>parameters to pass to it, or even if this is intended to do what I want.
> >>
> >>Can anyone offer a suggestion, or a resource to try?
> >
> >Try ffmpeg -i http://camera_ip/whatever -t 300 x.mpg , what happens?
> 
> It fails, unable recognise the format.  I have to manually specify:
> 
>    ffmpeg -f mjpeg -i http://camera_ip/whatever -t 300 x.mpg
> 
> and then it works fine.  Similarly, ffplay -f mjpeg <URL> works fine.  
> Reading between the lines of your request, is it that 
> av_open_input_file() should take a URL and work, but the call fails 
> because it can't recognise a format from the URL?

implement mjpeg_demuxer.read_probe() or force the input format to mjpeg
like ffmpeg does when -f mjpeg is specified

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070222/07e63d09/attachment.pgp>



More information about the ffmpeg-devel mailing list