How to display RTSP streams from IP Cameras in Openhab and Habpanel (Linux only)

Hello All,

first of all I’d like to thank you for pointing me for this solution. I want to share solution I “create” which might find someone usefull especially regarding to high CPU usage.

Eventhough it is not issue in my solution (my HPE microserver can handle the streaming with no issue) I believe it is wasting of resources when 30% of CPU is used when nobody is watching current stream.

Solution: turn on streaming on demand.

  1. Configure ffmpeg as outlined in this post
  2. Create dummy switch for turning on the streaming - Dummy/Virtual item without a binding
  3. Create simple script for running the streaming from cammera and save it i.e. in /etc/openhab2/scripts/streaming_on.sh
!#/bin/bash
timeout 60 ffmpeg -rtsp_transport tcp -i 'rtsp://rstp_cam_rstp_stream' http://127.0.0.1:8090/camera_stream.ffm
  1. Create simple rule like:
rule "Streaming on"
		when 
			Item dummy_switch changed from OFF to ON
		then
			executeCommandLine("/etc/openhab2/scripts/streaming_on.sh")
end
  1. Assing the dummy switch into HABPannel dashboard to turn on streaming on demand.
  2. Enjoy the result

obrázok

PS1: the streaming will be available for 60seconds
PS2: saving the PID will help us also to turn off the streaming on deman.

Hopefully will find it out helpfull.

Y

1 Like