ffmpeg to capture stills from H.264 stream
The problem, as your output hints at, is that you are missing RTP packets and therefore essential parts of the video. With your command, ffmpeg will output exactly one image – as soon as it sees the end of the first frame – but there was some data missing. So it tries to conceal the errors in the macroblocks, but it can only do so by copying parts of the already decoded image, which leads to the artifacts you're seeing here.
The FFmpeg Wiki has an example of how to create a thumbnail every x seconds:
ffmpeg -i rtsp://10.2.69.201:554/ch0_0.h264 -f image2 -vf fps=fps=1/120 img%03d.jpg
You could, of course try to save the stream in a file. In this case, it would stop after 120 seconds:
ffmpeg -i rtsp://10.2.69.201:554/ch0_0.h264 -c:v copy -t 120 stream.mp4
If you can, try to download or compile a recent static build, as your ffmpeg is a little older and you never know if you didn't come across a bug that has already been fixed.
The RTP: missed 1 packets
message is a clue that you have some data missing from your stream.
Try to add -rtsp_transport tcp
before -y
option to use TCP instead of UDP.
Hi I had the same problem with the RTSP stream from my IP camera a while ago. ffmpeg version 1.0 built on Nov 21 2012 20:41:28 with gcc 4.4.6 (GCC) 20120305
I had the same thumbnail result as you with the blurry part at the bottom.
the comand I used was:
ffmpeg -i {RTSP_SOURCE} -ss 00:00:01 -f image2 -vframes 1 thumb.jpg
my problem was solved when I suffixed the milliseconds part in the -ss parameter:
ffmpeg -i {RTSP_SOURCE} -ss 00:00:01.500 -f image2 -vframes 1 thumb.jpg
I found that in an example at the official FFMPEG documentation and it worked for my case.
https://trac.ffmpeg.org/wiki/Create%20a%20thumbnail%20image%20every%20X%20seconds%20of%20the%20video