MJPEG in image card or abovementioned widget on any Chrome or Firefox on different Android devices (primary target architecture) or Chrome on Win 10 or Firefox on iOS 13 - effect: transparent placeholder, no video
getting any MJPEG to display in video card (error: “No compatible source was found for this media.”)
My current best guess is that this may be related to some browsers preventing mixing in the unsecured HTTP connection to the IPCameraBinding stream (e.g. http://xx.xx.xx.xx:12000/ipcamera.mjpeg) into the MainUI page accessed via HTTPS. The fact that those browser unable to display the MainUI with the MJPEG video correctly can show the MJPEG stream without issues when opening this in a separate tab.
So I guess getting the IPCameraBinding to support an HTTPS connection would be worth a try. Haven’t found any suggestions for this, though.
and relauching Chrome, the MainUI displays fine incl. MJPEG in the widget (verified on Chrome for Android an Win 10). Still doesn’t fix video card, seems to be an unrelated issue, but the widget is nicer anyways…
So, I have a workaround. A clean fix would involve getting the IPCameraBinding to expose an HTTPS connection, I guess.
Have you tried the latest version that uses the built in server as it may work via https? This was one reason for the change as Alexa needed the streams to be https so you can follow the guides on how to do what works for Alexa.
I’m not clear what it is your trying to do, is the camera already mjpeg and your trying to turn it into h264? that would overload the pi4 in realtime. To turn h264 into mjpeg that can be done in realtime on a pi4, just not the other direction.
I am not sure what your really asking in this post, can you explain the problem and what your wanting to do and what the problem is?
Tx for the quick reply! Sounds like good news. Do you happen to know when the HTTPS capability is expected to become part of the stable release branch? Another idea might be to have either the MainUI app server or an nginx proxy the stream from the IPCameraBinding. Will stick with the workaround for now, I guess.
Sorry for the confusion. The camera has MJPEG. Just wanted the video to get displayed robustly on the various devices & was experimenting with ffmpeg format conversions before I figured out that the issue was related to some browsers blocking HTTPS/HTTP mixes, not the the video stream format.
The changes were in the milestone 3 and newer so it will be in the next stable, which should be a week away with some luck as the first RC build is due in 3/4 days time. I’m not sure how the Alexa method is done, so it may need nginx setup from memory. Just wanted to point that there are posts that guide you on how to do it now and all cameras are on the same port which makes it easier.
Then check out the autofps.mjpeg and snapshots.mjpeg streams as these in the latest version are by far the most robust as they keep working even if the camera reboots or drops out of wifi. The other robust method is to use a jpg source and use the image card with a refresh on it, this by design will be the most robust as it can handle the camera going offline. Some tablets may make the website sleep to save battery life as mine does give a notice that it has done this.
Thanks for the recommendations! The issues I’m facing appear to all be located on the client/browser side, however. Maybe a sentence hinting at this issue (which seems to affect a significant part of the current browser generation) in the docs could help others. Btw., just switching to HTTP (no HTTPS) for MainUI eliminates the problem without further steps, but is of course suboptimal for other reasons.
The camera (part of a door bell setup) is wired with PoE and hasn’t dropped out yet. The current setup seems to work well now. Maybe I’ll get the tablets in place over the holidays.
Update: with the latest stable release, HTTPS/TLS connections seem to be supported by the IPCamera binding. The URL pattern has changed, but the MJPEG stream is now available via the OpenHab TLS port (8443 in my case), at the URL exposed by the MJPEG URL channel of the camera thing. Now, everything works smoothly as designed.
Thanks for the support & excellent dev work!