I have a 30fps video that is 234 minutes long and want to shrink it down to 2 minutes. 1-(234-2)/234)
gives me 0.0085 which I use
ffmpeg -i source.mp4 -vf setpts=PTS*0.0085,palettegen palette.png
followed by
ffmpeg -i source.mp4 -i palette.png --filter_complex setpts=PTS*0.0085,paletteuse survey.gif
Actually making the gif is excruciatingly slow compared to extracting the desired frames into a massive directory of png's which I can then combine with convert
into a gif. Aside from my main question, it doesn't seem like ImageMagick's convert supports user supplied palette files.
I understand that PTS is just adjusting how long a single frame is shown in a video but setpts has felt like the only reliably precise way of cutting the source.mp4 down.
I looked at framestep
and it is much better for speed but I couldn't figure out an ideal value for framestep
that wouldn't make the resulting gif step from one frame to the next like what I would get from using convert
and a delay of 0.5 between frames.
Aside from above, these survey are meant to quickly scan through hours of video for various points of concern in a gif format able to be uploaded privately to imgur or giphy so others on my team could review them remotely and without ftp/dropbox/etc.
0.5
delay in relation toconvert
- is that 0.5 seconds per frame - which would indicate 240 frames to be selected from the video.