Skip to content

Instantly share code, notes, and snippets.

@Kif11
Created August 30, 2017 00:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kif11/aa892518707beb6608892a4c4daf653b to your computer and use it in GitHub Desktop.
Save Kif11/aa892518707beb6608892a4c4daf653b to your computer and use it in GitHub Desktop.
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