Motion - Mplayer Mjpeg Stream Viewing

Viewing an mjpeg stream with mplayer


Firefox and Co uses much CPU Power on my X-Windows.

I search for an other client and found a solution with mplayer to view an MJPEG Stream in real-time.

 mkfifo a.mjpeg wget -O a.mjpeg http://localhost:8081 2>/dev/null & mplayer -cache 32 -demuxer 35 a.mjpeg 

Because mplayer doesn't know anything from handling http streaming wget is used.

A fifo is filled only with mjpeg by wget.

Mplayer reads from this fifo and uses the mjpeg demuxer (35) to view the stream.

-- PeterHolik - 18 Jul 2005

That is a wonderful idea. I will think about where in the official Motion Guide I should put this little gold piece of information.

-- KennethLavrsen - 18 Jul 2005

The above suggestion did not work for me. What works however is

mplayer -demuxer lavf http://localhost:8081/stream.mjpg

Note that the stream.mjpg part is important, without it you will get LAVF_check: no clue about this gibberish! nonsense from libavformat.

Adding MPEG or AVI streaming would still be a good idea though, as I believe it will help save bandwidth.

If your camera does not have a sream location that ends with .mjpg then you can still fool mplayer into thinking is does by attaching a fake get variable at the end of the URL like this :

" mplayer -demuxer lavf http://localhost:8081/?video_name=stream.mjpg "

-- BradMrumlinski - 24 May 2011

FFplay from FFmpeg works as well and has many options, *mjpeg format needs to be forced. :

ffplay -f mjpeg -probesize 32 -i http://localhost:8081

The full manual is over at


--Kelsie.Flynn - 2 Dec 2013

Topic revision: r6 - 03 Dec 2013, KelsieFlynn
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.