Lol me stupid ... wrong language mode in Brain.
Anyway got script also running but strange enough i get the video as an animated gif is that right?
Moderators: leecollings, remb0
Lol me stupid ... wrong language mode in Brain.
Got it working! Thanks a lot for your help. The video is animated gif over here as well. But that works for me.
Code: Select all
return {
on = {
devices = {
'Dzwonek'
}
},
execute = function(domoticz, device)
if (domoticz.devices('Dzwonek').nValue == 3) then
os.execute('/home/pi/domoticz/scripts/doorbell.sh')
end
end
}
Hello, I try your code but I have many errors:
Not good
Code: Select all
stat: cannot stat ‘/var/tmp/frontdoorcam.mp4’: No such file or directory
Code: Select all
rtsp://admin:*******@192.168.10.9:554/ISAPI/Streaming/channels/101: Protocol not found
Thanks one more error left, but I can not find the solutions.EddyG wrote: ↑Saturday 21 November 2020 9:53 First error;Can be ignored, because it is just bad programming.Code: Select all
stat: cannot stat ‘/var/tmp/frontdoorcam.mp4’: No such file or directory
Second error:states that ffmpeg does not get the 'right' stream or that a parameter is missing.Code: Select all
rtsp://admin:*******@192.168.10.9:554/ISAPI/Streaming/channels/101: Protocol not found
You should google on 'ffmpeg Protocol not found'
You get a lot of suggestions of parameters. By try and error you have to find the right one(s).
Luckely for me my cam worked at the first try.
Code: Select all
sudo <scriptname>
I need this parameter.EddyG wrote: ↑Sunday 22 November 2020 11:03 Where does the '-rtsp_transport tcp' parameter come from, try without.
Do you have right for '/var/tmp' ??
Try start the script withIs the var $SnapFile correct defined?Code: Select all
sudo <scriptname>
Code: Select all
#!/bin/sh
SnapFile="/var/tmp/frontdoorcam.mp4" # Temp name of the video, change it when using this script for multiple cams
VideoLength=5 # Seconds to record
WaitTime=10 # Seconds the script waits before it sends another video
User="AAA" # Username which has access to the RTSP stream
Password="BBB" # Password for above provided user
rtspUrl="rtsp://$User:[email protected]:yyy/videoMain"
ChatID="CCC" # Telegram chat ID
TelegramAPIToken="DDD" # Telegram API token
ffmpeg -y -i $rtspUrl -r 30 -vcodec copy -an -t $VideoLength $SnapFile
curl -s -F chat_id=$ChatID -F video="@$SnapFile" -F caption="Doorbell ringing.." https://api.telegram.org/bot$TelegramAPIToken/sendVideo
Guessed Channel Layout for Input Stream #0.1 : monoEddyG wrote: ↑Sunday 22 November 2020 18:56 Did you try with the simplest version? And did you try to start the script with sudo?Code: Select all
#!/bin/sh SnapFile="/var/tmp/frontdoorcam.mp4" # Temp name of the video, change it when using this script for multiple cams VideoLength=5 # Seconds to record WaitTime=10 # Seconds the script waits before it sends another video User="AAA" # Username which has access to the RTSP stream Password="BBB" # Password for above provided user rtspUrl="rtsp://$User:[email protected]:yyy/videoMain" ChatID="CCC" # Telegram chat ID TelegramAPIToken="DDD" # Telegram API token ffmpeg -y -i $rtspUrl -r 30 -vcodec copy -an -t $VideoLength $SnapFile curl -s -F chat_id=$ChatID -F video="@$SnapFile" -F caption="Doorbell ringing.." https://api.telegram.org/bot$TelegramAPIToken/sendVideo
Code: Select all
sudo <full path>/video.sh
Code: Select all
sudo ./video.sh
Code: Select all
uname -a
ffmpeg -version
Users browsing this forum: No registered users and 1 guest