Sending videos can be a bandwidth's nightmare. This is where FFmpeg for Android comes to save us all !

FFmpeg Media Encoder#

FFmpeg Media Encoder is a great, great, great (did I say that it was great already) piece of Android application.

Here is why :

Source Running time File size Resolution
Original video 11 min. 1300 MB 1080 x 1920
Compressed video 11 min. 22 MB 270 x 480

In this example, I've turned a 1,3 GB video into a 22 MB one !

Adding presets to FFmpeg for Android#

  1. Click on the big ➕ (plus) button (under "Templates")
  2. Give it a name
    • Example : 480p
  3. Delete all the command line under it (Long press the command line, choose Select all, then delete it)
  4. Copy/paste one of the following presets !

⚠️ Please make sure that the "New 🔳" square checkbox is unchecked, as we will dynamically resize the video using our presets !

FFmpeg for Android presets#

You'll find here my current custom presets. Please mind that I'm using a strong video compression ratio (-crf 32), as I found that mobile videos doesn't need a high quality such as 4K. But of course, feel free to decrease it to get a better quality (but a larger file size !).

480p + vbr audio#

-vf scale=-2:480 -c:v libx264 -crf 32 -c:a libfdk_aac -vbr 1 -ac 1

Details (for the nerds we are) :

Param Description
-vf scale=-2:480 Dynamically resizing the video while keeping the ratio
-c:v libx264 x264, current video standard
-crf 32 Strong video Constant Rate Factor
-c:a libfdk_aac Fraunhofer FDK AAC audio codec library. Highest-quality AAC encoder
-vbr 1 Strong audio Variable Bit Rate mode
-ac 1 Mono channel. Remove it if you need stereo (larger file size cost)

480p + no audio#

-vf scale=-2:480 -c:v libx264 -crf 32 -an
Param Description
-an Not including any audio

480p + original audio#

-vf scale=-2:480 -c:v libx264 -crf 32 -c:a copy
Param Description
-c:a copy Including original audio (larger file size cost)

Credits#

The "FFmpeg is good for you" picture is a derivation from me (Jérémie CANAVESIO) licensed under CC BY-SA, derived from the "New logo of the FFmpeg project" by Hervé Flores.

This page was last edited on , generated from this markdown. Content is available under the Creative Commons CC BY-SA 3.0 License unless otherwise noted. This site is ad-free and contains no third party cookies or tracking, just as the Web should remain.
HomepageBack to top