VLC mjpeg stream incompatible with Firefox

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
xj25vm
Blank Cone
Blank Cone
Posts: 15
Joined: 19 Aug 2010 22:01

VLC mjpeg stream incompatible with Firefox

Postby xj25vm » 05 Sep 2010 02:02

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.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: VLC mjpeg stream incompatible with Firefox

Postby Jean-Baptiste Kempf » 05 Sep 2010 18:23

Maybe you need to change the mime/type for firefox to understand it?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

xj25vm
Blank Cone
Blank Cone
Posts: 15
Joined: 19 Aug 2010 22:01

Re: VLC mjpeg stream incompatible with Firefox

Postby xj25vm » 05 Sep 2010 20:56

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

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: VLC mjpeg stream incompatible with Firefox

Postby Jean-Baptiste Kempf » 05 Sep 2010 22:20

Yes, that's exactly what I said, vlc is probably sending the wrong mime/type for it
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

xj25vm
Blank Cone
Blank Cone
Posts: 15
Joined: 19 Aug 2010 22:01

Re: VLC mjpeg stream incompatible with Firefox

Postby xj25vm » 06 Sep 2010 09:46

Is there anything I can do to test this further?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: VLC mjpeg stream incompatible with Firefox

Postby Jean-Baptiste Kempf » 06 Sep 2010 12:18

use --sout-http-mime option.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

xj25vm
Blank Cone
Blank Cone
Posts: 15
Joined: 19 Aug 2010 22:01

Re: VLC mjpeg stream incompatible with Firefox

Postby xj25vm » 07 Sep 2010 08:17

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

lloegar
New Cone
New Cone
Posts: 1
Joined: 14 Sep 2010 10:14

Re: VLC mjpeg stream incompatible with Firefox

Postby lloegar » 14 Sep 2010 10:17

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


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: Google [Bot] and 63 guests