views:

29

answers:

1

Has anyone tried this ?

What's the best practice for this?

A: 

FMS live streams are using the RTMP protocol:

ffmpeg -i rtmp://server/path -acodec copy -vcodec copy -y captured.flv

Here, we are saving the whole stream to an FLV file, which is Flash's static movie file format and so can always preserve all RTMP audio and video codecs without conversion.

You can then extract any frames you want, e.g.

ffmpeg -i captured.flv -s starttime -vframes 1 -f image2 -vcodec mjpeg captured.jpg

If you are ambitious and know exactly what time offsets and intervals you want to capture in advance, you can do both steps at once, e.g. one frame every second:

ffmpeg -i rtmp://server/path -r 1 -f image2 -vcodec mjpeg captured%d.jpg

All commandlines have not been tested, will need fixing but give you a good impression

Will
@Will, when I tried your solution, I only got an error:`rtmp://localhost/vid2/recordings: no such file or directory`,seems ffmpeg doesn't support stream as input ?
libnet
it could be that you need to custom-compile ffmpeg. This is not unusual. Or it could perhaps be that you have your path wrong. You can ask in #ffmpeg on freenode.
Will
@Will, are you sure `ffmpeg` can ever process stream input?
libnet
@libnet, my commandlines are links to people showing you they can. This is not worth 0 pts.
Will
sorry, but it's not actually working...
libnet
@libnet then hire someone with sufficient initiative
Will