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.
- Configure
ffmpeg
as outlined in this post - Create dummy switch for turning on the streaming - Dummy/Virtual item without a binding
- 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
- 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
- Assing the dummy switch into HABPannel dashboard to turn on streaming on demand.
- Enjoy the result
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