This is my tool for prepping MP4s for using on websites. It removes the audio and any black bars on the video. I set this up because I make a lot of clips in DaVinci Resolve and it's a pain to resize the output in it when I crop in.
-
This is a Rust script that you should be able to run from the command line (I'm not sure if you have to have "nightly" installed anymore or not, but you might). Do a
chmod u+x scrub_mp4s.rs
on it to make it executable with./scurb_mp4s.rs
-
The process starts in the
source_dir
. Update it to point to the directory you want to process -
It searches recursively for any
.mp4
files in thesoruce_dir
recursively. -
If it finds an
.mp4
and that file is in a directory namedraw
it checks to see if there's a corresponding.mp4
with the same name in acropped
directory (that's a sibling ofraw
)
That is, if it finds:
~/some/videos/example/raw/FILENAME.mp4
it looks for
~/some/videos/example/cropped/FILENAME.mp4
- If there's no
cropped/FILENAME.mp4
file it makes it
A crop for a video might start out like this:
After running it through the process, this is the clip:
- Create the
cropped
directory if it doesn't already exist