Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
twitter ffmpeg
ffmpeg -i -vcodec libx264 -vf 'scale=640:trunc(ow/a/2)*2' -acodec aac -vb 1024k -minrate 1024k -maxrate 1024k -bufsize 1024k -ar 44100 -strict experimental -r 30 out.mp4
Copy link

brandonprry commented Oct 1, 2019

Foone's command works for me.

Copy link

galaxy001 commented Oct 20, 2019

-t 2:20 is also needed.

Copy link

hertzsprung commented Mar 30, 2020

It's also necessary to round to an even number of pixel dimensions:

ffmpeg -i -vcodec libx264 -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" -pix_fmt yuv420p -strict experimental -r 30 -t 2:20 -acodec aac -vb 1024k -minrate 1024k -maxrate 1024k -bufsize 1024k -ar 44100 -ac 2 out.mp4

Copy link

Pomax commented Oct 27, 2020

Also, based on Twitter's JSON response, the aspect ratio can only be 3:1 max

Copy link

nhed commented Jul 3, 2021

I definitely needed a -t as I was trying to send a 5 second video (using the standard UI) and the screen error was generic ... had to examine the JSON in the response to know they thought it was too short.

Copy link

tinevez commented Jan 5, 2022

@Pomax remark fixed my issue. The aspect ratio was the problem in my case but nothing tells it is the case.

Copy link

olleharstedt commented May 11, 2022

@hertzsprung This one worked for me

Copy link

warp16 commented Jul 31, 2022

@hertzsprung thank you, your command worked for a troublesome DVD rip.

Copy link

DangerBlack commented Sep 2, 2022

@hertzsprung This one worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment