Page 1 of 1

VLC mjpeg stream incompatible with Firefox

Posted: 05 Sep 2010 02:02
by xj25vm
I use VLC 1.1.3. I am trying to stream video in mjpeg from a webcam. I'm using the following command:

Code: Select all

vlc --no-audio v4l2:///dev/video0:width=640:height=480:fps=5:chroma=mjpg --sout "#standard{access=http,mux=mpjpeg,dst=localhost:8080}"
The above command runs ok, without problems. I can view the stream using:

Code: Select all

vlc http://localhost:8080
However, I can't view the stream in Firefox. Firefox doesn't display the stream when I point it to http://localhost:8080, but it offers to save the file (recognised as a binary file). However, Firefox can open mjpeg streams from other sources (generated by ffserver or motion).

I've also tried using "dst=localhost:8080/stream.mjpg"

Is the mjpeg stream generated by VLC incompatible with Firefox?

I've posted here although I use Linux - because I believe this problem has nothing to do with Linux. However, if anyone thinks otherwise - please let me know.

Re: VLC mjpeg stream incompatible with Firefox

Posted: 05 Sep 2010 18:23
by Jean-Baptiste Kempf
Maybe you need to change the mime/type for firefox to understand it?

Re: VLC mjpeg stream incompatible with Firefox

Posted: 05 Sep 2010 20:56
by xj25vm
Hi j-b,

Firefox is supposed to be able to view mjpeg streams with default settings. It is able to view them ok from other sources - just not the ones created by VLC. Also, the incoming stream is not even detected as a particular mime-type - it is just detected as a binary file. Is it possible that the http header VLC is sending is missing some elements - or it is non-standard and Firefox doesn't recognise it?

Sebastian

Re: VLC mjpeg stream incompatible with Firefox

Posted: 05 Sep 2010 22:20
by Jean-Baptiste Kempf
Yes, that's exactly what I said, vlc is probably sending the wrong mime/type for it

Re: VLC mjpeg stream incompatible with Firefox

Posted: 06 Sep 2010 09:46
by xj25vm
Is there anything I can do to test this further?

Re: VLC mjpeg stream incompatible with Firefox

Posted: 06 Sep 2010 12:18
by Jean-Baptiste Kempf
use --sout-http-mime option.

Re: VLC mjpeg stream incompatible with Firefox

Posted: 07 Sep 2010 08:17
by xj25vm
Hi Jean-Baptiste,

As per your suggestion, I've tried using --sout-http-mime="multipart/x-mixed-replace;boundary=--myboundary"

However, Firefox is still recognising the stream as a binary file, and nothing else. VLC client is still able to display the stream without problem. The above seems to be the suggested option for http-mime and mjpeg. Has there been a change of syntax with the latest version of VLC? Is there anything else that I could try?

Thank you,

Sebastian

Re: VLC mjpeg stream incompatible with Firefox

Posted: 14 Sep 2010 10:17
by lloegar
VLC uses hardcoded boundary: 7b3cc56e5f51db803f790dad720ed50a

So forget your custom boundary string and try:
--sout-http-mime="multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a"

Good luck!

--
lloegar