Skip to content

Instantly share code, notes, and snippets.

@omgitsraven
Created January 31, 2018 15:11
Show Gist options
  • Save omgitsraven/baa0c5721df07c9bc226a8cfcbd7a136 to your computer and use it in GitHub Desktop.
Save omgitsraven/baa0c5721df07c9bc226a8cfcbd7a136 to your computer and use it in GitHub Desktop.
FFMPEG command to produce MP4s that Twitter won't reject
ffmpeg -i %1 -ac 2 -pix_fmt yuv420p -vsync 2 -r 60 %1.mp4
@omgitsraven
Copy link
Author

In my experience, there are three things that can trip twitter up when receiving a video file:

  • there must be no more than 2 audio channels
  • the chroma subsampling must be 420
  • the FPS must be no higher than 60

This takes care of all three of those requirements.

You could also tune the quality settings of course, but twitter clobbers video quality so heavily anyway that it hardly seems worth bothering.

To use on Windows:

  1. Install FFMPEG
  2. Save this .bat file somewhere on your machine
  3. Drag+drop your video file onto the .bat file
  4. Attach to your tweet the new file it made (with the extra .mp4 on the end of its filename).

To use on another platform (or without downloading a .bat file) just run the command on your command line, manually substituting your input file path where it says %1.

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