Skip to content

Instantly share code, notes, and snippets.

@onixus74
Last active July 31, 2016 11:02
Show Gist options
  • Save onixus74/bf16d4d2756c9cc8caf7910eaa06b057 to your computer and use it in GitHub Desktop.
Save onixus74/bf16d4d2756c9cc8caf7910eaa06b057 to your computer and use it in GitHub Desktop.
#! /bin/bash
# More flags https://ffmpeg.org
# H264 sample : ffmpeg -i input -c:v libx264 -preset slow -crf 22 -c:a copy output.mkv
function convert_all_to_mp4() {
for file in *.mp4 ; do
local bname=$(basename "$file" .mp4)
local mp4name="$bname.mp4"
ffmpeg -i "$file" -c:v libx264 encoded/"$mp4name"
done
}
mkdir encoded
convert_all_to_mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment