Skip to content

Instantly share code, notes, and snippets.

@hernamesbarbara
Created November 9, 2023 00:11
Show Gist options
  • Save hernamesbarbara/d702c48ea67ec0a8a438f0611f042c85 to your computer and use it in GitHub Desktop.
Save hernamesbarbara/d702c48ea67ec0a8a438f0611f042c85 to your computer and use it in GitHub Desktop.
convert_webm_to_mp4() {
for file in *.webm; do
if [[ ! -e "$file" ]]; then
echo "No .webm files found in the current directory."
return 1
fi
local newfile="${file/.webm/.mp4}"
ffmpeg -i "$file" -c:v libx264 -preset fast -c:a aac "$newfile" && echo "$file converted to $newfile"
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment