irman
irman

Reputation: 51

Extract frames from live youtube stream

I want to extract frames from a youtube live event, say one frame every 5 minutes, ideally without saving the stream to my local machine. Is there a simple way to do this, possibly a combination between youtube-dl and ffmpeg that I am not figuring out? I found a similar question for UDP streams but don't know how to include the youtube stream: FFMPEG: extract a fram from a live stream once every 5 seconds

Thanks a lot in advance!

Upvotes: 2

Views: 2328

Answers (1)

irman
irman

Reputation: 51

I figured it out based on another answer and the ffmpeg wiki.

You need to convert your youtube URL as follows:

youtube-dl -g "youtube URL"

Copy the output URL into the following command to extract a frame every 5 seconds:

ffmpeg -i "output URL" -vf fps=1/5 out%d.png

This will extract one frame every 5 seconds.

Upvotes: 2

Related Questions