Mjpeg not working in Chrome


#1

When choosing Mjpeg stream in Chrome nothing shows as if it’s a missing image. However when running in Safari or IE, Mjpeg stream works fine. However other Mjpeg streams seem to be working fine in Chrome. Very strange!


#2

Chrome stopped supporting MJPEG Streams in v19:

https://productforums.google.com/forum/#!topic/chrome/PslmTeeM8Fo

If you have specs or a sample of MJPEG Streams which are compatible with Chrome please post them here…


#3

Hi Steve

My Router runs MJPEG-streamer, which seems to output in Chrome without issue.


#4

There is a lot on this on the Internet.
It seems that if you embed the MJPEG stream in html code as above it is accepted by Chrome.
If you use for example http://192.168.2.251:8100/lMjpeg/0 it will not work.
If you use this http://192.168.2.251:8100/live/0 it will work if that is ok for you.

-Henrik


#5

Hi Henrik

Using the live variant of the url it uses the Matroska mime type rather than it being the MJPEG stream.

Stu


#6

Hi,
Yes I know, but it was just a suggestion for a solution " if that is ok for you" which then it wasn´t ;).
-Henrik


#7

Please either dump 500kb of your “working” mjpeg stream or find a source which you can share here so that I can analyse it closer… thanks.


#8

I’ve managed to get the data, but unsure how to upload it as forum will only accept images. If I rename the file to .jpeg the upload fails as it can’t determine file size?

Here’s the first few lines of the stream:

–boundarydonotcross
Content-Type: image/jpeg
Content-Length: 153944
X-Timestamp: 2265600.060118

ˇÿˇ€Ña

Note that’s 2 dashes.

The working stream shows this for content-type in chrome:
Content-Type:multipart/x-mixed-replace;boundary=boundarydonotcross

The Netcamstudio stream content-type in Chrome shows
Content-Type: multipart/x-mixed-replace;boundary=–myboundary
the 2 dashes appear here.

And the extract from the mjpeg feed from Netcam Studio:

HTTP/1.1 200 OK
Server: NCS
Expires: 0
Pragma: no-cache
Content-Type: multipart/x-mixed-replace;boundary=–myboundary

–myboundary
Content-type: image/jpeg
Content-length: 26207

It looks like Chrome is looking for --myboundary but it looks like the working streams don’t have this in the content-type. I could be completely wrong but I believe it
should be Content-Type: multipart/x-mixed-replace;boundary=myboundary
without the 2 dashes, but the stream itself should maintain the dashes.

Here’s the first couple of lines from another working feed:

–Ba4oTvQMY8ew04N8dcnM
Content-Type: image/jpeg
Content-Length: 84212

ˇÿˇ‡

Maybe the first header is causing issues too:

HTTP/1.1 200 OK
Server: NCS
Expires: 0
Pragma: no-cache
Content-Type: multipart/x-mixed-replace;boundary=–myboundary


#9

Thanks you’re probably right… I will give it a try without the 2 dashes in declaration. No sure If I will manage before next week since i’ll be travelling for a few days. So in case you have no news by end of next week then please remind me :slight_smile:


#10

I’ve quickly tried and here are my results.

With current boundary=–myboundary:
Chromium 46: works
Chrome 51: not working

By changing to boundary=myboundary:
Chromium 46: works
Chrome 51: not working

So unfortunately no big progress but it’s probably something little to change somewhere if Chrome 51 can display some mjpeg streams.


Streaming problems - how to use the html generated code
#11

Ok, i’ve got it to work on both Chrome 51 and Chromium 46 :slight_smile:

Should be ok in next release…


#12

Hi!
Steve just released a new version NCS 1.3.7 before he left with some new features and some fixes which includes the MJPEG and Chrome issue as discussed above. It seems to work for me, but if you want to test you can download NCS here


OBS. This is at the moment not an official release so just for testing.

Thanks,
Henrik


#13

Awesome! I can confirm it works. Thank you very much! Now where’s the purchase button!:smiley:


#14

Excellent! The big fat order button is here http://netcamstudio.com/Order :slight_smile:
-Henrik
@Steve