Created
May 27, 2015 12:35
-
-
Save junmakii/1f57df94a24521bc454d to your computer and use it in GitHub Desktop.
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/bash | |
| #set -e | |
| FFMPEG=$(which ffmpeg) | |
| #CODEC=libvpx | |
| CODEC=libx264 | |
| PRESET=ultrafast | |
| #ACODEC=libvorbis # for webm | |
| #PRESET=fast | |
| #CRF=63 # For libvpx | |
| #CRF=51 # For libx264 | |
| CRF=30 | |
| for i in $1/*; do | |
| file_name=$(basename "$i") | |
| output="$2/${file_name}.mp4" | |
| echo "INFO: ${output}" | |
| if [ -f "${i}" ] && [ ! -f "${output}" ]; then | |
| ${FFMPEG} -i "$i" -c:v ${CODEC} -crf ${CRF} -preset ${PRESET} -b:v 1M -codec:a aac -b:a 128k -strict -2 -vf scale=320:-1 "${output}" | |
| fi | |
| done | |
| exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment