Page 1 of 1

How to play mjpeg stream with VLC?

Posted: 22 Oct 2021 08:31
by astrowalker
I have mjpeg stream created with ffmpeg and mjpegserver: https://github.com/blueimp/mjpeg-server.
It works without any problems if I open it with web browser -- all it takes is enter "localhost:9000" in a browser and I can see my stream playing.

But if I open VLC and try to open this stream all I get is bouncing progress bar back and forth and nothing is played.

What do I miss? Any special parameter for VLC?

I run mjpegserver without waiting for client, besides I see stream played in browser when I try to do the same in VLC, so for sure it is not the problem that VLC is waiting for actual data. I check windows VLC and linux VLC, both have the same effect. VLC 3.0.11.

The format of the stream is recognized by web browser as "multipart/x-mixed-replace;boundary=ffmpeg".

Re: How to play mjpeg stream with VLC?

Posted: 22 Oct 2021 15:52
by RĂ©mi Denis-Courmont
Bouncing back and forth usually means that there is no data.

Re: How to play mjpeg stream with VLC?

Posted: 25 Oct 2021 11:43
by astrowalker
Thank you. I tested it again, it is not possible there is no data, because I can see this stream in web browser, I copy address from web browser, paste it into VLC and... nothing. Btw. today I tried to save this stream using VLC (just to check if VLC sees the data or has some problem with the output maybe). The dumped/saved stream was just 160B, so it looks like VLC does not indeed does not see the data, but why?

Re: How to play mjpeg stream with VLC?

Posted: 29 Oct 2021 08:05
by astrowalker
After few more tests I noticed VLC can play the stream only if it is the first client playing it. So far I tested it checking web browser first (to ensure I can play it at all), and then tried to play it with VLC (this does not work). But if I skip web browser and open VLC first then I can play stream with VLC.

So why such difference?

Re: How to play mjpeg stream with VLC?

Posted: 15 Nov 2021 09:59
by astrowalker
For the record, it is problem with VLC. Report: https://code.videolan.org/videolan/vlc/-/issues/26260