GithubHelp home page GithubHelp logo

isabella232 / ffmpegmediametadataretriever Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xmartlabs/ffmpegmediametadataretriever

0.0 0.0 0.0 1.56 GB

FFmpegMediaMetadataRetriever provides a unified interface for retrieving frame and meta data from an input media file.

Shell 1.40% C++ 0.75% C 96.07% Java 1.70% Makefile 0.06% CMake 0.03%

ffmpegmediametadataretriever's Introduction

FFmpegMediaMetadataRetriever

View the project page here.

Donations

Donations can be made via PayPal:

This project needs you! If you would like to support this project's further development, the creator of this project or the continuous maintenance of this project, feel free to donate. Donations are highly appreciated. Thank you!

PayPal

Overview

FFmpegMediaMetadataRetriever is a reimplementation of Android's MediaMetadataRetriever class. The FFmpegMediaMetadataRetriever class provides a unified interface for retrieving frame and meta data from an input media file and uses FFmpeg as its backend.

This project uses FFmpeg version 4.2.2.

Key Features:

Supported protocols:

  • file, http, https, mms, mmsh and rtmp

Supported formats (audio and video):

  • aac, acc+, avi, flac, mp2, mp3, mp4, ogg, 3gp and more!

Additional support for:

  • ICY Metadata (SHOUTcast metadata)

Demo Application

If you would like to try FFmpegMediaMetadataRetriever you can do so using the Demo Application

Using FMMR in your application (Android Studio)

Add the following maven dependency to your project's build.gradle file:

dependencies {
    implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-core:1.0.15'
    implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-native:1.0.15'
}

Optionally, to support individual ABIs:

dependencies {
    implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-core:1.0.15'
    implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-native-armeabi-v7a:1.0.15'
    implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-native-x86:1.0.15'
    implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-native-x86_64:1.0.15'
    implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-native-arm64-v8a:1.0.15'
}

or, if your application supports individual architectures extract the appropriate AAR file into you projects "libs" folder:

Prebuilt AARs

(with HTTPS support)

Prebuilt AARs with HTTPS

Demo Application

A sample application that makes use of FFmpegMediaMetadataRetriever can be downloaded here. Note: The sample application is compiled with support for ALL available formats. This results in a larger library and APK. FFmpeg can be recompiled with a subset of codecs enabled for those wanting a smaller size.

Installation

FFmpegMediaMetadataRetriever relies on FFmpeg and native code. The build process is complex and may be confusing for those unfamiliar the Android NDK. For this reason I've precompiled AARs created by the build process and checked them in here. The modules are also included with the library. If you don't want to build the modules you can simple unzip the prebuilt ones and copy them to your projects "libs" folder. (Note: copy them to YOUR projects "libs" folder, NOT the "libs" folder located in FFmpegMediaMetadataRetriever/fmmr-library. Once this step is complete you can use the library (See: Installation in Eclipse (Kepler)). If you want to compile the modules yourself follow the Ant instructions listed below before attempting to use the library.

Download and install the Android SDK. Download the Android NDK. Clone/Download/Fork the repo through GitHub or via (read-only)

git clone https://github.com/wseemann/FFmpegMediaMetadataRetriever.git

Android Studio (Gradle))

Note: The build instructions and scripts assume you are running Unix or Linux. Building on other operating systems is currently not supported.

Execute the following in the FFmpegMediaMetadataRetriever/fmmr-library/ directory (assuming /path/to/android_sdk/tools is in your PATH):

android update project --path .

Open the newly created local.properties file and add the following lines:

ndk.dir=<path to NDK>

where is the path to your Android NDK, for example:

ndk.dir=/home/wseemann/Android/android-ndk-r20

Note: If you wish to enable https support (for use with API 8+ only) navigate to FFmpegMediaMetadataRetriever/fmmr-library/ and execute

ant build-ffmpeg-with-ssl

To compile the library in Android Studio, highlight library in the project explorer and run Build->Make Module 'library'. This will also build the native FFmpeg binaries.

Usage

Sample code:

FFmpegMediaMetadataRetriever mmr = new FFmpegMediaMetadataRetriever();
mmr.setDataSource(mUri);
mmr.extractMetadata(FFmpegMediaMetadataRetriever.METADATA_KEY_ALBUM);
mmr.extractMetadata(FFmpegMediaMetadataRetriever.METADATA_KEY_ARTIST);
Bitmap b = mmr.getFrameAtTime(2000000, FFmpegMediaMetadataRetriever.OPTION_CLOSEST); // frame at 2 seconds
byte [] artwork = mmr.getEmbeddedPicture();

mmr.release();

FFmpeg

This software uses code of FFmpeg licensed under the LGPLv2.1 and its source can be downloaded here.

License

FFmpegMediaMetadataRetriever: A unified interface for retrieving frame 
and meta data from an input media file.

Copyright 2020 William Seemann

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

ffmpegmediametadataretriever's People

Contributors

f7deleon avatar wseemann 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.