Google Assistent + Chromecast + HLS Video Stream

it was set up as ONVIF, i will try on HTTP after system is back online after cleaning cache

now :coffee: break

:+1:

No luck with the stream from IPCameraBinding used ONVIF and HTTPOnly

all i see in the log from openhab

IpCameras file server could not find the requested file. This may happen if ffmpeg is still creating the file.

but no HLS stream at all, neither VLC, Browser or Chromecast working

all i have a stream is trough the MJPEG URL

changed the state of the ITEM trough the karaf console and checked the value of the item…all OK

Does ipcamera build the .m3u8 file and the .ts files in the output folder?

If Ipcamera (ffmpeg) do create the files. I wonder if this could be a output format issue your Chromecast simply dont like. If it doesnt contain audio or the wrong audio format it will breake Chromecast.
The Chromecast V3 support 1920x1080p (FullHD) fine, so I guess the resolution should be fine. That nails it down to audio format.

Can you hook up your Chromecast to a screen and stream Youtube etc?

yes , as i am working on Wondows PC the outputfolder was not shared in my network, after changing outputfolder and restarting stream it works to my surprise

i guess its a permission issue to access the files, now lets see if i can use this when i use FFMPEG on PC Surveillance server and not on Openhab Server RPi3+

AHHH, nice to hear you´re making progress…

Regarding the persmission issue, I had those issues as well.
An easy fix (on your Rpi) is to run the openhabian-config and the menu option 10, and menu option 14 to fix permission. Then openhab (user) will have access to the stream.

Thanks for the info…maybe it messed up with cleaning the cache … as i got sometimes issues with permisions,

i used

sudo openhab-cli reset-ownership

to get back online

now … time to play with server to get it working

1 Like

Did you get this working?

I found a docker that’s ready built for converting the streams.

I’m using this to convert a stream from a Hosafe camera. I can say “turn front door camera on” and send the URL to the URI item but the same string item with ga=“Camera” item doesn’t work. I say “stream the front door camera” and I get the classic black screen. Anyway, the work around is good enough for now but I wanted to let you know about the docker. No messing about - it just works.

I have not investigated further, due to missing time. I did not finished to get it working but I will try as soon as I get time. Thanks for your info.

To get this to work with a Barlus Underwater ONVIF Pond Camera for my fish pond I had to get VLC Codec information [Tools->Codec Information] for the stream to show:

Stream 0
  Codec H264 - MPEG-4 AVC (part 10)(h264)
  Type: Video
  Video resolution: 1920x1080
  ...

and

Steam 1
  Codec: ADTS
  Type: Audio
  Channels: Stereo
  Sample rate: 16000 Hz
  Bits per sample: 32

You need to point vlc at the url shown on your Camera Item page in openhab in my case this is:

http://192.168.1.7:8080/ipcamera/e75a9d9ce4/ipcamera.m3u8

so to confirm http://<your openhab server>/... and not rtsp::<your camera ip address>/... with the camera ip address you might have been using to ‘test’ your camera is working but the openhab stream in which case the ip address will be that of your openhab device.

I did this with this
Things->ONVIF IP Camera->Advanced Settings

 -strict -2 -f lavfi -i aevalsrc=0 -acodec aac -vcodec libx264 -hls_flags delete_segments -hls_time 2 -hls_list_size 4

No need to bother with console logging TRACE settings just ps afx | grep ffmpeg to check your ffmpeg is being executed. Mine looks like this:

20427 ?        SLl    0:10  \_ /usr/bin/ffmpeg -hide_banner -loglevel warning -rtsp_transport tcp -i rtsp://admin:password@192.168.1.105:554/user=admin_password=tlJwpbo6_channel=1_stream=0.sdp?real_stream -strict -2 -f lavfi -i aevalsrc=0 -acodec aac -vcodec libx264 -hls_flags delete_segments -hls_time 2 -hls_list_size 4 /var/lib/openhab/ipcamera/e75a9d9ce4/ipcamera.m3u8

Once you add the google metadata it works with ‘hey google show fish pond camera’ I’ve found having two words seems to help the home hub out.

What you might find is that once ffmpeg is running openhab is reluctant to stop the stream and restart it with new settings so you might need to kill your ffmpeg process and restart it by opening a network stream again.