Giter Site home page Giter Site logo

tanersener / mobile-ffmpeg Goto Github PK

View Code? Open in Web Editor NEW
3.8K 105.0 769.0 289.31 MB

FFmpeg for Android, iOS and tvOS. Not maintained anymore. Superseded by FFmpegKit.

Home Page: https://tanersener.github.io/mobile-ffmpeg

License: GNU General Public License v3.0

Shell 6.63% C 65.51% Makefile 5.73% M4 1.27% Python 0.40% HTML 7.24% XSLT 0.08% CSS 0.06% PHP 0.01% Roff 2.09% C++ 9.55% Objective-C 0.77% CMake 0.52% Batchfile 0.03% Max 0.01% Clean 0.01% DIGITAL Command Language 0.05% JavaScript 0.05% VCL 0.01% CoffeeScript 0.01%
ffmpeg fontconfig freetype fribidi gmp gnutls kvazaar lame libass libtheora

mobile-ffmpeg's Introduction

MobileFFmpeg Financial Contributors on Open Collective GitHub release Maven Central CocoaPods Build Status

FFmpeg for Android, iOS and tvOS.

Not maintained anymore as explained in What’s next for MobileFFmpeg?. Superseded by FFmpegKit.

1. Features

  • Includes both FFmpeg and FFprobe

  • Use binaries available at Github/Maven Central/CocoaPods or build your own version with external libraries you need

  • Supports

    • Android, iOS and tvOS

    • FFmpeg v3.4.x, v4.0.x, v4.1, v4.2 , v4.3 and v4.4-dev releases

    • 29 external libraries

      chromaprint, fontconfig, freetype, fribidi, gmp, gnutls, kvazaar, lame, libaom, libass, libiconv, libilbc, libtheora, libvorbis, libvpx, libwebp, libxml2, opencore-amr, openh264, opus, sdl, shine, snappy, soxr, speex, tesseract, twolame, vo-amrwbenc, wavpack

    • 5 external libraries with GPL license

      rubberband, vid.stab, x264, x265, xvidcore

    • Concurrent execution

  • Exposes both FFmpeg library and MobileFFmpeg wrapper library capabilities

  • Includes cross-compile instructions for 47 open-source libraries

    chromaprint, expat, ffmpeg, fontconfig, freetype, fribidi, giflib, gmp, gnutls, kvazaar, lame, leptonica, libaom, libass, libiconv, libilbc, libjpeg, libjpeg-turbo, libogg, libpng, libsamplerate, libsndfile, libtheora, libuuid, libvorbis, libvpx, libwebp, libxml2, nettle, opencore-amr, openh264, opus, rubberband, sdl, shine, snappy, soxr, speex, tesseract, tiff, twolame, vid.stab, vo-amrwbenc, wavpack, x264, x265, xvidcore

  • Licensed under LGPL 3.0, can be customized to support GPL v3.0

1.1 Android

  • Builds arm-v7a, arm-v7a-neon, arm64-v8a, x86 and x86_64 architectures
  • Supports zlib and MediaCodec system libraries
  • Camera access on supported devices
  • Builds shared native libraries (.so)
  • Creates Android archive with .aar extension
  • Supports API Level 16+

1.2 iOS

  • Builds armv7, armv7s, arm64, arm64e, i386, x86_64 and x86_64 (Mac Catalyst) architectures
  • Supports bzip2, iconv, libuuid, zlib system libraries and AudioToolbox, VideoToolbox, AVFoundation system frameworks
  • Objective-C API
  • Camera access
  • ARC enabled library
  • Built with -fembed-bitcode flag
  • Creates static frameworks, static xcframeworks and static universal (fat) libraries (.a)
  • Supports iOS SDK 9.3 or later

1.3 tvOS

  • Builds arm64 and x86_64 architectures
  • Supports bzip2, iconv, libuuid, zlib system libraries and AudioToolbox, VideoToolbox system frameworks
  • Objective-C API
  • ARC enabled library
  • Built with -fembed-bitcode flag
  • Creates static frameworks and static universal (fat) libraries (.a)
  • Supports tvOS SDK 9.2 or later

2. Using

Prebuilt binaries are available at Github, Maven Central and CocoaPods.

2.1 Packages

There are eight different mobile-ffmpeg packages. Below you can see which system libraries and external libraries are enabled in each of them.

Please remember that some parts of FFmpeg are licensed under the GPL and only GPL licensed mobile-ffmpeg packages include them.

min min-gpl https https-gpl audio video full full-gpl
external libraries - vid.stab
x264
x265
xvidcore
gmp
gnutls
gmp
gnutls
vid.stab
x264
x265
xvidcore
lame
libilbc
libvorbis
opencore-amr
opus
shine
soxr
speex
twolame
vo-amrwbenc
wavpack
fontconfig
freetype
fribidi
kvazaar
libaom
libass
libiconv
libtheora
libvpx
libwebp
snappy
fontconfig
freetype
fribidi
gmp
gnutls
kvazaar
lame
libaom
libass
libiconv
libilbc
libtheora
libvorbis
libvpx
libwebp
libxml2
opencore-amr
opus
shine
snappy
soxr
speex
twolame
vo-amrwbenc
wavpack
fontconfig
freetype
fribidi
gmp
gnutls
kvazaar
lame
libaom
libass
libiconv
libilbc
libtheora
libvorbis
libvpx
libwebp
libxml2
opencore-amr
opus
shine
snappy
soxr
speex
twolame
vid.stab
vo-amrwbenc
wavpack
x264
x265
xvidcore
android system libraries zlib
MediaCodec
ios system libraries zlib
AudioToolbox
AVFoundation
iconv
VideoToolbox
bzip2
tvos system libraries zlib
AudioToolbox
iconv
VideoToolbox
bzip2
  • libilbc, opus, snappy, x264 and xvidcore are supported since v1.1

  • libaom and soxr are supported since v2.0

  • chromaprint, vid.stab and x265 are supported since v2.1

  • sdl, tesseract, twolame external libraries; zlib, MediaCodec Android system libraries; bzip2, zlib iOS system libraries and AudioToolbox, VideoToolbox, AVFoundation iOS system frameworks are supported since v3.0

  • Since v4.2, chromaprint, sdl and tesseract libraries are not included in binary releases. You can still build them and include in your releases

  • AVFoundation is not available on tvOS, VideoToolbox is not available on tvOS LTS releases

  • Since v4.3.1, iOS and tvOS releases started to use iconv system library instead of iconv external library

  • vo-amrwbenc is supported since v4.4

