{"id":3935,"date":"2016-07-31T13:50:30","date_gmt":"2016-07-31T03:50:30","guid":{"rendered":"http:\/\/www.vectorstorm.org\/?p=3935"},"modified":"2016-07-31T13:51:21","modified_gmt":"2016-07-31T03:51:21","slug":"video-conversion-twitter-tweet","status":"publish","type":"post","link":"https:\/\/www.vectorstorm.com.au\/2016\/07\/31\/video-conversion-twitter-tweet\/","title":{"rendered":"Video conversion for use on Twitter"},"content":{"rendered":"

\"ffmpeg-logo\"<\/a>I’ll confess;\u00a0 I’ve never figured out how to make animated gifs work well.\u00a0 They always wind up tiny, grainy, low-frame-rate, and huge to download.\u00a0 So it’s great that one can upload videos to Twitter directly, instead of having to convert them into those terrible animated gifs.\u00a0 But Twitter is very, very<\/em> fussy about what formats it will accept, and every time I need to do this, I lose half a day trying to remember the procedure for making Twitter accept my video files.<\/p>\n

I don’t know why it never occurred to me to do this before, but now that I’ve figured it out (again), I’m just going to post the answer here as a blog post, so that I can find it again the next time I want to tweet a video.\u00a0 And maybe it’ll help somebody else, too.<\/p>\n

I’ve been hopeless at getting my video editor to spit out video in a format which Twitter will accept, so (as is so often the case), a command-line tool has come to my rescue.\u00a0 I use ffmpeg<\/a> to handle the conversion from whatever format my video editor wants to use, into the very specific format that Twitter wants me to have used.<\/p>\n

Here’s the command that does the magic:<\/p>\n

ffmpeg -i INPUT_FILENAME -c:v libx264 -strict -2 OUTPUT_FILENAME.mp4<\/code><\/p>\n

That’s it! If you want, you can be fancy and specify image filters and other adjustments during the conversion.\u00a0 But if your video is already edited and scaled like you want it, and if all you need to do is to just make Twitter stop complaining that “one selected file is not an image”, then the above seems to reliably do that!<\/p>\n","protected":false},"excerpt":{"rendered":"

I’ll confess;\u00a0 I’ve never figured out how to make animated gifs work well.\u00a0 They always wind up tiny, grainy, low-frame-rate, and huge to download.\u00a0 So it’s great that one can upload videos to Twitter directly, instead of having to convert them into those terrible animated gifs.\u00a0 But Twitter is very, very fussy about what formats…<\/p>\n","protected":false},"author":1,"featured_media":3937,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[7],"tags":[],"jetpack_featured_media_url":"https:\/\/www.vectorstorm.com.au\/wp-content\/uploads\/2016\/07\/ffmpeg-logo.png","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/po9WK-11t","_links":{"self":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/3935"}],"collection":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/comments?post=3935"}],"version-history":[{"count":4,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/3935\/revisions"}],"predecessor-version":[{"id":3940,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/3935\/revisions\/3940"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/media\/3937"}],"wp:attachment":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/media?parent=3935"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/categories?post=3935"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/tags?post=3935"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}