Sorry if this has been covered numerous times but I can't seem to get this to work...
project: I am attempting to capture a single frame from my driveway camera when a motion sensor is triggered.
Hardware:
RPi-4 running Buster OS
Lorex LNB9272 camera, 3840x2160 resolution, 20 fps, H.265 encoding
I can get a single jpeg image by entering the following url in the RPi CLI: http://192.168.xxx.yyy/cgi-bin/snapshot.cgi?1, however it takes several seconds for the camera to respond and the picture is useless because the car or person of interest is out of the field of view when the camera finally takes the picture...
So I figured I could get much faster response from the camera if I were to grab a single frame out of the RTSP stream. The RTSP command for this particular camera is: rtsp://username:password@192.168.xxx.yyy:554/cam/realmonitor?channel=1&subtype=0
After numerous Google searches I have determined this should not be too difficult by using the ffmpeg utility. So far I have tried the following strings in the RPi CLI:
Code: Select all
ffmpeg -rtsp_transport tcp -i rtsp://username:password@192.168.xxx.yyy:554/cam/realmonitor?channel=1&subtype=0 -f image2 -vf fps=fps=1 /home/pi/Pictures/test_image.jpg
ffmpeg -rtsp_transport tcp -i rtsp://username:password@192.168.xxx.yyy:554/cam/realmonitor?channel=1&subtype=0 -vframes 1 /home/pi/Pictures/test_image.jpg
ffmpeg -rtsp_transport tcp -i rtsp://username:password@192.168.xxx.yyy:554/cam/realmonitor?channel=1&subtype=0 -frames 1 -qscale 1 -f image2 /home/pi/Pictures/test_image.jpg
Code: Select all
pi@RPI-2:~ $ ffmpeg -rtsp_transport tcp -i rtsp://*****:*****@192.168.***.***:554/cam/realmonitor?channel=1&subtype=0 -f image2 -vf fps=fps=1 /home/pi/Pictures/test_image.jpg
[23] 27351
bash: -f: command not found
pi@RPI-2:~ $ ffmpeg version 4.1.4-1+rpt7~deb10u1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8 (Raspbian 8.3.0-6+rpi1)
Any help would be greatly appreciated.
Thx