Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bash function for convert video for twitter upload
# 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