2.2 Android

  • For versions 4.4 and 4.4.LTS, add mavenCentral() to your build.gradle and make sure that it is listed before jcenter()
  • For 4.3.2 and older releases, add jcenter()
    repositories {
        mavenCentral()
    }
    
  1. Add MobileFFmpeg dependency to your build.gradle in mobile-ffmpeg-<package name> pattern.

    dependencies {
        implementation 'com.arthenica:mobile-ffmpeg-full:4.4'
    }
    
  2. Execute synchronous FFmpeg commands.

    import com.arthenica.mobileffmpeg.Config;
    import com.arthenica.mobileffmpeg.FFmpeg;
    
    int rc = FFmpeg.execute("-i file1.mp4 -c:v mpeg4 file2.mp4");
    
    if (rc == RETURN_CODE_SUCCESS) {
        Log.i(Config.TAG, "Command execution completed successfully.");
    } else if (rc == RETURN_CODE_CANCEL) {
        Log.i(Config.TAG, "Command execution cancelled by user.");
    } else {
        Log.i(Config.TAG, String.format("Command execution failed with rc=%d and the output below.", rc));
        Config.printLastCommandOutput(Log.INFO);
    }
    
  3. Execute asynchronous FFmpeg commands.

    import com.arthenica.mobileffmpeg.Config;
    import com.arthenica.mobileffmpeg.FFmpeg;
    
    long executionId = FFmpeg.executeAsync("-i file1.mp4 -c:v mpeg4 file2.mp4", new ExecuteCallback() {
    
        @Override
        public void apply(final long executionId, final int returnCode) {
            if (returnCode == RETURN_CODE_SUCCESS) {
                Log.i(Config.TAG, "Async command execution completed successfully.");
            } else if (returnCode == RETURN_CODE_CANCEL) {
                Log.i(Config.TAG, "Async command execution cancelled by user.");
            } else {
                Log.i(Config.TAG, String.format("Async command execution failed with returnCode=%d.", returnCode));
            }
        }
    });
    
  4. Execute FFprobe commands.

    import com.arthenica.mobileffmpeg.Config;
    import com.arthenica.mobileffmpeg.FFprobe;
    
    int rc = FFprobe.execute("-i file1.mp4");
    
    if (rc == RETURN_CODE_SUCCESS) {
        Log.i(Config.TAG, "Command execution completed successfully.");
    } else {
        Log.i(Config.TAG, String.format("Command execution failed with rc=%d and the output below.", rc));
        Config.printLastCommandOutput(Log.INFO);
    }
    
  5. Check execution output later.

    int rc = Config.getLastReturnCode();
    
    if (rc == RETURN_CODE_SUCCESS) {
        Log.i(Config.TAG, "Command execution completed successfully.");
    } else if (rc == RETURN_CODE_CANCEL) {
        Log.i(Config.TAG, "Command execution cancelled by user.");
    } else {
        Log.i(Config.TAG, String.format("Command execution failed with rc=%d and the output below.", rc));
        Config.printLastCommandOutput(Log.INFO);
    }
    
  6. Stop ongoing FFmpeg operations.

    • Stop all executions
      FFmpeg.cancel();
      
    • Stop a specific execution
      FFmpeg.cancel(executionId);
      
  7. Get media information for a file.

    MediaInformation info = FFprobe.getMediaInformation("<file path or uri>");
    
  8. Record video using Android camera.

    FFmpeg.execute("-f android_camera -i 0:0 -r 30 -pixel_format bgr0 -t 00:00:05 <record file path>");
    
  9. Enable log callback.

    Config.enableLogCallback(new LogCallback() {
        public void apply(LogMessage message) {
            Log.d(Config.TAG, message.getText());
        }
    });
    
  10. Enable statistics callback.

    Config.enableStatisticsCallback(new StatisticsCallback() {
        public void apply(Statistics newStatistics) {
            Log.d(Config.TAG, String.format("frame: %d, time: %d", newStatistics.getVideoFrameNumber(), newStatistics.getTime()));
        }
    });
    
  11. Ignore the handling of a signal.

    Config.ignoreSignal(Signal.SIGXCPU);
    
  12. List ongoing executions.

    final List<FFmpegExecution> ffmpegExecutions = FFmpeg.listExecutions();
    for (int i = 0; i < ffmpegExecutions.size(); i++) {
        FFmpegExecution execution = ffmpegExecutions.get(i);
        Log.d(TAG, String.format("Execution %d = id:%d, startTime:%s, command:%s.", i, execution.getExecutionId(), execution.getStartTime(), execution.getCommand()));
    }
    
  13. Set default log level.

    Config.setLogLevel(Level.AV_LOG_FATAL);
    
  14. Register custom fonts directory.

    Config.setFontDirectory(this, "<folder with fonts>", Collections.EMPTY_MAP);
    

2.3 iOS / tvOS

  1. Add MobileFFmpeg dependency to your Podfile in mobile-ffmpeg-<package name> pattern.

    • iOS
    pod 'mobile-ffmpeg-full', '~> 4.4'
    
    • tvOS
    pod 'mobile-ffmpeg-tvos-full', '~> 4.4'
    
  2. Execute synchronous FFmpeg commands.

    #import <mobileffmpeg/MobileFFmpegConfig.h>
    #import <mobileffmpeg/MobileFFmpeg.h>
    
    int rc = [MobileFFmpeg execute: @"-i file1.mp4 -c:v mpeg4 file2.mp4"];
    
    if (rc == RETURN_CODE_SUCCESS) {
        NSLog(@"Command execution completed successfully.\n");
    } else if (rc == RETURN_CODE_CANCEL) {
        NSLog(@"Command execution cancelled by user.\n");
    } else {
        NSLog(@"Command execution failed with rc=%d and output=%@.\n", rc, [MobileFFmpegConfig getLastCommandOutput]);
    }
    
  3. Execute asynchronous FFmpeg commands.

    #import <mobileffmpeg/MobileFFmpegConfig.h>
    #import <mobileffmpeg/MobileFFmpeg.h>
    
    long executionId = [MobileFFmpeg executeAsync:@"-i file1.mp4 -c:v mpeg4 file2.mp4" withCallback:self];
    
    - (void)executeCallback:(long)executionId :(int)returnCode {
        if (rc == RETURN_CODE_SUCCESS) {
            NSLog(@"Async command execution completed successfully.\n");
        } else if (rc == RETURN_CODE_CANCEL) {
            NSLog(@"Async command execution cancelled by user.\n");
        } else {
            NSLog(@"Async command execution failed with rc=%d.\n", rc);
        }
    }
    
  4. Execute FFprobe commands.

    #import <mobileffmpeg/MobileFFmpegConfig.h>
    #import <mobileffmpeg/MobileFFprobe.h>
    
    int rc = [MobileFFprobe execute: @"-i file1.mp4"];
    
    if (rc == RETURN_CODE_SUCCESS) {
        NSLog(@"Command execution completed successfully.\n");
    } else if (rc == RETURN_CODE_CANCEL) {
        NSLog(@"Command execution cancelled by user.\n");
    } else {
        NSLog(@"Command execution failed with rc=%d and output=%@.\n", rc, [MobileFFmpegConfig getLastCommandOutput]);
    }
    
  5. Check execution output later.

    int rc = [MobileFFmpegConfig getLastReturnCode];
    NSString *output = [MobileFFmpegConfig getLastCommandOutput];
    
    if (rc == RETURN_CODE_SUCCESS) {
        NSLog(@"Command execution completed successfully.\n");
    } else if (rc == RETURN_CODE_CANCEL) {
        NSLog(@"Command execution cancelled by user.\n");
    } else {
        NSLog(@"Command execution failed with rc=%d and output=%@.\n", rc, output);
    }
    
  6. Stop ongoing FFmpeg operations.

    • Stop all executions
      [MobileFFmpeg cancel];
      
      
    • Stop a specific execution
      [MobileFFmpeg cancel:executionId];
      
  7. Get media information for a file.

    MediaInformation *mediaInformation = [MobileFFprobe getMediaInformation:@"<file path or uri>"];
    
  8. Record video and audio using iOS camera. This operation is not supported on tvOS since AVFoundation is not available on tvOS.

    [MobileFFmpeg execute: @"-f avfoundation -r 30 -video_size 1280x720 -pixel_format bgr0 -i 0:0 -vcodec h264_videotoolbox -vsync 2 -f h264 -t 00:00:05 %@", recordFilePath];
    
  9. Enable log callback.

    [MobileFFmpegConfig setLogDelegate:self];
    
    - (void)logCallback:(long)executionId :(int)level :(NSString*)message {
        dispatch_async(dispatch_get_main_queue(), ^{
            NSLog(@"%@", message);
        });
    }
    
  10. Enable statistics callback.

    [MobileFFmpegConfig setStatisticsDelegate:self];
    
    - (void)statisticsCallback:(Statistics *)newStatistics {
        dispatch_async(dispatch_get_main_queue(), ^{
            NSLog(@"frame: %d, time: %d\n", newStatistics.getVideoFrameNumber, newStatistics.getTime);
        });
    }
    
  11. Ignore the handling of a signal.

    [MobileFFmpegConfig ignoreSignal:SIGXCPU];
    
  12. List ongoing executions.

    NSArray* ffmpegExecutions = [MobileFFmpeg listExecutions];
    for (int i = 0; i < [ffmpegExecutions count]; i++) {
        FFmpegExecution* execution = [ffmpegExecutions objectAtIndex:i];
        NSLog(@"Execution %d = id: %ld, startTime: %@, command: %@.\n", i, [execution getExecutionId], [execution getStartTime], [execution getCommand]);
    }
    
  13. Set default log level.

    [MobileFFmpegConfig setLogLevel:AV_LOG_FATAL];
    
  14. Register custom fonts directory.

    [MobileFFmpegConfig setFontDirectory:@"<folder with fonts>" with:nil];
    

2.4 Manual Installation

2.4.1 Android

You can import MobileFFmpeg aar packages in Android Studio using the File -> New -> New Module -> Import .JAR/.AAR Package menu.

2.4.2 iOS / tvOS

iOS and tvOS frameworks can be installed manually using the Importing Frameworks guide. If you want to use universal binaries please refer to Using Universal Binaries guide.

2.5 Test Application

You can see how MobileFFmpeg is used inside an application by running test applications provided. There is an Android test application under the android/test-app folder, an iOS test application under the ios/test-app folder and a tvOS test application under the tvos/test-app folder.

All applications are identical and supports command execution, video encoding, accessing https, encoding audio, burning subtitles, video stabilisation, pipe operations and concurrent command execution.

3. Versions

MobileFFmpeg version number is aligned with FFmpeg since version 4.2.

In previous versions, MobileFFmpeg version of a release and FFmpeg version included in that release was different. The following table lists FFmpeg versions used in MobileFFmpeg releases.

  • dev part in FFmpeg version number indicates that FFmpeg source is pulled from the FFmpeg master branch. Exact version number is obtained using git describe --tags.
MobileFFmpeg Version FFmpeg Version Release Date
4.4 4.4-dev-416 Jul 25, 2020
4.4.LTS 4.4-dev-416 Jul 24, 2020
4.3.2 4.3-dev-2955 Apr 15, 2020
4.3.1 4.3-dev-1944 Jan 25, 2020
4.3.1.LTS 4.3-dev-1944 Jan 25, 2020
4.3 4.3-dev-1181 Oct 27, 2019
4.2.2 4.2-dev-1824 July 3, 2019
4.2.2.LTS 4.2-dev-1824 July 3, 2019
4.2.1 4.2-dev-1156 Apr 2, 2019
4.2 4.2-dev-480 Jan 3, 2019
4.2.LTS 4.2-dev-480 Jan 3, 2019
3.1 4.1-10 Dec 11, 2018
3.0 4.1-dev-1517 Oct 25, 2018
2.2 4.0.3 Nov 10, 2018
2.1.1 4.0.2 Sep 19, 2018
2.1 4.0.2 Sep 5, 2018
2.0 4.0.1 Jun 30, 2018
1.2 3.4.4 Aug 30, 2018
1.1 3.4.2 Jun 18, 2018
1.0 3.4.2 Jun 6, 2018

4. LTS Releases

Starting from v4.2, MobileFFmpeg binaries are published in two different variants: Main Release and LTS Release.

  • Main releases include complete functionality of the library and support the latest SDK/API features.

  • LTS releases are customized to support a wider range of devices. They are built using older API/SDK versions, so some features are not available on them.

This table shows the differences between two variants.

Main Release LTS Release
Android API Level 24 16
Android Camera Access Yes -
Android Architectures arm-v7a-neon
arm64-v8a
x86
x86-64
arm-v7a
arm-v7a-neon
arm64-v8a
x86
x86-64
Xcode Support 10.1 7.3.1
iOS SDK 12.1 9.3
iOS AVFoundation Yes -
iOS Architectures arm64
arm64e1
x86-64
x86-64-mac-catalyst2
armv7
arm64
i386
x86-64
tvOS SDK 10.2 9.2
tvOS Architectures arm64
x86-64
arm64
x86-64

1 - Included until v4.3.2

2 - Included since v4.3.2

5. Building

Build scripts from master and development branches are tested periodically. See the latest status from the table below.

branch status
master Build Status
development Build Status

5.1 Prerequisites

  1. Use your package manager (apt, yum, dnf, brew, etc.) to install the following packages.

    autoconf automake libtool pkg-config curl cmake gcc gperf texinfo yasm nasm bison autogen patch git
    

Some of these packages are not mandatory for the default build. Please visit Android Prerequisites, iOS Prerequisites and tvOS Prerequisites for the details.

  1. Android builds require these additional packages.

    • Android SDK 4.1 Jelly Bean (API Level 16) or later
    • Android NDK r21 or later with LLDB and CMake
  2. iOS builds need these extra packages and tools.

    • Xcode 7.3.1 or later
    • iOS SDK 9.3 or later
    • Command Line Tools
  3. tvOS builds need these extra packages and tools.

    • Xcode 7.3.1 or later
    • tvOS SDK 9.2 or later
    • Command Line Tools

5.2 Build Scripts

Use android.sh, ios.sh and tvos.sh to build MobileFFmpeg for each platform.

All three scripts support additional options and can be customized to enable/disable specific external libraries and/or architectures. Please refer to wiki pages of android.sh, ios.sh and tvos.sh to see all available build options.

5.2.1 Android
export ANDROID_HOME=<Android SDK Path>
export ANDROID_NDK_ROOT=<Android NDK Path>
./android.sh

5.2.2 iOS
./ios.sh

5.2.3 tvOS
./tvos.sh

5.2.4 Building LTS Binaries

Use --lts option to build lts binaries for each platform.

5.3 Build Output

All libraries created by the top level build scripts (android.sh, ios.sh and tvos.sh) can be found under the prebuilt directory.

  • Android archive (.aar file) is located under the android-aar folder
  • iOS frameworks are located under the ios-framework folder
  • iOS xcframeworks are located under the ios-xcframework folder
  • iOS universal binaries are located under the ios-universal folder
  • tvOS frameworks are located under the tvos-framework folder
  • tvOS universal binaries are located under the tvos-universal folder

5.4 GPL Support

It is possible to enable GPL licensed libraries x264, xvidcore since v1.1; vid.stab, x265 since v2.1 and rubberband since v4.3.2 from the top level build scripts. Their source code is not included in the repository and downloaded when enabled.

5.5 External Libraries

build directory includes build scripts of all external libraries. Two scripts exist for each external library, one for Android and one for iOS / tvOS. Each of these two scripts contains options/flags used to cross-compile the library on the specified mobile platform.

CPU optimizations (ASM) are enabled for most of the external libraries. Details and exceptions can be found under the ASM Support wiki page.

6. Documentation

A more detailed documentation is available at Wiki.

7. Contributors

7.1 Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

7.2 Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

7.2.1 Individuals

7.2.2 Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

8. License

MobileFFmpeg is licensed under the LGPL v3.0. However, if source code is built using the optional --enable-gpl flag or prebuilt binaries with -gpl postfix are used, then MobileFFmpeg is subject to the GPL v3.0 license.

The source code of all external libraries included is in compliance with their individual licenses.

openh264 source code included in this repository is licensed under the 2-clause BSD License but this license does not cover the MPEG LA licensing fees. If you build mobile-ffmpeg with openh264 and distribute that library, then you are subject to pay MPEG LA licensing fees. Refer to OpenH264 FAQ page for the details. Please note that mobile-ffmpeg does not publish a binary with openh264 inside.

strip-frameworks.sh script included and distributed (until v4.x) is published under the Apache License version 2.0.

In test applications; embedded fonts are licensed under the SIL Open Font License, other digital assets are published in the public domain.

Please visit License page for the details.

9. Patents

It is not clearly explained in their documentation but it is believed that FFmpeg, kvazaar, x264 and x265 include algorithms which are subject to software patents. If you live in a country where software algorithms are patentable then you'll probably need to pay royalty fees to patent holders. We are not lawyers though, so we recommend that you seek legal advice first. See FFmpeg Patent Mini-FAQ.

openh264 clearly states that it uses patented algorithms. Therefore, if you build mobile-ffmpeg with openh264 and distribute that library, then you are subject to pay MPEG LA licensing fees. Refer to OpenH264 FAQ page for the details.

10. Contributing

Feel free to submit issues or pull requests.

Please note that master branch includes only the latest released source code. Changes planned for the next release are implemented under the development branch. Therefore, if you want to create a pull request, please open it against the development.

11. See Also

mobile-ffmpeg's People

Contributors

alexcohn avatar gitter-badger avatar hannesa2 avatar javernaut avatar monkeywithacupcake avatar rexprog avatar tanersener avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mobile-ffmpeg's Issues

[IOS] v2.1.1 patch breaks framework generation

Generated dynamic frameworks can not be used since there are invalid libavcodec rpath definitions inside:

@rpath/libavcodec.dylib (compatibility version 58.0.0, current version 58.18.100).

Frameworks should link to libavcodec framework, not .dylib file, since it is in different package.

Submit Your External Library Support Requests Here

ffmpeg supports many external libraries but mobile-ffmpeg does not support them all. Only libraries included in mobile-ffmpeg packages are supported.

Please submit your requests for new external libraries here. So we can consider adding support for them before publishing a new release.

[IOS] Memory leaks during argument parsing

Argument parsing methods leaks memory. The following trace belongs to one of the leaks.

   0 libsystem_malloc.dylib malloc_zone_malloc
   1 libsystem_malloc.dylib realloc
   2 mobileffmpeg grow_array
   3 mobileffmpeg split_commandline
   4 mobileffmpeg ffmpeg_parse_options
   5 mobileffmpeg execute
   6 mobileffmpeg mobileffmpeg_execute

The actual cause is reusable nature of internal variables. FFmpeg executable does not perform a full cleanup on abnormal termination and exits without freeing some dynamic parts. But MobileFFmpeg does not call FFmpeg executable and some dynamic blocks remain unfreed.

A common solution is needed for both Android and IOS.

This issue was detected in v2.0 but it looks like all versions are affected from this.

Possibility of reducing size of audio build

I was trying to build a small audio only FFmpeg binary for Android before I've discovered your project.
I was able to reduce the size of FFmpeg executable to 4.5 MB with below audio only config. That's half of what it is created by your project.

Would you be able to add an alternative audio build? With similar config below? Please note I did not worry about licensing details as I was merely trying to see how much I can reduce the binary size


./configure --prefix=$PREFIX
$CROSS_COMPILE_FLAGS
--pkg-config=$(which pkg-config)
--pkg-config-flags="--static"
--disable-everything
--enable-pthreads
--enable-pic
--enable-small
--enable-gpl
--enable-version3
--enable-nonfree

--disable-shared
--enable-static

--enable-ffmpeg
--disable-ffplay
--disable-ffprobe

--disable-protocols
--enable-protocol='file,pipe,concat'

--disable-filters
--enable-filter='acopy,amerge,aresample,asetrate,aformat,anull,atrim,format,null,setpts,trim'

--disable-muxers

--disable-demuxers
--enable-demuxer=ac3
--enable-demuxer=aiff
--enable-demuxer=ape
--enable-demuxer=au
--enable-demuxer=concat
--enable-demuxer=asf
--enable-demuxer=aac
--enable-demuxer=flac
--enable-demuxer=mp3
--enable-demuxer=ogg
--enable-demuxer=wav
--enable-demuxer=pcm_alaw
--enable-demuxer=pcm_mulaw
--enable-demuxer=dnxhd
--enable-demuxer=pcm_alaw
--enable-demuxer=pcm_mulaw
--enable-demuxer=pcm_f64be
--enable-demuxer=pcm_f64le
--enable-demuxer=pcm_f32be
--enable-demuxer=pcm_f32le
--enable-demuxer=pcm_s32be
--enable-demuxer=pcm_s32le
--enable-demuxer=pcm_s24be
--enable-demuxer=pcm_s24le
--enable-demuxer=pcm_s16be
--enable-demuxer=pcm_s16le
--enable-demuxer=pcm_s8
--enable-demuxer=pcm_u32be
--enable-demuxer=pcm_u32le
--enable-demuxer=pcm_u24be
--enable-demuxer=pcm_u24le
--enable-demuxer=pcm_u16be
--enable-demuxer=pcm_u16le
--enable-demuxer=pcm_u8
--enable-demuxer=wav
--enable-demuxer=xwma

--enable-muxer='ac3,aiff,ape,au,alac,wma,concat,asf,3gp,flac,mp3,mp4,ogg,opus,wav,dnxhd'

--disable-encoders
--enable-encoder=pcm_alaw
--enable-encoder=pcm_mulaw
--enable-encoder=libfdk_aac
--enable-encoder=aac
--enable-encoder=flac
--enable-encoder=libmp3lame
--enable-encoder=libopus
--enable-encoder=libvorbis
--enable-libopencore-amrnb
--enable-libopencore-amrwb
--enable-encoder=mpeg4
--enable-encoder=dnxhd
--enable-encoder=pcm_s8
--enable-encoder=pcm_s16be
--enable-encoder=pcm_s16le
--enable-encoder=pcm_s24be
--enable-encoder=pcm_s24le
--enable-encoder=pcm_s32be
--enable-encoder=pcm_s32le
--enable-encoder=pcm_u8
--enable-encoder=pcm_u16be
--enable-encoder=pcm_u16le
--enable-encoder=pcm_u24be
--enable-encoder=pcm_u24le
--enable-encoder=pcm_u32be
--enable-encoder=pcm_u32le

--disable-decoders
--enable-decoder=pcm_alaw
--enable-decoder=pcm_mulaw
--enable-decoder=aac
--enable-decoder=aac_latm
--enable-decoder=ac3
--enable-decoder=alac
--enable-decoder=als
--enable-decoder=ape
--enable-decoder=eac3
--enable-decoder=flac
--enable-decoder=gsm
--enable-decoder=gsm_ms
--enable-decoder=mp1
--enable-decoder=mp1float
--enable-decoder=mp2
--enable-decoder=mp2float
--enable-decoder=mp3
--enable-decoder=mp3adu
--enable-decoder=mp3adufloat
--enable-decoder=mp3float
--enable-decoder=mp3on4
--enable-decoder=mp3on4float
--enable-decoder=opus
--enable-decoder=ralf
--enable-decoder=vorbis
--enable-decoder=wavpack
--enable-decoder=wmalossless
--enable-decoder=wmapro
--enable-decoder=pcm_s24daud
--enable-decoder=pcm_s24le
--enable-decoder=pcm_s24le_planar
--enable-decoder=pcm_s32be
--enable-decoder=pcm_s32le
--enable-decoder=wmav1
--enable-decoder=wmav2
--enable-decoder=wmavoice
--enable-decoder=aac_at
--enable-decoder=aac_fixed
--enable-decoder=libopus
--enable-decoder=libvorbis
--enable-decoder=mpeg4
--enable-decoder=pcm_s16le
--enable-decoder=pcm_s16be
--enable-decoder=dnxhd
--enable-decoder=pcm_alaw
--enable-decoder=pcm_bluray
--enable-decoder=pcm_dvd
--enable-decoder=pcm_f32be
--enable-decoder=pcm_f32le
--enable-decoder=pcm_f64be
--enable-decoder=pcm_f64le
--enable-decoder=pcm_lxf
--enable-decoder=pcm_mulaw
--enable-decoder=pcm_s8
--enable-decoder=pcm_s8_planar
--enable-decoder=pcm_s16be
--enable-decoder=pcm_s16be_planar
--enable-decoder=pcm_s16le
--enable-decoder=pcm_s16le_planar
--enable-decoder=pcm_s24be
--enable-decoder=pcm_s32le_planar
--enable-decoder=pcm_u8
--enable-decoder=pcm_u16be
--enable-decoder=pcm_u16le
--enable-decoder=pcm_u24be
--enable-decoder=pcm_u24le
--enable-decoder=pcm_u32be
--enable-decoder=pcm_u32le
--enable-decoder=pcm_zork
--enable-decoder=dsd_lsbf
--enable-decoder=dsd_msbf
--enable-decoder=dsd_lsbf_planar
--enable-decoder=dsd_msbf_planar

--enable-parser='aac,aac_latm,ac3,cook,dca,flac,gsm,mpegaudio,vorbis'

--enable-libmp3lame
--enable-libopus
--enable-libvorbis
--enable-bsf=aac_adtstoasc

--disable-doc

[IOS] Invalid Bundle Error

Hey,
On trying to upload the app build with a library using this mobile-ffmpeg I am getting the following errors -

ERROR ITMS-90208: "Invalid Bundle. The bundle Application.app/Frameworks/libavcodec.framework does not support the minimum OS Version specified in the Info.plist."
An unknown error occurred.

ERROR ITMS-90208: "Invalid Bundle. The bundle Application.app/Frameworks/libavdevice.framework does not support the minimum OS Version specified in the Info.plist."
An unknown error occurred.

ERROR ITMS-90208: "Invalid Bundle. The bundle Application.app/Frameworks/libavfilter.framework does not support the minimum OS Version specified in the Info.plist."
An unknown error occurred.

Likewise with all the other frameworks inside this mobile-ffmpeg.
I have MinimumOSVersion is the plist of all these frameworks set to 8.0.
Please help. Kind of urgent.

Thanks.

[Android/IOS] Return code on execute() operation is not correct

Android's FFmpeg.execute() and IOS's mobileffmpeg_execute() methods both return wrong codes. Most of the time it is 1, although operation is successful. It should be zero on success and non-zero on failure. All versions, including v2.0 is affected from this.

[IOS] shared libraries do not include bitcode

When IOS frameworks of release v1.0 and v1.1 are installed from CocoaPods, Xcode builds fail with the following error.

ld: '../Projects/mobile-ffmpeg/ios/test-app/Pods/mobileffmpeg/libavcodec.framework/libavcodec' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '../mobileffmpeg/libavcodec.framework/libavcodec' for architecture arm64

Issue IOS

[!] Unable to find a specification for mobile-ffmpeg-full (~> 2.2)

Spaces in input files

Hi! I just want to ask since i noticed the string command dont accept double quotes or single quotes on input files? how do I add them since some of my filenames have spaces. Or is there an alternative way to escape spaces in filenames on input files? Thanks

Licensing issue

I am sorry if my question is irrelevant. I have read a lot threads about against using FFMpeg in commercial iOS app in Appstore due to LGPL/GPL license. I read the list of things to do to comply. Sorry again for asking this, my question is, can I use this mobile-ffmpeg library to my iOS & android app safely for iOS Appstore & Google play ?

How to cancel?

For example you're in the middle of encoding, how do you cancel the process?

From what I understand you use shutdown? If it is, my concern is the API is not present in the IOS version. How do I cancel?

Thanks :)

about neon version

@tanersener , may I know how to use neon version .so files only ?
I tried to use 4 *neon files only, and deleted related 4 non-neon .so files, other common .so files are kept, the program crashed.
BTW, neon version of .so files can support all Android 5.0 and above OS ?
Thanks.

[Android] Build fails for NDK r18b

Building mobile-ffmpeg sources for Android platform fails on NDK r18b. The following error log should be analyzed.

CC	libavdevice/fbdev_dec.o
libavdevice/avdevice.c:88:26: warning: 'av_oformat_next' is deprecated [-Wdeprecated-declarations]
            if (!(prev = av_oformat_next(prev)))
                         ^
./libavformat/avformat.h:2087:1: note: 'av_oformat_next' has been explicitly marked deprecated here
attribute_deprecated
^
./libavutil/attributes.h:94:49: note: expanded from macro 'attribute_deprecated'
#    define attribute_deprecated __attribute__((deprecated))
                                                ^
libavdevice/avdevice.c:92:26: warning: 'av_iformat_next' is deprecated [-Wdeprecated-declarations]
            if (!(prev = av_iformat_next(prev)))
                         ^
