Created
August 30, 2017 00:06
-
-
Save Kif11/aa892518707beb6608892a4c4daf653b to your computer and use it in GitHub Desktop.
Bash function for convert video for twitter upload
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
# Bash function for convert video for twitter upload. | |
# Place this function in your bash profile | |
# | |
# Usage: convert_for_twitter <file_path> | |
# | |
# Source http://pimentoso.blogspot.com/2016/01/convert-videos-for-twitter-using-ffmpeg.html | |
function convert_for_twitter { | |
# Make sure to install ffmpeg with libx | |
# brew install ffmpeg --with-libvpx | |
fullname=$1 | |
name=${fullname%\.*} | |
ext=${fullname#*\.} | |
ffmpeg -i ${fullname} -r 30 -c:v libx264 -b:v 1M -vf scale=640:-1 ${name}_twitter.mp4 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment