Skip to content

Instantly share code, notes, and snippets.

@KeigoAlexTanaka
Last active November 13, 2019 16:27
Show Gist options
  • Save KeigoAlexTanaka/7a2e9ed033ef6a78656fe1386556dcbe to your computer and use it in GitHub Desktop.
Save KeigoAlexTanaka/7a2e9ed033ef6a78656fe1386556dcbe to your computer and use it in GitHub Desktop.
DMG ffmpeg cheat sheet

#Get integrated loudness of one file

ffmpeg -nostats -i input.mp4 -filter_complex ebur128 -f null - > log.txt 2>&1

#Get integrated loudness of all files with extenstions that start with "m" within a directory

for i in .m;
do echo "${i%.*}" >> log.txt &&
ffmpeg -nostats -i "$i" -filter_complex ebur128 -f null - 2>&1 |
grep "I:" | tail -1 | awk '{print $1, $2, $3}' >> log.txt;
done

#Remove First 7 seconds of a video file

ffmpeg -i input.mov -ss 00:00:07 -c copy output.mov

#Batch Remove First 7 seconds of a video file

for i in .mov; do ffmpeg -i "$i" -ss 00:00:07 -c copy "${i%.}_UNSLATED.mov"; done

Transcode file as ProRes422HQ ffmpeg -i input.mov -c:v prores_ks -profile:v 3 output.mov

Batch Transcode files as ProRes422HQ for i in .mov; do ffmpeg -i "$i" -c:v prores_ks -profile:v 3 "${i%.}_1.mov"; done

#Transcode .mov as h264 vieweable in quicktime (20MB/s CBR)

ffmpeg -i input.mov -vcodec libx264 -pix_fmt yuv420p -x264-params "nal-hrd=cbr" -b:v 20M -minrate 20M -maxrate 20M -bufsize 40M output.mp4

Batch Transcode .mov as h264 vieweable in quicktime (20MB/s CBR)

for i in .mov; do ffmpeg -i "$i" -vcodec libx264 -pix_fmt yuv420p -x264-params "nal-hrd=cbr" -b:v 20M -minrate 20M -maxrate 20M -bufsize 40M "${i%.}_1.mp4"; done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment