Live data from Hacker News

Make timelapses easily using FFmpeg

news.ycombinator.com

1–10 of 80 posts

Re: Make timelapses easily using FFmpeg

#2
ffmpeg is such a great tool!

Be aware that -pattern_type glob is not supported on Windows, though, iirc. A workaround is to name your jpegs with consecutive numbers (not necessarily starting at 0) and use a pattern with a counter placeholder in it instead.

Re: Make timelapses easily using FFmpeg

#3
post #2

ffmpeg is such a great tool! Be aware that -pattern_type glob is not supported on Windows, though, iirc. A workaround is to name your jpegs with consecutive numbers (not necessarily starting at 0) and use a pattern with a counter placeholder in it instead.

Hmm, I wonder why `-pattern_type glob` doesn't work on Windows. Perhaps it is something that could easily be programmed into the source code?

Re: Make timelapses easily using FFmpeg

#4
I recently wrote a blog post about doing this to create timelapses of Rimworld colonies. I didn’t realize -pattern_type glob didn’t work on windows though… I’ll have to update it.

Also, an assumption in your command is that all the images are the same aspect ratio. If they’re not, you can use this to dynamically pad it out with black bars on either size:

‘-vf "scale=1920:1080:force_original_aspect_ratio=decrease:eval=frame,pad=1920:1080:-1:-1:eval=frame"’

https://mpeyton.com/posts/rimworld_timelapse_ffmpeg/

Re: Make timelapses easily using FFmpeg

#5
post #2

ffmpeg is such a great tool! Be aware that -pattern_type glob is not supported on Windows, though, iirc. A workaround is to name your jpegs with consecutive numbers (not necessarily starting at 0) and use a pattern with a counter placeholder in it instead.

Obligatory humor: https://youtu.be/9kaIXkImCAM

Note of support: ffmpeg supported many of the transcoding needs of my former employer back in 2007, being a "friendly" tool to the team. Yes it had/s issue. Being open source gave us a lifeline, to be able to fix our own stuff, and build up our video and audio live streaming and video watching white label service.

Re: Make timelapses easily using FFmpeg

#6
post #2

ffmpeg is such a great tool! Be aware that -pattern_type glob is not supported on Windows, though, iirc. A workaround is to name your jpegs with consecutive numbers (not necessarily starting at 0) and use a pattern with a counter placeholder in it instead.

Hmm, I wonder why `-pattern_type glob` doesn't work on Windows. Perhaps it is something that could easily be programmed into the source code?

If I were yo guess, it might be using the GNU libc (or compatible) glob functionality under the hood.

Re: Make timelapses easily using FFmpeg

#7
post #2

ffmpeg is such a great tool! Be aware that -pattern_type glob is not supported on Windows, though, iirc. A workaround is to name your jpegs with consecutive numbers (not necessarily starting at 0) and use a pattern with a counter placeholder in it instead.

Also be aware of this infamous “bug”

> The sortedness of glob.glob's output is platform-dependent.

https://bugs.python.org/issue33275#msg315254

https://pubs.acs.org/doi/10.1021/acs.orglett.9b03216

Re: Make timelapses easily using FFmpeg

#8
post #2

ffmpeg is such a great tool! Be aware that -pattern_type glob is not supported on Windows, though, iirc. A workaround is to name your jpegs with consecutive numbers (not necessarily starting at 0) and use a pattern with a counter placeholder in it instead.

wsl --cd=%cd% ffmpeg -framerate 30 -pattern_type glob -i '*.JPG' -c:v libx264 -r 30 -pix_fmt yuv420p timelapse.mp4

Re: Make timelapses easily using FFmpeg

#9
Nice, thanks! I tried using ffmpeg for a minor video editing task I had a few months ago - just a cut, crop, rescale, and volume adjust. I've tried a few of the mainstream GUI video editing tools, and IMO, they all have incomprehensible UIs, are way too bloated, and usually far too expensive for what I'm trying to do. FFmpeg may not be dead simple, but I find it much easier to skim the command line flag list to figure out how to do what I want. And once I do, I can save down a handful of useful sets of flags and refer to them next time. Cheers to ffmpeg, one of the kings of FOSS! If you ever feel the need to do any kind of video conversion or editing, definitely try to do it in ffmpeg first.

Re: Make timelapses easily using FFmpeg

#10
post #2

ffmpeg is such a great tool! Be aware that -pattern_type glob is not supported on Windows, though, iirc. A workaround is to name your jpegs with consecutive numbers (not necessarily starting at 0) and use a pattern with a counter placeholder in it instead.

Correct, most annoying bug there is.
Post reply on HN