Skip to content

Instantly share code, notes, and snippets.

@SpacyRicochet
Last active December 20, 2015 20:59
Show Gist options
  • Select an option

  • Save SpacyRicochet/6193870 to your computer and use it in GitHub Desktop.

Select an option

Save SpacyRicochet/6193870 to your computer and use it in GitHub Desktop.
Interesting scripts for video and audio conversion
// For the directory 'en' find all m4v files and combine add the audio of other languages.
find * -name "*.m4v" -exec ffmpeg -i "{}" -i "../de/{}" -i "../fr/{}" -i "../nl/{}" -i "../sp/{}" -map 0 -map 1:a:0 -map 2:a:0 -map 3:a:0 -map 4:a:0 -metadata:s:a:0 language=eng -metadata:s:a:1 language=deu -metadata:s:a:2 language=fra -metadata:s:a:3 language=nld -metadata:s:a:4 language=spa -y "../all/{}" \;
// Make all audio of every m4v file mono and lower the sound bit rate to 48k. Change the size.
find * -name "*.mp4" -exec ffmpeg -i "{}" -map 0 -ac 1 -ab 48k -s 504x896 -y "../all_lq/{}" \;
// Use the following syntax to parse other extensions. Taken from: http://stackoverflow.com/a/8107281/571461
find -L . -type f -name "*.mp4" -exec sh -c 'ffmpeg -i ${1%.mp4}.wav' _ {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment