Last active
June 26, 2019 13:58
-
-
Save gotofritz/d8d1f478b8ee755723a197ed39597e2e to your computer and use it in GitHub Desktop.
Various ffmpeg commands
This file contains 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
# ffmpeg snippets | |
# ffmpeg-slowdown.sh: slow down all files in a directory | |
# ffmpeg-to-mp3.sh: convert all video files in a directory to mp3 | |
# handbrake-bulk.sh: convert all webm fils in a folder to mp4 |
This file contains 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
# slow down all files in a directory | |
# slowing down to 75.7575..% | |
# so the PTS factor is 1/757575758 = 1.32 | |
for file in /path/to/somewhere/* | |
do | |
ffmpeg -i "$file" -filter_complex "[0:v]setpts=1.32*PTS[v];[0:a]atempo=0.7575758[a]" -map "[v]" -map "[a]" "${file/GAMES/GAMES_SLOW}" -y | |
done |
This file contains 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
# convert all video files in a directory to mp3 | |
# using lame | |
for file in /path/to/somewhere/*.{mp4,webm}; do -i "$file" -c:a libmp3lame "${file/somewhere/mp3}.mp3"; done | |
# using ffmpeg | |
for file in /path/to/somewhere/*.{mp4,webm}; do ffmpeg -i "$file" -c:a libmp3lame "${file/somewhere/mp3}.mp3"; done |
This file contains 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
# convert all webm fils in a folder to mp4 | |
for file in /path/to/somewhere/**/*.webm | |
do | |
HandBrakeCLI -Z "Fast 1080p30" -i "$file" -o "${file%.webm}.mp4" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment