Live data from Hacker News

Stack Videos Horizontally, Vertically, in a Grid With FFmpeg

ottverse.com

41–50 of 52 posts

Re: Stack Videos Horizontally, Vertically, in a Grid With FFmpeg

#41
post #8

I want to love ffmpeg but I honestly can't stand that I have to spend ~15 minutes looking for the magical incantation to get the result I want. After I find it, it works quickly and has good results. However, it really feels like video editing isn't something that should be done on the command line. Does anyone know of decent GUI frontends to ffmpeg?

if you are trying to think of ffmpeg as a traditional editor, then yes it is the wrong tool. if you want to programmatically process video/audio/etc, then it is a god send. if you have 100s, 1000s, or more videos that all have different encoding parameters (framesize,framerate,etc) where all of them need a logo or two or three prepended/appended, it would take human ops in a GUI environment forever to sort them and apply the correct logos. this is a piece of cake script-o-matically with ffprobe and ffmpeg. that's just a simple task barely even making ffmpeg get it's heartbeat up from idle. add text that comes up saying some version of "don't share this video" at timed intervals, add a studio bug, burn-in subtitles, etc. all in the same single command and hands-free. now we're talking time saving.

any new piece of software that doesn't get used frequently will have the same "what's the command again" situation. plus, the filter list is just a web page open next to your terminal away.

Re: Stack Videos Horizontally, Vertically, in a Grid With FFmpeg

#42
post #38

I've been using ffmpeg's xgrid filter (similar to hstack and vstack, but allows for arbitrary grids) to produce virtual choir videos for my church choir during covid. Here's an example: https://www.youtube.com/watch?v=Oeg9w8X6hrA . A lot of people are producing virtual choir videos right now, but I suspect few use a process similar to mine. I use Audacity to edit the audio separately, then crop the input videos using…

I would be interested in seeing your script if you don’t mind sharing

Re: Stack Videos Horizontally, Vertically, in a Grid With FFmpeg

#43
post #42
post #38

I've been using ffmpeg's xgrid filter (similar to hstack and vstack, but allows for arbitrary grids) to produce virtual choir videos for my church choir during covid. Here's an example: https://www.youtube.com/watch?v=Oeg9w8X6hrA . A lot of people are producing virtual choir videos right now, but I suspect few use a process similar to mine. I use Audacity to edit the audio separately, then crop the input videos using…

I would be interested in seeing your script if you don’t mind sharing

Sure!

Here's the face-aware crop script (somewhat quick and dirty - I haven't moved the output dimensions to CLI arguments yet): https://gist.github.com/carylee/62dbe19579ed9fa1714a3635ff0b...

Here's an example script for stitching the output video: https://gist.github.com/carylee/a13ae1a1ecb2f81c6536476f6dfb...

And here's the resulting video (text was added later by a different editor): https://www.youtube.com/watch?v=f7Pm4nLPslY

Re: Stack Videos Horizontally, Vertically, in a Grid With FFmpeg

#44

> videos with the same height and width Surely this remarkable tool has a command or filter to fit videos within a specified area, whether it be zoom, pan, shortest height, and the like

Of course it does, filters like scale, crop, pad etc come to mind

Re: Stack Videos Horizontally, Vertically, in a Grid With FFmpeg

#45
post #30

My favorite video editing discovery of the last couple of years is Da Vinci Resolve. It rivals Adobe Premiere in many ways. Plus it's cross-platform, and free: https://www.blackmagicdesign.com/products/davinciresolve/ It also supports the OpenFX plugin format: http://openfx.sourceforge.net/

I want to use Resolve so much but unfortunately for me every time I try to export an h264 mp4 I end up having video artifacts and audio artifacts. I tried every 16.x release as well. The source is fine and playback during the timeline is fine, it's only after it's been exported with Resolve. I'd get all of these little black pixel'y boxes that would appear and audio would end up having little pops and squeaks. Neithe…

What did Resolve support say when you contacted them about this reproducible issue?

Re: Stack Videos Horizontally, Vertically, in a Grid With FFmpeg

#46
post #30

Earlier quoted context omitted.

I want to use Resolve so much but unfortunately for me every time I try to export an h264 mp4 I end up having video artifacts and audio artifacts. I tried every 16.x release as well. The source is fine and playback during the timeline is fine, it's only after it's been exported with Resolve. I'd get all of these little black pixel'y boxes that would appear and audio would end up having little pops and squeaks. Neithe…

What did Resolve support say when you contacted them about this reproducible issue?

> What did Resolve support say when you contacted them about this reproducible issue?

I was never able to get an answer from support.

The only way to get support is to make a public forum post but they protect the forum by not allowing anyone to post without first getting whitelisted by a moderator.

I spent over an hour writing a post, adding video links to DropBox, a full list of steps, settings, everything.

Except I found out I wasn't able to add URLs in the post because my account was brand new so I had to remove the only important part of my post (the video proof of the artifacts and calling them out with exact time stamp references).

Also it took multiple days for my original post to get whitelisted and their forum sorts posts by date, but it doesn't treat "moderated_at" as a separate date so by the time my post was public on the forums it was already on like page 8 and got no replies.

So I asked them if I could bump my post and they said ok, but it took days for the moderator to whitelist the bumped post and the same problem happened again where I was nearly on page 10 before it was visible.

They also have no way to trial the paid version to see if the studio version's codec is better.

I spent honestly about 10-15 hours over a week trying to solve the issue by Googling everything and trying many different version combos with no luck.

I've never seen a company work so hard on treating potential paying customers so poorly. I'd still use the software if I could, but yeah, I have no way to even get in contact with support and after spending ~2 full working days on unsuccessfully solving the problem with no resolution in sight I gave up and stick with using Camtasia.

Re: Stack Videos Horizontally, Vertically, in a Grid With FFmpeg

#47

Is it also possible to undo a stack video ?

Assuming a 3840x2160 2x2 input

Top left: ffmpeg -i input.mov -vf "crop=1920:1080:0:0" out-tl.mp4

Top right: ffmpeg -i input.mov -vf "crop=1920:1080:1920:0" out-tr.mp4

Bottom left: ffmpeg -i input.mov -vf "crop=1920:1080:0:1080" out-bl.mp4

Bottom right: ffmpeg -i input.mov -vf "crop=1920:1080:1920:1080" out-br.mp4

Details at

https://www.ffmpeg.org/ffmpeg-filters.html#crop

Re: Stack Videos Horizontally, Vertically, in a Grid With FFmpeg

#48
post #43
post #42

Earlier quoted context omitted.

I would be interested in seeing your script if you don’t mind sharing

Sure! Here's the face-aware crop script (somewhat quick and dirty - I haven't moved the output dimensions to CLI arguments yet): https://gist.github.com/carylee/62dbe19579ed9fa1714a3635ff0b... Here's an example script for stitching the output video: https://gist.github.com/carylee/a13ae1a1ecb2f81c6536476f6dfb... And here's the resulting video (text was added later by a different editor): https://www.youtube.com/watch…

Nice, this was super timely as I was literally building the same thing. And I had just reached the part where I was annoyed that all the submitted videos had different shapes and sizes which as you know would be tedious to correct manually.

You for sure saved me some time!

Re: Stack Videos Horizontally, Vertically, in a Grid With FFmpeg

#49

Earlier quoted context omitted.

Sorry to hijack, but whats the Crash video in the lower left of the demo?

It's a Japanese crash bandicoot commercial https://www.youtube.com/watch?v=kEKa1x0udMA https://www.youtube.com/watch?v=h3CevTDQyxo#t=1m58s

THANK YOU!

Re: Stack Videos Horizontally, Vertically, in a Grid With FFmpeg

#50

Earlier quoted context omitted.

I did some work on making CTF-style challenge videos using filter_complex to try to get folks to play around with using ffmpeg filters in scripts. I barely scratched the surface but it ended up being a lot of fun.

I'd be very interested in doing a filter_complex CTF challenge. Are you willing to share what you worked on?

It's specific to an event that passed and won't do you much good, but like I said I barely started.

I've had the idea to turn it into something bigger, but I lack the time.

Post reply on HN