Last active
March 19, 2021 10:07
-
-
Save ypwu1/9495f7d6c0c4132000cc to your computer and use it in GitHub Desktop.
Bash Script for converting video files by using ffmpeg
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
#!/bin/bash | |
#brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid | |
#$1 directory $2 input type $3 output type | |
#ffmpeg -i input.flv -vcodec libvpx -acodec libvorbis output.webm | |
find "$1" -type f -name "*.$2" | while read -r file; do | |
filename=$(basename "$file" ".$2") | |
dirname=$(dirname "$file") | |
ffmpeg -i "$dirname/$filename.$2" "$dirname/$filename.$3" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for mp3 convertion
ffmpeg -i input.flac -ab 320k -map_metadata 0 -id3v2_version 3 output.mp3