7 ms·
Stack Videos Horizontally, Vertically, in a Grid With FFmpeg
- doomlaser 6y agoMy 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/ https://www.blackmagicdesign.com/products/davinciresolve/ It also supports the OpenFX plugin format: http://openfx.sourceforge.net/ http://openfx.sourceforge.net/
- renewiltord 6y agoWoah, it's cross platform and has Linux support?! Thanks for sharing!
- renewiltord 6y agoOh, it sadly requires `sudo` but only tells me it's for `/usr/bin/env`. Not that I'm security paranoid or anything but I'm afraid it'll bork my system by overwriting random things on my filesystem with root stuff. Gonna have to pass, sadly.
- linschn 6y agochroot may help you. Or containers.
- 867-5309 6y agoyou could try running it in a sandbox
- jcelerier 6y agohm, does not seem to require sudo here on arch ?
- bonoboTP 6y agoJust run the installer in the terminal as `./DaVinci_Resolve_16.2.7_Linux.run --nonroot`.
- renewiltord 6y agoOh brilliant! Thank you!
- renewiltord 6y agoJust for posterity, this is the command I ran: ./DaVinci_Resolve_16.2.7_Linux.run --nonroot -C ~/Programs/DaVinci_Resolve/ The following still happens: Creating Common Data Dir : /var/BlackmagicDesign/DaVinci Resolve mkdir: cannot create directory ‘/var/BlackmagicDesign’: Permission denied It then crashed on the first few runs but then started. Cool tool, though!
- sneak 6y agoMajor bonus for Resolve: it's explicitly differentiated from Premiere/AE by not being subscriptionware: it has a single one-time cost per version. You buy it once for $300 and then you have that version forever. Meanwhile, the Adobe Creative Cloud is >$500/year, every year.
- dagmx 6y agoBetter yet it's free with very few limitations
- Fillipoman 6y agoI second Resolve being excellent. I still run into crashes now and then and have had pains getting some OFX plugins to not fail-- mainly the deflicker one which causes the memory usage to skyrocket and cap out during rendering.
- a0zU 6y agoHi Da Vinci Resolve marketing employee:)
- kristopolous 6y agoHe's an indy-game developer. Click through his profile.
- nickjj 6y agoI 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. Neither of these things ever happened using Camtasia with the same hardware (even after 500+ videos) but it happens in every single video in Resolve with every export format and setting. This is only dealing with 1080p too. These are just simple recordings of my desktop with a webcam on the bottom right. Recorded as an mkv with OBS (which I still do even when editing with Camtasia). It's a shame because Resolve is really good for editing, and video editing is the only reason I stick with Windows.
- floatingatoll 6y agoWhat did Resolve support say when you contacted them about this reproducible issue?
- nickjj 6y ago> 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.
- Everlag 6y agoIf you want to do fun things with ffmpeg as a cli, most roads end at filter_complex[0]. You can get some truly impressive results at the cost of maintaining really intricate commands. There's also added value when onboarding a new teammate and seeing their eyes open when they find some of the commands you maintain... Once you grok filter_complex, it becomes a lot easier to understand how people get very complex results out of ffmpeg. Of less renown but worthy of a mention is the tee[1] muxer. It lets you take the same resulting input and pass it to different destinations. Incredibly handy, ie, for outputting DASH, HLS, and a regular ol mp4 from the same command WITHOUT having to redo the scaling or anything else that was in the filter_complex. [0] https://ffmpeg.org/ffmpeg-filters.html#Filtergraph-syntax-1 https://ffmpeg.org/ffmpeg-filters.html#Filtergraph-syntax-1 [1] https://ffmpeg.org/ffmpeg-formats.html#Examples-12 https://ffmpeg.org/ffmpeg-formats.html#Examples-12 (links to examples which is where you should start, scroll up to see docs)
- rytill 6y agoWhere do you work that complex ffmpeg flows are part of the modus operandi?
- nielsole 6y agoFrom profile > Engineer at Cloudflare doing video things.
- busterarm 6y agoI 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.
- mmcwilliams 6y agoI'd be very interested in doing a filter_complex CTF challenge. Are you willing to share what you worked on?
- deleted 6y ago[deleted]
- ladberg 6y agoI 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?
- joshschreuder 6y agoAvidemux is a good quick and dirty editor with a fair bit of power http://fixounet.free.fr/avidemux/ http://fixounet.free.fr/avidemux/
- anovikov 6y agoMain trick is that ffmpeg is not really a command line tool. It's a set of libraries - libav* - built in C which lets you do absolutely everything you want with video/media files (and somewhat less successfully, with streaming data too, while for modern applications such as webrtc, ffmpeg sucks). Command line tool is just a (rather lame) wrapper for (some) of those features.
- cm2187 6y agoIf you have one video to edit I agree. As soon as you are talking batch processing, having this massively powerful, free, self-contained executable that is compatible with pretty much any video format on earth is a god bless. I usually only use a handful of features repeatedly, so I tend to creat some UI for myself to generate the commands. For instance for editing movies I download, removing audio streams I don’t want, adding subtitles, changing defaults, overwriting metadata (title, etc). But dealing with all features would be a challenge. Handbrake is one attempt I can think of, but it is still kind of specialised.
- ohthehugemanate 6y agoMost any video program in linux uses ffmpeg libraries in the back end. I like kdenlive, myself. But I don't know of anything that sets out to put a gui on all the capabilities of ffmpeg
- teddyh 6y ago
- raymond_goo 6y agoIs it also possible to undo a stack video ?
- evan_ 6y agoLike, crop the video? Yes
- ponderingfish 6y agoCropping is the only way I can think of, because, it merges the 4 videos (or how many ever in the stack) into a new video frame.
- iso1631 6y agoAssuming 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 https://www.ffmpeg.org/ffmpeg-filters.html#crop
- greggman3 6y agoI wrote an Electron app (started as just a local web server) to basically do this. The UI is kind of like iPhotos or any other photo viewer except you can split view as many times as you want and views something different in each pane. Here's a short clip of 8 videos playing https://www.youtube.com/watch?v=nK52DY6sq9U https://www.youtube.com/watch?v=nK52DY6sq9U or a better video starting from the basic UI, starting videos, zooming them to "cover" mode, and splitting and starting more https://www.youtube.com/watch?v=gH9h3XGkFmc https://www.youtube.com/watch?v=gH9h3XGkFmc Here's the app https://mopho-v.org https://mopho-v.org You can also open multiple windows so if you have multiple monitors you can easily run one more videos per monitor until your computer can't keep up. note: It's pretty alpha, several bugs, but I've used it several times a week, living with it's bugs, for a couple of years. Not sure I can justify fixing it up as I'm the only person using it AFAICT but maybe it will give others inspiration. The code I'm sure is a mess. It was my first React app (a reason to give React a try). It also works pretty good in VR as in on Oculus Rift I open my desktop and manipulate videos and splits with the touch controllers as a mouse. No particular VR support, just saying that most of the features have clickable buttons so it's easy to use in VR. A big limit is being Electron it can only play what Chromium plays (mp4, mkv, vp8, vp9). I've been wanting to look info FFMpeg in wasm to add support for other formats, saw the post yesterday someone had done something. I figured it might be too slow and that figuring out how to sync audio might be painful but it's still on my magical "someday I might" to do list. Since Chromium already uses ffmpeg it might be easier to just patch Electron to use ffmpeg with all features enabled instead of just the few that ship with Chrome.
- therealx 6y agoSorry to hijack, but whats the Crash video in the lower left of the demo?
- greggman3 6y agoIt's a Japanese crash bandicoot commercial https://www.youtube.com/watch?v=kEKa1x0udMA https://www.youtube.com/watch?v=kEKa1x0udMA https://www.youtube.com/watch?v=h3CevTDQyxo#t=1m58s https://www.youtube.com/watch?v=h3CevTDQyxo#t=1m58s
- kristopolous 6y agoI was already doing this but recently I've started looking into obs (https://obsproject.com/ https://obsproject.com/) as a possible alternative. I can for instance, add and remove things and move them around the screen with a mouse, without having to restart things or do any math - sounds way more convenient.
- ahrjay 6y agoI did something similar using filter_complex to create a 14x14 grid showing 196 days of earth full disc shots for my earthin24 Twitter bot. It's truly impressive what ffmpeg can do https://ryanseddon.com/javascript/an-earth-mosaic/ https://ryanseddon.com/javascript/an-earth-mosaic/
- gnicholas 6y agoWhen I was making a Kickstarter video, I used Keynote to arrange videos side by side, mask them, and change landscape/portrait orientation. The output is surely not high quality, but if you are already experienced with Keynote and don't need 4k, it's actually a pretty handy tool. It did the trick for me (my Kickstarter got funded!) and I later wrote a blog post about how to use Keynote to add special effects to video on the cheap. 1: https://medium.com/hackernoon/adding-visual-effects-to-your-kickstarter-video-on-the-cheap-thanks-to-keynote-eb69920d90eb https://medium.com/hackernoon/adding-visual-effects-to-your-...
- 867-5309 6y ago> 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
- iso947 6y agoOf course it does, filters like scale, crop, pad etc come to mind
- caryme 6y agoI'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 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 a face-aware cropping script (which uses https://github.com/ageitgey/face_recognition https://github.com/ageitgey/face_recognition), then generate a video grid using ffmpeg + xgrid.
- iamstef 6y agoI would be interested in seeing your script if you don’t mind sharing
- caryme 6y agoSure! 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/62dbe19579ed9fa1714a3635ff0bdec7 https://gist.github.com/carylee/62dbe19579ed9fa1714a3635ff0b... Here's an example script for stitching the output video: https://gist.github.com/carylee/a13ae1a1ecb2f81c6536476f6dfbe895 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 https://www.youtube.com/watch?v=f7Pm4nLPslY
- iamstef 6y agoNice, 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!