Created
May 4, 2019 04:07
-
-
Save nicolaschan/4c5eafda84d43d627f52e68f93977897 to your computer and use it in GitHub Desktop.
Wrapper script to parallelize ffmpeg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Wrapper script to help parallelize batches of ffmpeg conversions to a single output format | |
| # For example, it can convert all your mp4 files to mp3 format in parallel (or any other formats ffmpeg supports) | |
| # By Nicolas Chan (MIT Licensed) | |
| # Usage: ./convert.sh FORMAT [INPUT_FILES...] | |
| # Example usage: ./convert.sh mp3 *.mp4 | |
| # Dependencies: | |
| # - ffmpeg: https://ffmpeg.org/ | |
| # - GNU parallel: https://www.gnu.org/software/parallel/ | |
| OUTPUT_FORMAT=$1 | |
| shift | |
| parallel "ffmpeg -i {} -f $OUTPUT_FORMAT {.}.$OUTPUT_FORMAT" ::: "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment