Fork me on GitHub

whoops meant to post that in a thread


Suppose I have a .mov video file of length 4 min. I want to crop 5 s section of the video file and create another file out of it. How do I do that?


I'd simply use ffmpeg, if the platform has it.


So use this?: And what if the platform doesn’t have ffmpeg?


Yep. Then, after recovering from the surprise, I would look for other avenues. :) Perhaps, there are pure Java libraries that deal with videos. Perhaps, the .mov container and the actual codec have some specialized implementations that you can use. Or maybe you can write something yourself.


Or you can use a web service like - it works great in some contexts and is pretty affordable.


could also look at but this still requires the right native library to be installed :)


I used avidemux to cut out some parts from an .mkv file. I use this for very basic editing of youtube videos I recorded with OBS


for audio/video codec I wouldn't rely on a language stdlib, there's a lot of variety and a lot of quirks, ffmpeg is hard to beat for programmability plus codec support


Here is @U01LR7M2B7A automating video edits with babashka and ffmpeg: same tricks apply to normal Clojure as well

👍 3
🙂 3

I give a +1 for ffmpeg if at all possible. If it’s a one off thing, I would recommend learning how to invoke ffmpeg directly. Save the one liners in a note somewhere and collect them over time. My ffmpeg + babashka work is glue applied to the one liners I’ve collected