News for hackers. Stuff that matters.
Re:Ffmpeg-Python: Python bindings for FFmpeg – with complex ... by jokoon on Monday December 30, 2019 @07:07AM (#21912757)
Amazing!

I spent 3 days to write a python script, 2 weeks ago, to generate a FFMPEG command that is able to take N videos, of different sizes, duration and framerate, and use the xstack filter to generate a tiled video, with a 2x2 layout.

Of course one problem was generating 4 series of video, to have the smallest period of time at the end. I solved this pretty easily, although there are more optimal ways of doing it.

One issue to consider is that I had to re-encode all video to a same framerate AND add a proper letterbox (I wasted a lot of time on this), but the filter system handled this pretty well since it worked in a way that did not buffer too much.

Also had to mix the audio, and I did this step separately, and there are no desync. This was very easy!

The generated command was pretty gnarly but I made it work for 30+ videos!

I wanted to try a 4x4, with reddit mp4 short gifs (I have about 500 of them), but powershell stopped me because the ffmpeg command was so large. So I gave up! I wonder if those bindings solve that problem. Nevertheless I should obviously use a unix shell to solve this command length problem.

There are no comments on this comment yet.