2 ms·
Here's how to do it with ffmpeg and ImageMagick: ffmpeg -i input.mp4 -vf "scale=1:ih" frames_%04d.png magick montage -mode concatenate -tile x1 frames_*.p
by xnx 2y ago
Here's how to do it with ffmpeg and ImageMagick:
ffmpeg -i input.mp4 -vf "scale=1:ih" frames_%04d.png
magick montage -mode concatenate -tile x1 frames_*.png "output.png"
- crtasm 2y agodoes it work for you on a film? 'magick' isn't a command on my install. I can run montage but get >bash: /usr/bin/montage: Argument list too long with 114394 files for a 1h20m film.
- xnx 2y agoYou'll need to install ImageMagick: https://imagemagick.org/script/download.php https://imagemagick.org/script/download.php
- crtasm 2y agoI have imagemagick installed, it no longer has a 'magick' command you run montage etc. directly. the problem is globbing that huge amount of files, so I'm wondering if you've tested the commands. >montage >Version: ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25
- xnx 2y agoAh. Good point. I only tried on a shorter video. Might have to concatenate batches of frames to get around that (much less elegant).
- deleted 2y ago[deleted]
- zimpenfish 2y agoProbably want a `-vf fps=1/n` in there (where n = number of seconds) to trim the film down to a manageable number of frames. (you'd ideally do some "clever" processing to combine a number of frames into a single colour strip but that's obviously more faff than just a simple `ffmpeg` call...)
- paulluuk 2y agoYou could also use something like https://github.com/Breakthrough/PySceneDetect https://github.com/Breakthrough/PySceneDetect to first split the video into camera shots, and then grab a single (or average) frame per shot, leading to a cleaner result.
- zimpenfish 2y agoI believe ffmpeg also has some scene detection stuff[0] but I've never had occasion to use it. [0] e.g. https://stackoverflow.com/questions/35675529/using-ffmpeg-how-to-do-a-scene-change-detection-with-timecode https://stackoverflow.com/questions/35675529/using-ffmpeg-ho...