Git Product home page Git Product logo

ffmpeg-android's Introduction

FFmpeg-Android

Download

FFMpeg/FFprobe compiled for Android. Execute FFmpeg & FFprobe commands with ease in your Android project.

About

This project is a continued fork of FFmpeg Android Java by WritingMinds. This fork fixes the CANNOT LINK EXECUTABLE ffmpeg: has text relocations issue on x86 devices along with some other bugfixes, new features and the newest FFmpeg builds.

Architectures

Bravobit FFmpeg-Android runs on the following architectures:

  • armv7
  • armv7-neon
  • armv8
  • x86
  • x86_64

FFmpeg build

FFmpeg in this project was built with the following libraries:

  • x264 r2851 ba24899
  • libpng 1.6.21
  • freetype2 2.8.1
  • libmp3lame 3.100
  • libvorbis 1.3.5
  • libvpx v1.6.1-1456-g7d1bf5d
  • libopus 1.2.1

Features

  • Uses the latest FFmpeg release n3.4.1
  • Uses native CPU capabilities on ARM architectures
  • FFprobe is bundled in this library too
  • Enabled network capabilities

Usage

Getting Started

Include the dependency

dependencies {
    implementation 'nl.bravobit:android-ffmpeg:1.1.1'
}

Check if FFmpeg is supported

To check whether FFmpeg is available on your device you can use the following method.

if (FFmpeg.getInstance(this).isSupported()) {
  // ffmpeg is supported
} else {
  // ffmpeg is not supported
}

This is all you have to do to load the FFmpeg library.

Run FFmpeg command

In this sample code we will run the ffmpeg -version command.

FFmpeg ffmpeg = FFmpeg.getInstance(context);
try {
  // to execute "ffmpeg -version" command you just need to pass "-version"
  ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler() {

    @Override
    public void onStart() {}

    @Override
    public void onProgress(String message) {}

    @Override
    public void onFailure(String message) {}

    @Override
    public void onSuccess(String message) {}

    @Override
    public void onFinish() {}

  });
} catch (FFmpegCommandAlreadyRunningException e) {
  // Handle if FFmpeg is already running
}

Check if FFprobe is supported

To check whether FFprobe is available on your device you can use the following method.

if (FFprobe.getInstance(this).isSupported()) {
  // ffprobe is supported
} else {
  // ffprobe is not supported
}

This is all you have to do to load the FFprobe library.

Run FFprobe command

In this sample code we will run the ffprobe -version command.

FFprobe ffprobe = FFprobe.getInstance(context);
try {
  // to execute "ffprobe -version" command you just need to pass "-version"
  ffprobe.execute(cmd, new ExecuteBinaryResponseHandler() {

    @Override
    public void onStart() {}

    @Override
    public void onProgress(String message) {}

    @Override
    public void onFailure(String message) {}

    @Override
    public void onSuccess(String message) {}

    @Override
    public void onFinish() {}

  });
} catch (FFprobeCommandAlreadyRunningException e) {
  // Handle if FFprobe is already running
}

Special Thanks To

ffmpeg-android's People

Contributors

brianvdb avatar mateuszitelli avatar stanvanheumen avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.