./libavformat/avformat.h:2079:1: note: 'av_iformat_next' has been explicitly marked deprecated here
attribute_deprecated
^
./libavutil/attributes.h:94:49: note: expanded from macro 'attribute_deprecated'
#    define attribute_deprecated __attribute__((deprecated))
                                                ^
CC	libavdevice/fbdev_enc.o
CC	libavdevice/lavfi.o
CC	libavdevice/reverse.o
2 warnings generated.
CC	libavdevice/timefilter.o
CC	libavdevice/utils.o
CC	libavdevice/v4l2-common.o
CC	libavdevice/v4l2.o
CC	libavdevice/v4l2enc.o
libavdevice/v4l2.c:135:9: error: assigning to 'int (*)(int, unsigned long, ...)' from incompatible type '<overloaded function type>'
        SET_WRAPPERS();
        ^~~~~~~~~~~~~~
libavdevice/v4l2.c:121:17: note: expanded from macro 'SET_WRAPPERS'
    s->ioctl_f  = prefix ## ioctl;      \
                ^           ~~~~~
/Users/taner/Library/Android/sdk/ndk-bundle/toolchains/mobile-ffmpeg-arm/sysroot/usr/include/bits/ioctl.h:56:5: note: candidate function has type mismatch at 2nd parameter (expected 'unsigned long' but has 'unsigned int')
int ioctl(int __fd, unsigned __request, ...) __overloadable __enable_if(1, "") __RENAME(ioctl);
    ^
/Users/taner/Library/Android/sdk/ndk-bundle/toolchains/mobile-ffmpeg-arm/sysroot/usr/include/bits/ioctl.h:36:5: note: candidate function has type mismatch at 2nd parameter (expected 'unsigned long' but has 'int')
int ioctl(int __fd, int __request, ...);
    ^
CC	libavfilter/aeval.o
1 error generated.
CC	libavfilter/af_acontrast.o
make: *** [libavdevice/v4l2.o] Error 1
make: *** Waiting for unfinished jobs....

[IOS] Support older Xcode versions

Current version, v2.1.1, of both frameworks and universal binaries give the following error when Xcode 10 is not used. Library must support older Xcode versions.

ld: could not reparse object file in bitcode bundle: 'Invalid bitcode version (Producer: '1000.11.45.2_0' Reader: '902.0.39.2_0')', using libLTO version 'LLVM version 9.1.0, (clang-902.0.39.2)' for architecturearmv7

ps: Disabling bitcode can be used to overcome this issue temporarily.

iOS pod installation

I am using this version:
'mobile-ffmpeg-min-gpl', '~> 2.1.1'

I tried to install the library using pods for iOS but it the download URL is not correct. This is the path that it is using when using pods:
https://github.com/tanersener/mobile-ffmpeg/releases/download/v2.1.1/mobile-ffmpeg-min-gpl-2.1.1-ios-framework.zip
But when I checked the your releases, it should be:
https://github.com/tanersener/mobile-ffmpeg/releases/download/v2.1.1.ios/mobile-ffmpeg-min-gpl-2.1.1-ios-framework.zip

Thanks for the help

Unable to build 'vdpau/vdpau.h' file

Description
I'm building in Xcode10 for ios, going to use this for react-native project, have gone through the setup process and all seems to be up to date.

Expected behavior
Being able to build.

Current behavior
Unable to build 'vdpau/vdpau.h' file not found comes up.

Screenshots
screenshot 2018-12-04 22 22 27

Environment

  • Platform:IOS
  • Architecture: arm64
  • Source branch: master
  • Xcode version: 10

Am I missing some package that I need to install?

[Android] NULL check needed before GetStringUTFChars

If FFmpeg.execute() is called with wrong arguments, application crashes with the following error. NULL check is needed before calling GetStringUTFChars

JNI DETECTED ERROR IN APPLICATION: GetStringUTFChars received NULL jstring
    art/runtime/java_vm_ext.cc:410]     in call to GetStringUTFChars
    art/runtime/java_vm_ext.cc:410]     from int com.arthenica.mobileffmpeg.FFmpeg.execute(java.lang.String[])

This problem appears in all versions.

[IOS] Message from debugger: Terminated due to memory issue

Description
Message from debugger: Terminated due to memory issue

let ffmpegCommand = "-i input_path -c copy -f mp4 output_path"

// EXECUTE
let result: Int = Int(MobileFFmpeg.execute(ffmpegCommand, delimiter: " "))

if result == RETURN_CODE_SUCCESS
{
print("FFmpeg Success")
}

