Created
April 21, 2020 03:55
-
-
Save lucidbeaming/3e17ecb7eeb753438fc251a6c01f0e6f to your computer and use it in GitHub Desktop.
ffmpeg video - batch scale, normalize, OS X compatible and output to h264 .mp4 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Looks for all files with .mp4 extension. Scales to fit width while matching height. | |
# Fills the entire file area. Normalizes audio level and sets 44100 rate. | |
# Converts to yuv420p colorspace for Mac OS X compatibility. Outputs to subfolder named "out". | |
for i in *.mp4; do | |
ffmpeg -i "$i" -vf "scale=-1:480,crop=640:480,fps=fps=30" -filter:a loudnorm -ar 44100 -c:a aac -b:a 128k -c:v libx264 -crf 18 -preset veryfast -pix_fmt yuv420p "out/$i" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment