gsubiran
(Guillermo Subiran)
May 27, 2020, 5:39pm
1
Im trying to automate a snapshot from generic camera (RSTP) every X time.
I’m generating and saving snapshot ok, but the problem is that the generated snapshot is allways the still_image_url and not the real camera frame at this moment.
I’m missunderstanding something or is gust an issue of generic camera integration?
configuration.yaml
- camera:
- platform: generic
stream_source: rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov
still_image_url: https://upload.wikimedia.org/wikipedia/commons/thumb/7/70/Big.Buck.Bunny.-.Opening.Screen.png/1200px-Big.Buck.Bunny.-.Opening.Screen.png
name: big_buck_bunny
automation.yaml
- id: '1590598247503'
alias: Big Buck Bunny snapshots
description: ''
trigger:
- platform: time_pattern
seconds: /5
condition: []
action:
- data:
entity_id: camera.big_buck_bunny
filename: /config/snapshots/RTSP/big_buck_bunny/image_latest.jpg
entity_id: camera.big_buck_bunny
service: camera.snapshot
fabiorios14
(Fabio Rios Miranda)
June 12, 2020, 3:52pm
2
Hi I have the same problem. Do you have the solution?
dapuzz
(dapuzz)
February 19, 2021, 11:10am
3
I solved with a simple python script
@service
def floureon_still_image():
import os
channels = ['2','6','7','8']
ffmpeg = "/usr/bin/ffmpeg -y -i 'rtsp://192.168.178.69:554/user=admin&password=******&channel="
for chan in channels:
log.info(f"Floureon refreshing still images for channel {chan}")
os.system(ffmpeg + chan +"&stream=0.sdp?real_stream--rtp-caching=100' -vframes 1 /home/rpi/.homeassistant/www/cam/" + chan +".jpg")
then in configutation.yaml
- platform: generic
still_image_url: https://homeassistant.duckdns.org/local/cam/7.jpg
stream_source: rtsp://192.168.178.69:554/user=admin&password=*****&channel=7&stream=1.sdp?real_stream--rtp-caching=100
name: Generic7
1 Like
solved the problem by using the ffmpeg integration platform for the camera.
Example configuration.yaml entry
camera:
platform: ffmpeg
input: FFMPEG_SUPPORTED_INPUT
nicke
1 Like
Hi Nichlas can you please share your camera configuration? Are you using an automation for the snapshot?
Hi,
yes I do.
Automation
` - id: ‘xxx’
alias: Camera snapshoots
description: ‘’
trigger:
platform: time_pattern
hours: /1
condition:
condition: sun
before: sunset
after: sunrise
action:
service: camera.snapshot
target:
entity_id: camera.reolink
data:
filename: /config/www/snapshots/outdoor_cam {{ now().strftime("%Y%m%d-%H%M%S")
}}.jpg
mode: single`
R
Nicke
1 Like