Logs
2018-12-04 20:29:39.961 TestURLParser[44089:3273462] INFO: libavutil 56. 19.101 / 56. 19.101
2018-12-04 20:29:39.961 TestURLParser[44089:3273462] INFO: libavcodec 58. 33.102 / 58. 33.102
2018-12-04 20:29:39.961 TestURLParser[44089:3273462] INFO: libavformat 58. 19.102 / 58. 19.102
2018-12-04 20:29:39.961 TestURLParser[44089:3273462] INFO: libavdevice 58. 4.106 / 58. 4.106
2018-12-04 20:29:39.961 TestURLParser[44089:3273462] INFO: libavfilter 7. 37.100 / 7. 37.100
2018-12-04 20:29:39.961 TestURLParser[44089:3273462] INFO: libswscale 5. 2.100 / 5. 2.100
2018-12-04 20:29:39.961 TestURLParser[44089:3273462] INFO: libswresample 3. 2.100 / 3. 2.100
2018-12-04 20:29:39.992 TestURLParser[44089:3273462] INFO: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:///var/mobile/Containers/Data/Application/5A35650D-9FF4-4720-8BB9-F1648526C6C1/Documents/dash.m4a':
2018-12-04 20:29:39.992 TestURLParser[44089:3273462] INFO: Metadata:
2018-12-04 20:29:39.992 TestURLParser[44089:3273462] INFO: major_brand :
2018-12-04 20:29:39.992 TestURLParser[44089:3273462] INFO: dash
2018-12-04 20:29:39.992 TestURLParser[44089:3273462] INFO:
2018-12-04 20:29:39.993 TestURLParser[44089:3273462] INFO: minor_version :
2018-12-04 20:29:39.993 TestURLParser[44089:3273462] INFO: 0
2018-12-04 20:29:39.993 TestURLParser[44089:3273462] INFO:
2018-12-04 20:29:39.993 TestURLParser[44089:3273462] INFO: compatible_brands:
2018-12-04 20:29:39.993 TestURLParser[44089:3273462] INFO: iso6mp41
2018-12-04 20:29:39.993 TestURLParser[44089:3273462] INFO:
2018-12-04 20:29:39.993 TestURLParser[44089:3273462] INFO: creation_time :
2018-12-04 20:29:39.993 TestURLParser[44089:3273462] INFO: 2018-12-03T11:10:23.000000Z
2018-12-04 20:29:39.993 TestURLParser[44089:3273462] INFO:
2018-12-04 20:29:39.993 TestURLParser[44089:3273462] INFO: Duration:
2018-12-04 20:29:39.993 TestURLParser[44089:3273462] INFO: 01:26:51.70
2018-12-04 20:29:39.993 TestURLParser[44089:3273462] INFO: , start:
2018-12-04 20:29:39.993 TestURLParser[44089:3273462] INFO: 0.000000
2018-12-04 20:29:39.993 TestURLParser[44089:3273462] INFO: , bitrate:
2018-12-04 20:29:39.993 TestURLParser[44089:3273462] INFO: 129 kb/s
2018-12-04 20:29:39.993 TestURLParser[44089:3273462] INFO:
2018-12-04 20:29:39.993 TestURLParser[44089:3273462] INFO: Stream #0:0
2018-12-04 20:29:39.994 TestURLParser[44089:3273462] INFO: (eng)
2018-12-04 20:29:39.994 TestURLParser[44089:3273462] INFO: : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 0 kb/s
2018-12-04 20:29:39.994 TestURLParser[44089:3273462] INFO: (default)
2018-12-04 20:29:39.994 TestURLParser[44089:3273462] INFO:
2018-12-04 20:29:39.994 TestURLParser[44089:3273462] INFO: Metadata:
2018-12-04 20:29:39.994 TestURLParser[44089:3273462] INFO: creation_time :
2018-12-04 20:29:39.994 TestURLParser[44089:3273462] INFO: 2018-12-03T11:10:23.000000Z
2018-12-04 20:29:39.994 TestURLParser[44089:3273462] INFO:
2018-12-04 20:29:39.994 TestURLParser[44089:3273462] INFO: handler_name :
2018-12-04 20:29:39.994 TestURLParser[44089:3273462] INFO: ISO Media file produced by Google Inc. Created on: 12/03/2018.
2018-12-04 20:29:39.994 TestURLParser[44089:3273462] INFO:
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO: Output #0, mp4, to 'file:///var/mobile/Containers/Data/Application/5A35650D-9FF4-4720-8BB9-F1648526C6C1/Documents/mpeg-4.m4a':
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO: Metadata:
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO: major_brand :
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO: dash
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO:
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO: minor_version :
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO: 0
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO:
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO: compatible_brands:
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO: iso6mp41
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO:
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO: encoder :
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO: Lavf58.19.102
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO:
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO: Stream #0:0
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO: (eng)
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO: : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 0 kb/s
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO: (default)
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO:
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO: Metadata:
2018-12-04 20:29:39.997 TestURLParser[44089:3273462] INFO: creation_time :
2018-12-04 20:29:39.998 TestURLParser[44089:3273462] INFO: 2018-12-03T11:10:23.000000Z
2018-12-04 20:29:39.998 TestURLParser[44089:3273462] INFO:
2018-12-04 20:29:39.998 TestURLParser[44089:3273462] INFO: handler_name :
2018-12-04 20:29:39.998 TestURLParser[44089:3273462] INFO: ISO Media file produced by Google Inc. Created on: 12/03/2018.
2018-12-04 20:29:39.998 TestURLParser[44089:3273462] INFO:
2018-12-04 20:29:39.998 TestURLParser[44089:3273462] INFO: Stream mapping:
2018-12-04 20:29:39.998 TestURLParser[44089:3273462] INFO: Stream #0:0 -> #0:0
2018-12-04 20:29:39.998 TestURLParser[44089:3273462] INFO: (copy)
2018-12-04 20:29:39.998 TestURLParser[44089:3273462] INFO:
2018-12-04 20:29:39.998 TestURLParser[44089:3273462] INFO: Press [q] to stop, [?] for help
2018-12-04 20:29:40.499 TestURLParser[44089:3273462] INFO: size= 4352kB time=00:04:39.59 bitrate= 127.5kbits/s speed= 557x

2018-12-04 20:29:40.999 TestURLParser[44089:3273462] INFO: size= 8704kB time=00:09:21.73 bitrate= 126.9kbits/s speed= 561x

2018-12-04 20:29:41.499 TestURLParser[44089:3273462] INFO: size= 13056kB time=00:13:58.86 bitrate= 127.5kbits/s speed= 559x

2018-12-04 20:29:42.006 TestURLParser[44089:3273462] INFO: size= 17408kB time=00:18:38.29 bitrate= 127.5kbits/s speed= 557x

2018-12-04 20:29:42.506 TestURLParser[44089:3273462] INFO: size= 21504kB time=00:23:03.58 bitrate= 127.3kbits/s speed= 551x

2018-12-04 20:29:43.011 TestURLParser[44089:3273462] INFO: size= 25856kB time=00:27:37.46 bitrate= 127.8kbits/s speed= 550x

2018-12-04 20:29:43.511 TestURLParser[44089:3273462] INFO: size= 29952kB time=00:32:09.25 bitrate= 127.2kbits/s speed= 549x

2018-12-04 20:29:44.011 TestURLParser[44089:3273462] INFO: size= 34304kB time=00:36:45.91 bitrate= 127.4kbits/s speed= 550x

2018-12-04 20:29:44.514 TestURLParser[44089:3273462] INFO: size= 38656kB time=00:41:16.19 bitrate= 127.9kbits/s speed= 548x

2018-12-04 20:29:45.014 TestURLParser[44089:3273462] INFO: size= 43008kB time=00:45:54.58 bitrate= 127.9kbits/s speed= 549x

2018-12-04 20:29:45.515 TestURLParser[44089:3273462] INFO: size= 47104kB time=00:50:15.36 bitrate= 128.0kbits/s speed= 546x

2018-12-04 20:29:46.015 TestURLParser[44089:3273462] INFO: size= 51200kB time=00:54:48.54 bitrate= 127.5kbits/s speed= 546x

2018-12-04 20:29:46.515 TestURLParser[44089:3273462] INFO: size= 55552kB time=00:59:20.89 bitrate= 127.8kbits/s speed= 546x

2018-12-04 20:29:47.015 TestURLParser[44089:3273462] INFO: size= 59648kB time=01:03:50.22 bitrate= 127.6kbits/s speed= 546x

2018-12-04 20:29:47.523 TestURLParser[44089:3273462] INFO: size= 63744kB time=01:08:13.70 bitrate= 127.6kbits/s speed= 544x

2018-12-04 20:29:48.024 TestURLParser[44089:3273462] INFO: size= 68096kB time=01:12:43.28 bitrate= 127.8kbits/s speed= 544x

2018-12-04 20:29:48.528 TestURLParser[44089:3273462] INFO: size= 72192kB time=01:17:12.86 bitrate= 127.7kbits/s speed= 543x

Message from debugger: Terminated due to memory issue

Environment

  • Xcode 10.1

[iOS] Not issue but want to help

Is is possible to preview when processing camera on ios?
If this library connect to camera (-f avfoundation -i 0:0 ...), can't preview.
If possible, please reply.

Thank you.

request for encoding data as return?

I love your library but it lacks return data aside from success/fail. Can i request that i can listen to the encoding data being output by ffmpeg while running? I would love to use it for a progress bar. Thanks!

[IOS] FFMpeg command not working with PNG files

@tanersener
Hi , I want to merge PNG with a Video but not working, whereas working fine with JPG !

