How to continuously extract video frames from streaming RTMP using avconv / ffmpeg?

大憨熊 提交于 2019-12-22 10:29:45

问题


We're dealing with streaming video on RTMP and my goal is to extract frames from the stream at a given interval, e.g. every 1 second.

Currently I run a command in a loop, which takes a frame and exports it as base64 JPEG:

avconv -i <URL> -y -f image2 -ss 3 -vcodec mjpeg -vframes 1 -s sqcif /dev/stdout 2>/dev/null | base64 -w 0

But each of these processes is long (takes a few seconds -- which adds even more delay on streaming video that's not real time already). I am wondering if there is a way to make avconv or ffmpeg to extract frames at an interval (in seconds or frames) and either save as a file or dump to stdout.

I would really appreciate your help!


回答1:


did you try this?

ffmpeg -i <URL> -r 1 out%03d.jpg


来源:https://stackoverflow.com/questions/19191717/how-to-continuously-extract-video-frames-from-streaming-rtmp-using-avconv-ffmp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!