I have a remote MP4 file that is short (1 minute) but large (~450mb), something like this:
I'd like to extract frames every n seconds (where n is >0.5, probably 1 or 2) in the most bandwidth-efficient way possible - i.e. without downloading the whole video. I care less about getting a specific frame than I do about getting one in the general area with the smallest amount of bandwidth usage.
I've found I can get the keyframe list like this:
ffprobe -select_streams v -show_frames \ -show_entries frame=pict_type \ -of csv https://s3-eu-west-1.amazonaws.com/worm-web-assets-prod/GOPR7775.MP4 \ | grep -n I | cut -d ':' -f 1
But this involves downloading the entire video.
I can also download the actual keyframes:
ffmpeg -i \ https://s3-eu-west-1.amazonaws.com/worm-web-assets-prod/GOPR7775.MP4 \ -vf select='eq(pict_type\,I)',setpts='N/(239.76*TB)' out%09d.jpg
But again, this downloads the whole video.
I've also found I can download specific frames:
ffmpeg -noaccurate_seek -ss 00:00:01 -i https://s3-eu-west-1.amazonaws.com/worm-web-assets-prod/GOPR7775.MP4 -frames:v 1 frame-1s.jpg
But this seems to use a lot of data for each frame (>5mb).
Is there a way to achieve this with minimal bandwidth usage?