Please check code for reference :

 let video:String = (Bundle.main.resourceURL?.appendingPathComponent("videoTest.mp4").path)!
        let videoOutput = String(format:VAR_DOCUMENT_DIRECTORY_SAVE + "/videoTestOutput.mp4")
        let image:String = (Bundle.main.resourceURL?.appendingPathComponent("maxresdefault.png").path)! // when i use jpg file it's working fine !!
    
        let result = MobileFFmpeg.execute("-y -loop 1 -framerate 24 -t 10 -i \(image) -i \(video) -filter_complex [0]scale=432:432,setsar=1[im];[1]scale=432:432,setsar=1[vid];[im][vid]concat=n=2:v=1:a=0 \(videoOutput)")
        print(result)
      
        if result == 0
        {
            print("SUCCESS")
        }

Infinite loop on build on Ubuntu 18.04

Ubuntu 18.04
Terminal prints the following


Desktop/mobile-ffmpeg$ ./android.sh
Building mobile-ffmpeg for Android
Architectures: arm-v7a, arm-v7a-neon, arm64-v8a
Libraries: android-media-codec, lame, libvorbis, opencore-amr, opus
Building arm-v7a platform on API level 21
opencore-amr: already built
opus: already built


That's it. after this nothing happens but build.log keeps growing with the following until quit with ctrl+c
INFO: Skipping opus, run=1, completed=1

I have also checked with other libraries, issue is there even when you enable only one library with
ENABLED_LIBRARIES=(0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)

[IOS] External library memory statistics

Below you can see memory usage statistics for external libraries, based on commands defined in IOS test-app running on x86-64 IOS Simulator.

video tab

No memory leaks for mpeg4, x264, xvid, vp8, vp9, aom, kvazaar, theora and hap. x265 leaks shown in x265-leaks screenshot below

x265-leaks

video_x265

https tab

No memory leaks for gmp, gnutls

audio tab

No memory leaks for amr, ilbc, mp3 (liblame), mp3 (libshine), opus, soxr, speex, vorbis, wavpack

subtitle tab

No memory leaks for fontconfig, freetype, fribidi, libiconv

vid.stab tab

libvid.stab leaks shown in libvid.stab-leaks screenshot below

libvid.stab-leaks

vidstab_tab

Awesome Library

Almost every week someone awesome pops up on GitHub with cooliogenesis (check it out)

Thanks for this awesomecore library and especially the fact that you added several most-needed external libraries.

A request I'd like to pass along... can you please add xvc ?

Building android-aar failed & h264 encoding?

When following the instructions after installing the required packages, I still get:
Creating Android archive under prebuilt/android-aar: failed
FFmpeg itself is successfully building for every arch, it's just the last bit where it fails. I'm running MacOS High Sierra.

EDIT: Never mind, I forgot that I uninstalled Gradle last week, working once reinstalled.

Are there plans for adding h264 encoding functionality? It would be awesome if we can enable either x264 or OpenH264 from the library list.

Thanks a lot!

[Android] add subtitles not work

mobile-ffmepg (Very good project )

issues:

android full-gpl

-i sdcard/demb.mp4 -vf subtitles=sdcard/input.srt sdcard/outhard.mp4
// file
input demb.mp4 size 22MB
output outhard.mp4 size 6MB without subtitles

this cmd work fine in windows cmd(ffmpeg version 3.4)

Video file not found in given test application (iOS)-SlideShow option

I have successfully build test app on device. But when I press button to create video file using images as given in "Slide Show" option, get following result.

/var/containers/Bundle/Application/0DD4F2B0-FF37-471D-BA24-9F38FC27A2D6/MobileFFmpegTest.app/slideshow.mp4: Operation not permitted

I try to find slideshow.mp4 file from given solution (if I run it on simulator), there is no file exist in MobileFFmpegTest.app folder.

Similarly when I press play button to run video file in application, there is no result.

Do you have any suggestions to solve it.

Thanks in advance.

dyld: Library not loaded

I'm following steps given in

https://github.com/tanersener/mobile-ffmpeg/wiki/Using-IOS-Universal-Binaries

but with 'mobile-ffmpeg-min-gpl-2.1.1-ios-shared-universal'

and app crashing at launch saying :

dyld: Library not loaded: @rpath/libavcodec.dylib
Referenced from: /Users/SANAL/Library/Developer/CoreSimulator/Devices/7653659F-C64F-465C-81EA-FB7845EA8F86/data/Containers/Bundle/Application/58341C2F-9F8E-4807-9B66-D148FE01AD6C/FFMpegDemo.app/FFMpegDemo
Reason: no suitable image found. Did find:
/Users/SANAL/Library/Developer/CoreSimulator/Devices/7653659F-C64F-465C-81EA-FB7845EA8F86/data/Containers/Bundle/Application/58341C2F-9F8E-4807-9B66-D148FE01AD6C/FFMpegDemo.app/Frameworks/libavcodec.dylib: mach-o, but not built for iOS simulator

while it is working perfectly with 'mobile-ffmpeg-universal' !!

Hoping for quick solution ,

Best regards

[Android/IOS] stream copy very slow

Copying an input file is expected to complete fast since it does no contain any encoding/decoding.

Unfortunately this is not the case in IOS v3.0 release. -i input_path -c copy output_path command completes in 34 seconds by default. If redirection is disabled then copying completes in 1.5 seconds. This means that enabling log/statistics redirection slows down the copying operation. Reason of this case should be analyzed.

Additional testing confirms that only copy mode (-c copy) is affected from this issue. The speed of other operations is not effected by enabling/disabling redirection.

[IOS] ios lipo path enhancement

ios.sh script uses lipo command from $PATH; but lipo is available under /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin and can be found using xcrun --sdk iphoneos -find lipo.

Consider using lipo from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin.

[Android/IOS] Statistics always returning 0 for all properties

I'm currently using 2.1 version of your lib and mimicked your implementation in your test app using Config.enableStatisticsCallback. However, I noticed my StatisticsCallback isn't executed, and if I force get the statistics using Config.getLastReceivedStatistics I only receive all 0s. There's no error also. The command executes fine and exports the video. And I'm also using Config.enableLogCallback and it works fine. Why is this? Do I have to set this up or follow a series of steps before I use this?

Thanks for the help :)

[IOS] Xcode complains about mobileffmpeg library does not contain bitcode

When Xcode tries to link mobileffmpeg for arm64 architecture the following linking error occurs. v2.0 is affected from this.

ld: '/Users/taner/Projects/mobile-ffmpeg-v2.0/ios/test-app/Pods/mobile-ffmpeg-full/mobileffmpeg.framework/mobileffmpeg' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/taner/Projects/mobile-ffmpeg-v2.0/ios/test-app/Pods/mobile-ffmpeg-full/mobileffmpeg.framework/mobileffmpeg' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

native static int execute allways return 0(success)

mobile-ffmpeg: sd/demo.mp4: No such file or directory
mobile-ffmpeg: Conversion failed!

/** * <p>Synchronously executes FFmpeg with arguments provided. * * @param arguments FFmpeg command options/arguments * @return zero on successful execution, non-zero on error */

native static int execute return 0 expect non-zero

about subtitles

@tanersener
I found the subtitles usage below in test app.
"-y -i %s -vf subtitles=%s:force_style='FontName=MyFontName' -c:v mpeg4 %s"

Question 1:
May I know where I need to put the MyFontName file in Android eclipse project? In asset directory?

Question 2:
Can I use absolute path ( like '/sdcard/font.ttf') in MyFontName above to run ffmpeg command?

Thanks.

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.