Fork me on GitHub
#clojure
<
2021-04-02
>
ghadi02:04:46

whoops meant to post that in a thread

zendevil.eth16:04:59

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?

p-himik16:04:05

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

zendevil.eth17:04:40

So use this?: https://clojuredocs.org/clojure.java.shell/sh. And what if the platform doesn’t have ffmpeg?

p-himik17:04:51

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.

lukasz17:04:34

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

borkdude18:04:42

could also look at https://github.com/cnuernber/avclj but this still requires the right native library to be installed :)

borkdude18:04:37

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

noisesmith18:04:31

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

borkdude18:04:52

Here is @U01LR7M2B7A automating video edits with babashka and ffmpeg: https://youtu.be/Tmgy57R9HZM same tricks apply to normal Clojure as well

👍 3
🙂 3
adam-james23:04:48

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