Not possible to stream a camera to Google Nest Hub (Display) via Chromecast binding?

Hi guys,
a noob here. Trying to cast a camera stream to my Google Nest Hub (the one with a display) but ran into some problems. Maybe someone will see what I am doing wrong and nudge me in the right direction?

Platform:
openHAB 2.5.10 running on Windows 10.

Background
I have setup the Chromecast binding and added the camera in question to openHAB and this works fine. I can see the stream from the camera in a browser (http://192.168.1.122:8000/snapshots.mjpeg), I can see a snapshot from the camera in a browser (http://192.168.1.122:8000/ipcamera.jpg) so this seems to be working fine.

I can cast the image (ipcamera.jpg) to the Google Nest Hub, that works fine. I can also play sounds on the Nest Hub and also saying things with the “say” command.

Problem
But when I try to stream the mjpeg file, it only says “Playing Default Media Receiver” on the display. Nothing more happens. And after a while, it goes back to normal mode (ambient).

My thing:

My item:

String	BathroomPlayURI	"PlayURI"	{ channel="chromecast:chromecast:[UID Deleted]:playuri" }

Different commands in the rule:

This gives the “Playing Default Media Receiver” problem:

BathroomPlayURI.sendCommand("http://192.168.1.122:8000/snapshots.mjpeg")

This however works fine:

BathroomPlayURI.sendCommand("http://192.168.1.122:8000/ipcamera.jpg")

This is how it looks on the Google Nest Hub when trying to stream from the camera (very dusty in the picture):

The log below when I get the “error” (log is set to TRACE level for the binding).

Does anybody have any idea of what is going on? What is it that I don’t understand? I am quite lost I am sorry to say.

17:25:21.134 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'TestSwitch' received command ON
17:25:21.147 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'BathroomPlayURI' received command http://192.168.1.122:8000/snapshots.mjpeg
17:25:21.154 [INFO ] [arthome.event.ItemStatePredictedEvent] - BathroomPlayURI predicted to become http://192.168.1.122:8000/snapshots.mjpeg
17:25:21.166 [INFO ] [smarthome.event.ItemStateChangedEvent] - TestSwitch changed from OFF to ON
17:25:22.578 [DEBUG] [covery.ChromecastDiscoveryParticipant] - Chromecast Type: Google Nest Hub
17:25:22.579 [DEBUG] [covery.ChromecastDiscoveryParticipant] - Chromecast Found: 192.168.1.175 8009
17:25:22.582 [DEBUG] [covery.ChromecastDiscoveryParticipant] - Chromecast Type: Google Nest Hub
17:25:23.072 [DEBUG] [romecast.internal.ChromecastCommander] - Application launched: Application{id: CC1AD845, name: Default Media Receiver, sessionId: 38f52a52-f3fe-4db1-81ea-261d175a8b87, statusText: Default Media Receiver, transportId: 38f52a52-f3fe-4db1-81ea-261d175a8b87, isIdleScreen: false, launchedFromCloud: false, namespaces: [Namespace{urn:x-cast:com.google.cast.cac}, Namespace{urn:x-cast:com.google.cast.debugoverlay}, Namespace{urn:x-cast:com.google.cast.broadcast}, Namespace{urn:x-cast:com.google.cast.media}]}
17:25:23.564 [DEBUG] [cast.internal.ChromecastStatusUpdater] - MEDIA_STATUS MediaStatus{activeTrackIds: <null>, mediaSessionId: 1, playbackRate: 1, playerState: IDLE, currentItemId: 1, currentTime: 0,000000, customData: <null>, loadingItemId: null, items: <null>, preloadedItemId: null, supportedMediaCommands: 274447, volume: Volume{level: 1.0, muted: false, increment: 0.05, stepInterval: 0.05000000074505806, controlType: null}, media: Media{url: http://192.168.1.122:8000/snapshots.mjpeg, contentType: multipart/x-mixed-replace; boundary=thisMjpegStream, duration: null}, repeatMode: REPEAT_OFF, idleReason: null}
17:25:24.066 [DEBUG] [covery.ChromecastDiscoveryParticipant] - Chromecast Type: Google Nest Hub
17:25:24.069 [DEBUG] [covery.ChromecastDiscoveryParticipant] - Chromecast Found: 192.168.1.175 8009
17:25:24.072 [DEBUG] [covery.ChromecastDiscoveryParticipant] - Chromecast Type: Google Nest Hub
17:25:24.568 [DEBUG] [cast.internal.ChromecastStatusUpdater] - MEDIA_STATUS MediaStatus{activeTrackIds: <null>, mediaSessionId: 1, playbackRate: 1, playerState: BUFFERING, currentItemId: 1, currentTime: 0,000000, customData: <null>, loadingItemId: null, items: <null>, preloadedItemId: null, supportedMediaCommands: 274447, volume: Volume{level: 1.0, muted: false, increment: 0.05, stepInterval: 0.05000000074505806, controlType: null}, media: null, repeatMode: REPEAT_OFF, idleReason: null}

17:25:25.444 [DEBUG] [romecast.internal.ChromecastCommander] - Failed to request media status with a running app: Waiting for response timed out
17:25:25.779 [DEBUG] [romecast.internal.ChromecastCommander] - Failed to request media status with a running app: Waiting for response timed out
17:25:26.075 [DEBUG] [romecast.internal.ChromecastCommander] - Failed to request media status with a running app: Waiting for response timed out
17:25:30.084 [DEBUG] [covery.ChromecastDiscoveryParticipant] - Chromecast Type: null

17:25:40.973 [DEBUG] [covery.ChromecastDiscoveryParticipant] - Chromecast Type: null
17:25:40.977 [DEBUG] [covery.ChromecastDiscoveryParticipant] - Chromecast Type: Google Nest Hub
17:25:40.978 [DEBUG] [covery.ChromecastDiscoveryParticipant] - Chromecast Found: 192.168.1.175 8009
17:25:40.978 [DEBUG] [covery.ChromecastDiscoveryParticipant] - Chromecast Type: Google Nest Hub
17:25:50.101 [DEBUG] [covery.ChromecastDiscoveryParticipant] - Chromecast Type: null
17:26:06.238 [DEBUG] [romecast.internal.ChromecastCommander] - Failed to request media status with a running app: Waiting for response timed out
17:26:05.904 [DEBUG] [romecast.internal.ChromecastCommander] - Failed to request media status with a running app: Waiting for response timed out
17:26:05.565 [DEBUG] [romecast.internal.ChromecastCommander] - Failed to request media status with a running app: Waiting for response timed out
17:25:53.404 [DEBUG] [romecast.internal.ChromecastCommander] - Failed playing media: Waiting for response timed out
17:26:14.909 [DEBUG] [covery.ChromecastDiscoveryParticipant] - Chromecast Type: Google Nest Hub
17:26:15.000 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'chromecast:chromecast:04d3e1e161d2bc9e2870f1fa9d754318' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Waiting for response timed out
17:26:15.001 [DEBUG] [covery.ChromecastDiscoveryParticipant] - Chromecast Found: 192.168.1.246 8009
17:26:15.002 [DEBUG] [covery.ChromecastDiscoveryParticipant] - Chromecast Type: Google Nest Hub
17:26:21.038 [DEBUG] [cast.internal.ChromecastEventReceiver] - Received an 'UNKNOWN' event (class=class com.fasterxml.jackson.databind.JsonNode)
17:26:21.054 [DEBUG] [cast.internal.ChromecastStatusUpdater] - MEDIA_STATUS MediaStatus{activeTrackIds: <null>, mediaSessionId: 1, playbackRate: 1, playerState: IDLE, currentItemId: 1, currentTime: 0,000000, customData: <null>, loadingItemId: null, items: <null>, preloadedItemId: null, supportedMediaCommands: 274447, volume: Volume{level: 1.0, muted: false, increment: 0.05, stepInterval: 0.05000000074505806, controlType: null}, media: null, repeatMode: null, idleReason: ERROR}
17:26:25.018 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'chromecast:chromecast:04d3e1e161d2bc9e2870f1fa9d754318' changed from OFFLINE (COMMUNICATION_ERROR): Waiting for response timed out to ONLINE
17:26:25.121 [DEBUG] [cast.internal.ChromecastStatusUpdater] - MEDIA_STATUS null
17:26:25.125 [INFO ] [smarthome.event.ItemStateChangedEvent] - BathroomStop changed from OFF to ON
17:26:30.151 [DEBUG] [covery.ChromecastDiscoveryParticipant] - Chromecast Type: null

Did you ever find a fix for this? I’m stuck with this too

Hi, no sorry, I never got an answer and I gave up on this.

1 Like

What did you switch to?

Hi Josh,
I didn’t switch to anything, I gave up. What I do instead is to send a picture (not stream) from the camera, lika a snapshot. That works “fairly” well (the ratio of the image is wrong) but it helps me a bit.

Sorry I only just saw this thread.

mjpeg streams I can not work out how to get them to cast. Not sure if it is possible and I just dont know the secret handshake google wants or if they dont support that format. To get a working stream you need to use HLS which is the ipcamera.m3u8 feature. The snapshot can also be cast which is quicker to display so I was cast the jpg whilst the HLS spun up to speed for a while.

To get HLS you need any camera that has h264/5 streams, so if your camera only has mjpeg and no h264/5 ability then you should change your camera to one that does.

IP Camera - Bindings | openHAB

Hi,
thanks for your answer. I have tried getting it to work but I guess this is a bit too advanced for me.

System: Windows10
openHAB: 3.01 stable

I get the snapshot to work (http://192.168.1.122:8000/ipcamera.jpg in my case) but as soon as I try to use the HLS stream (http://192.168.1.122:8000/ipcamera.m3u8 in my case) I get the following error in the log:

21-12-05 11:30:59.041 [WARN ] [nhab.binding.ipcamera.internal.Ffmpeg] - An error occured trying to process the messages from FFmpeg.
21-12-05 11:31:03.533 [WARN ] [ipcamera.internal.StreamServerHandler] - Exception caught from stream server:D:\OpenHABStreetCam\ipcamera.m3u8 (The system cannot find the file specified)
21-12-05 11:31:03.539 [WARN ] [nhab.binding.ipcamera.internal.Ffmpeg] - An error occured trying to process the messages from FFmpeg.
21-12-05 11:31:08.037 [WARN ] [ipcamera.internal.StreamServerHandler] - Exception caught from stream server:D:\OpenHABStreetCam\ipcamera.m3u8 (The system cannot find the file specified)
21-12-05 11:31:08.050 [WARN ] [nhab.binding.ipcamera.internal.Ffmpeg] - An error occured trying to process the messages from FFmpeg.

I am trying this in a browser (Edge) to check for the problem “as early” in the chain as possible. If it does not work in the browser, I guess that is a good reason for it not work when casting. If I could get it to work in the browser, I think I would be able to figure the rest out.

I have put ffmpeg.exe in C:\openhab3\runtime\bin\ffmpeg.exe - I don’t understand if I need to “install” it somehow, I haven’t been able to read about any details for this on Windows.

These are my settings on the camera regarding ffmpeg:

I think I am doing something fundamentally wrong here because my understanding is too low. If someone can give me a hint about what that could be, I would be grateful. For me all the settings etc for the ipcamera are too advanced for my level even if I understand much of the rest of openHAB.

Otherwise it works fine with the snapshot and that gives me a nice feature as it is (using it to see who is at the gate) but of course, it would be a notch up to see a live stream. So I am very grateful as things are already to be able to use openHAB (fantastic software) and also the binding.

You need to enable at least DEBUG or TRACE level in the logs at see any messages back from ffmpeg. See the bindings docs on how to get help as it gives the command to change the logs.

Hi,
this is the output with TRACE enabled. A lot of information… For me this is out of my knowledge area I am sorry to say.

21-12-05 12:52:54.708 [DEBUG] [ng.ipcamera.internal.HikvisionHandler] - Unhandled reply---hikboundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 480

<EventNotificationAlert version="1.0" xmlns="http://www.hikvision.com/ver10/XMLSchema">
<ipAddress>192.168.1.75</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>c4:2f:90:42:86:1e</macAddress>
<channelID>1</channelID>
<dateTime>2021-12-05T12:48:16+01:00</dateTime>
<activePostCount>0</activePostCount>
<eventType>videoloss</eventType>
<eventState>inactive</eventState>
<eventDescription>videoloss alarm</eventDescription>
</EventNotificationAlert>.
21-12-05 12:52:54.983 [WARN ] [ipcamera.internal.StreamServerHandler] - Exception caught from stream server:D:\OpenHABStreetCam\ipcamera.m3u8 (The system cannot find the file specified)
21-12-05 12:52:54.986 [DEBUG] [ipcamera.internal.StreamServerHandler] - Stream Server recieved request  GET:/ipcamera.m3u8
21-12-05 12:52:54.987 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:-hide_banner -loglevel warning -rtsp_transport tcp -i rtsp://admin:********@192.168.1.75:554/Streaming/Channels/101?transportmode=unicast&amp;profile=Profile_101 -strict -2 -f lavfi -i aevalsrc=0 -acodec aac -vcodec copy -hls_flags delete_segments -hls_time 2 -hls_list_size 4 D:\OpenHABStreetCam\ipcamera.m3u8
21-12-05 12:52:54.991 [WARN ] [nhab.binding.ipcamera.internal.Ffmpeg] - An error occured trying to process the messages from FFmpeg.
21-12-05 12:52:55.014 [TRACE] [ng.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is         :
:
21-12-05 12:52:55.015 [DEBUG] [ng.ipcamera.internal.HikvisionHandler] - Unhandled reply-
.
21-12-05 12:52:55.017 [TRACE] [ng.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is         :--hikboundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 480

<EventNotificationAlert version="1.0" xmlns="http://www.hikvision.com/ver10/XMLSchema">
<ipAddress>192.168.1.75</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>c4:2f:90:42:86:1e</macAddress>
<channelID>1</channelID>
<dateTime>2021-12-05T12:48:16+01:00</dateTime>
<activePostCount>0</activePostCount>
<eventType>videoloss</eventType>
<eventState>inactive</eventState>
<eventDescription>videoloss alarm</eventDescription>
</EventNotificationAlert>:
21-12-05 12:52:55.018 [DEBUG] [ng.ipcamera.internal.HikvisionHandler] - Unhandled reply---hikboundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 480

<EventNotificationAlert version="1.0" xmlns="http://www.hikvision.com/ver10/XMLSchema">
<ipAddress>192.168.1.75</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>c4:2f:90:42:86:1e</macAddress>
<channelID>1</channelID>
<dateTime>2021-12-05T12:48:16+01:00</dateTime>
<activePostCount>0</activePostCount>
<eventType>videoloss</eventType>
<eventState>inactive</eventState>
<eventDescription>videoloss alarm</eventDescription>
</EventNotificationAlert>.
  1. Have you installed ffmpeg?
  2. Have you told the binding where ffmpeg is installed?

My guess is it will be one or both of these.

Well, this is exactly what I wrote about in the previous post (second from last). I don’t know what more to write?