Skip to content

Instantly share code, notes, and snippets.

@ErykDarnowski
Last active June 12, 2024 20:54
Show Gist options
  • Save ErykDarnowski/d23434e861b865ae1f72dcf7f79f8dab to your computer and use it in GitHub Desktop.
Save ErykDarnowski/d23434e861b865ae1f72dcf7f79f8dab to your computer and use it in GitHub Desktop.
`ffmpeg` convert all files of extension to different extension

This snippet will (in current dir):

  1. Convert all files of $first_ext extension to ones with $second_ext ones
  2. Remove all files with the $first_ext extension
first_ext="webm"
second_ext="mp4"
for i in *.$first_ext; do ffmpeg -i "$i" "${i%.*}.$second_ext"; done; for i in *.$first_ext; do rm "$i"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment