Home

Bluesky ffmpeg mp4 Cropping And Muting Command

This is the ffmpeg command I use to process mp4s for posting on Bluesky1. It removes any black bars2 and removes the audio.

INPUT_PATH="/Users/alan/GIFs/factory/Johnny Mnemonic/mp4s/raw/jonny-mnemonic-getting-ready.mp4"
OUTPUT_PATH="/Users/alan/GIFs/factory/Johnny Mnemonic/mp4s/cropped/jonny-mnemonic-getting-ready.mp4"

ffmpeg -i "${INPUT_PATH}" -ss 0.1 \
-t 0.1 -vf cropdetect=limit=2 -f null - 2>&1 | \
awk '/crop/ { print $NF }' | \
tail -1 | xargs -I{CROP} \
ffmpeg -loglevel error -hide_banner \
-i "${INPUT_PATH}" \
-vf "{CROP}" -an -y "${OUTPUT_PATH}"

~ fin ~

Endnotes

Footnotes

1 ⤴
My Bluesky Account

If you want to follow me there

1 ⤴
Cropping With DaVinci Resolve

I generally crop in to different parts of a frame when making clips in DaVinci Resolve. This results in black bars replacing the areas I cropped out.