How to Use FFmpeg in Android

eeddeellee
2 min readApr 20, 2022

@Thomas William

FFmpeg is an open-source project full of useful libraries for processing video/audio. You can change a file format, adjust quality through compression, extract audio, create GIFs, and more.

Why did I need this? I needed to build a feature that allows a user to create a video from a series of photos for my Collage app.

Step 1

Taner Sener has created a great ffmpeg-kit library that wraps the core ffmpeg code in various wrappers for use in iOS, Android, Flutter, etc.

implementation 'com.arthenica:ffmpeg-kit-full:4.5.1-1'
  • There are other packages. If you want the libx264 encoder, for example, you will want to instead go for the full-gpl package:
implementation 'com.arthenica:ffmpeg-kit-full-gpl:4.5.1-1'
  • There’s no need to build the binary yourself.

Step 2

Read the documentation on the README for the ffmpeg-kit project. It’s a great overview for various topics:

Step 3

Understand ffmpeg commands in more detail. If this is your first time you will want to read up on documentation or visit stackoverflow posts.

Useful links for getting started:

Step 4

Build something cool!

  • Give this post a clap or leave a comment.
  • If there’s enough interest, I’ll follow up with exactly how I built my feature for taking a list of image links, downloading them in separate threads, then using FFmpeg to combine them into a video slideshow.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Access the best member-only stories.

Support independent authors.

Listen to audio narrations.

Read offline.

Join the Partner Program and earn for your writing.