Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to grab a single image from RTSP stream using FFMPEG

Tags:

ffmpeg

I have seen several other related questions but they all seem to be related to grabbing a still shot every X number of seconds. How can I grab 1 image when the command is run.

I was trying

ffmpeg -y -i rtsp://admin:[email protected]:554/live -f image2 -updatefirst 1 do.jpg
like image 921
sealfab Avatar asked Jan 20 '16 15:01

sealfab


3 Answers

Try

ffmpeg -y -i rtsp://admin:[email protected]:554/live -vframes 1 do.jpg
like image 157
Gyan Avatar answered Nov 07 '22 18:11

Gyan


I've been using variations to use my Ubiquiti cameras to give me a Weather Underground JPG.

The tcp transport addition fixed everything. The modified command follows.

E $FFMPEG -y -loglevel fatal -rtsp_transport tcp -i $URL1 -frames:v 2 -r 1 -s 320x240 $TMPFILE
like image 2
ehud gavron Avatar answered Nov 07 '22 19:11

ehud gavron


My take on this command, but its not perfect, about 20% of the time I get a corrupted (as in incomplete, or glitchy) image over a bad link:

avconv -rtsp_transport tcp -y -i rtsp://user:[email protected]:554/live -vframes 1 do.jpg
like image 1
user230910 Avatar answered Nov 07 '22 18:11

user230910