GithubHelp home page GithubHelp logo

writingminds / ffmpeg-android Goto Github PK

View Code? Open in Web Editor NEW
1.6K 108.0 416.0 26.68 MB

FFmpeg for Android compiled with x264, libass, fontconfig, freetype, fribidi and lame (Supports Android 4.1+)

Home Page: http://writingminds.github.io/ffmpeg-android/

License: Other

Shell 100.00%
ffmpeg-android fontconfig shell android-ndk libass android freetype fribidi h264

ffmpeg-android's Introduction

  • FFmpeg for Android compiled with x264, libass, fontconfig, freetype and fribidi
  • Supports Android L
  • FFmpeg Android Library

Supported Architecture

  • armv7
  • armv7-neon
  • x86

Instructions

  • Set environment variable
    1. export ANDROID_NDK={Android NDK Base Path}
  • Run following commands to compile ffmpeg
    1. sudo apt-get --quiet --yes install build-essential git autoconf libtool pkg-config gperf gettext yasm python-lxml
    2. ./init_update_libs.sh
    3. ./android_build.sh
  • To update submodules and libraries you can use ./init_update_libs.sh command
  • Find the executable binary in build directory.
  • If you want to use FONTCONFIG then you need to specify your custom fontconfig config file (e.g - "FONTCONFIG_FILE=/sdcard/fonts.conf ./ffmpeg --version", where /sdcard/fonts.conf is location of your FONTCONFIG configuration file).
  • You can also download prebuilt-binaries (Releases > Downloads > prebuilt-binaries[zip|tar.gz]).

License

check files LICENSE.GPLv3 and LICENSE

HIRE US

Get in touch with us - http://www.writingminds.com

Bitdeli Badge

ffmpeg-android's People

Contributors

bitdeli-chef avatar hiteshsondhi88 avatar nanika avatar smostertdev 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

ffmpeg-android's Issues

pcm to mp3 with sampling rates of 16000

“-y -ac 1 -ar 8000 -f s16le -i xxx.pcm -acodec libmp3lame -ab 128K yyyy.mp3 ”
I use sampling rates of 8000, PCM covert mp3 is right.
When I use sampling rates of 16000, PCM covert mp3 is wrong.
How can I fix it. Please help me.
How can I change the code.

How to generate the aar file for this lib?

I am able to use these scripts to generate the libs but, in your FFmpeg Android Java you use a .aar file.
I already made the changes to use the ndk 11 and android ver 16 and it compiles fine (it generates the build folder).
How can I generate the .aar file, from the compiled result?
I want to understand and learn how to do it.

Thanks and congratulations for the scripts.

error compiling!

I just run sudo apt-get --quiet --yes install build-essential git autoconf libtool pkg-config gperf gettext yasm,but 404 error,what's wrong whith this error?

After this operation, 55.1 MB of additional disk space will be used.
Err http://us.archive.ubuntu.com/ubuntu/ raring/main libsigsegv2 amd64 2.9-4ubuntu3
404 Not Found [IP: 91.189.91.23 80]
Err http://us.archive.ubuntu.com/ubuntu/ raring/main autoconf all 2.69-1ubuntu1
404 Not Found [IP: 91.189.91.23 80]
Err http://us.archive.ubuntu.com/ubuntu/ raring/main autotools-dev all 20120608.1
404 Not Found [IP: 91.189.91.23 80]
Err http://us.archive.ubuntu.com/ubuntu/ raring/main automake all 1:1.11.6-1ubuntu1
404 Not Found [IP: 91.189.91.23 80]
Err http://us.archive.ubuntu.com/ubuntu/ raring/main libstdc++6-4.7-dev amd64 4.7.3-1ubuntu1
404 Not Found [IP: 91.189.91.23 80]
Err http://us.archive.ubuntu.com/ubuntu/ raring/main g++-4.7 amd64 4.7.3-1ubuntu1
404 Not Found [IP: 91.189.91.23 80]
Err http://us.archive.ubuntu.com/ubuntu/ raring/main g++ amd64 4:4.7.3-1ubuntu10
404 Not Found [IP: 91.189.91.23 80]
Err http://us.archive.ubuntu.com/ubuntu/ raring/main dpkg-dev all 1.16.10ubuntu1
404 Not Found [IP: 91.189.91.23 80]
Err http://us.archive.ubuntu.com/ubuntu/ raring/main build-essential amd64 11.6ubuntu4
404 Not Found [IP: 91.189.91.23 80]
Err http://us.archive.ubuntu.com/ubuntu/ raring/main git-man all 1:1.8.1.2-1
404 Not Found [IP: 91.189.91.23 80]
Err http://us.archive.ubuntu.com/ubuntu/ raring/main git amd64 1:1.8.1.2-1
404 Not Found [IP: 91.189.91.23 80]
Err http://us.archive.ubuntu.com/ubuntu/ raring/main gperf amd64 3.0.3-1ubuntu2
404 Not Found [IP: 91.189.91.23 80]
Err http://us.archive.ubuntu.com/ubuntu/ raring/main libltdl-dev amd64 2.4.2-1.2ubuntu1
404 Not Found [IP: 91.189.91.23 80]
Err http://us.archive.ubuntu.com/ubuntu/ raring/main libtool amd64 2.4.2-1.2ubuntu1
404 Not Found [IP: 91.189.91.23 80]
Err http://us.archive.ubuntu.com/ubuntu/ raring/main yasm amd64 1.2.0-1
404 Not Found [IP: 91.189.91.23 80]
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/libs/libsigsegv/libsigsegv2_2.9-4ubuntu3_amd64.deb 404 Not Found [IP: 91.189.91.23 80]
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/a/autoconf/autoconf_2.69-1ubuntu1_all.deb 404 Not Found [IP: 91.189.91.23 80]
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/a/autotools-dev/autotools-dev_20120608.1_all.deb 404 Not Found [IP: 91.189.91.23 80]
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/a/automake1.11/automake_1.11.6-1ubuntu1_all.deb 404 Not Found [IP: 91.189.91.23 80]
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/g/gcc-4.7/libstdc++6-4.7-dev_4.7.3-1ubuntu1_amd64.deb 404 Not Found [IP: 91.189.91.23 80]
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/g/gcc-4.7/g++-4.7_4.7.3-1ubuntu1_amd64.deb 404 Not Found [IP: 91.189.91.23 80]
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/g/gcc-defaults/g++_4.7.3-1ubuntu10_amd64.deb 404 Not Found [IP: 91.189.91.23 80]
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/d/dpkg/dpkg-dev_1.16.10ubuntu1_all.deb 404 Not Found [IP: 91.189.91.23 80]
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/b/build-essential/build-essential_11.6ubuntu4_amd64.deb 404 Not Found [IP: 91.189.91.23 80]
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/g/git/git-man_1.8.1.2-1_all.deb 404 Not Found [IP: 91.189.91.23 80]
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/g/git/git_1.8.1.2-1_amd64.deb 404 Not Found [IP: 91.189.91.23 80]
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/g/gperf/gperf_3.0.3-1ubuntu2_amd64.deb 404 Not Found [IP: 91.189.91.23 80]
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/libt/libtool/libltdl-dev_2.4.2-1.2ubuntu1_amd64.deb 404 Not Found [IP: 91.189.91.23 80]
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/libt/libtool/libtool_2.4.2-1.2ubuntu1_amd64.deb 404 Not Found [IP: 91.189.91.23 80]
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/y/yasm/yasm_1.2.0-1_amd64.deb 404 Not Found [IP: 91.189.91.23 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

How to concat two videos.

-y -i "concat:/storage/emulated/0/input1.ts|/storage/emulated/0/input2.ts" -c copy -bsf:a aac_adtstoasc /storage/emulated/0/output.mp4

I am using this command and it works for windows but doesn't work for android.

ImageMagick

Hello,

Can We Compile Binary Library for ImageMagick Or GraphicMagick ?

libsdl2

I was able to successfully compile this library. However, I am trying to build this with SDL2 for android, but I am stuck. Is there any way you could add SDL2 to your ffmpeg build?

Need to Update libpng to 1.6.24

The original download link in init_update_libs.sh, 'ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng16/libpng-1.6.21.tar.xz', no longer works. It needs to be updated to 1.6.24.

FFmpeg with https support

I managed to compile ffmpeg for my ubuntu with openssl by adding necessary --enable-openssl flag.

However, ffmpeg-android gives "openssl" not found error. Is this OS related or should I use something different?

Update:

I now realized that openssl should also be compiled and built before ffmpeg. I'm not experienced in building libraries from source using NDK, can somebody help me with writing a new openssl_build.sh?

Youtube/Whatsapp videos not getting cropped/cut

I have added below dependency.

compile 'com.github.hiteshsondhi88.libffmpeg:FFmpegAndroid:0.2.5'

I am using below command

execFFmpegBinary("-i " + path + " -ss " + startMs / 1000 + " -to " + endMs / 1000 + " -strict -2 -async 1 " + dest.getAbsolutePath());

to cut or trim videos.

Its working for some videos but for some videos its NOT working especially for videos that are shared from whatssapp or downloaded from youtube.It gives below error..I am using Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_MOVIES ) for storage of videos.

FAILED with output : WARNING: linker: /files/ffmpeg has text relocations. This is wasting memory and prevents security hardening. Please fix.
    ffmpeg version n2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
    built on Oct  7 2014 15:11:41 with gcc 4.8 (GCC)
    configuration: --target-os=linux --cross-prefix=/home/sb/Source-Code/ffmpeg-android/toolchain-android/bin/i686-linux-android- --arch=x86 --cpu=i686 --enable-runtime-cpudetect --sysroot=/home/sb/Source-Code/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/sb/Source-Code/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/sb/Source-Code/ffmpeg-android/build/x86 --extra-cflags='-I/home/sb/Source-Code/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all -march=i686' --extra-ldflags='-L/home/sb/Source-Code/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
    libavutil      54.  7.100 / 54.  7.100
    libavcodec     56.  1.100 / 56.  1.100
    libavformat    56.  4.101 / 56.  4.101
    libavdevice    56.  0.100 / 56.  0.100
    libavfilter     5.  1.100 /  5.  1.100
    libswscale      3.  0.100 /  3.  0.100
    libswresample   1.  1.100 /  1.  1.100
    libpostproc    53.  0.100 / 53.  0.100
    /storage/emulated/0/1: No such file or directory

Support for arm8 (Nexus 6)

The nexus 6p uses an arm8 cpu which unfortunately fails to use the libraries generated by the project :(
Any plans to support this architecture?

How to get working 'blend' filter

I am trying to implement feature that blends 2 videos together but it seems that prebuilt ffmpeg binaries missing this filter. So is there a way to built in this filter?

Running ffmpeg -filters produces following output:

Filters:
T.. = Timeline support
.S. = Slice threading
..C = Commmand support A = Audio input/output V = Video input/output N = Dynamic number and/or type of input/output | = Source or sink filter
T.. adelay A->A Delay one or more audio channels.
... aecho A->A Add echoing to the audio.
... aeval A->A Filter audio signal according to a specified expression.
T.. afade A->A Fade in/out input audio.
... aformat A->A Convert the input audio to one of the specified formats.
... ainterleave N->A Temporally interleave audio inputs.
... allpass A->A Apply a two-pole all-pass filter.
... amerge N->A Merge two or more audio streams into a single multi-channel stream.
... amix N->A Audio mixing.
... anull A->A Pass the source unchanged to the output.
T.. apad A->A Pad audio with silence.
... aperms A->A Set permissions for the output audio frame.
... aphaser A->A Add a phasing effect to the audio.
... aresample A->A Resample audio data.
... aselect A->N Select audio frames to pass in output.
... asendcmd A->A Send commands to filters.
... asetnsamples A->A Set the number of samples for each output audio frames.
... asetpts A->A Set PTS for the output audio frame.
... asetrate A->A Change the sample rate without altering the data.
... asettb A->A Set timebase for the audio output link.
... ashowinfo A->A Show textual information for each audio frame.
... asplit A->N Pass on the audio input to N audio outputs.
... astats A->A Show time domain statistics about audio frames.
... astreamsync AA->AA Copy two streams of audio data in a configurable order.
..C atempo A->A Adjust audio tempo.
... atrim A->A Pick one continuous section from the input, drop the rest.
... bandpass A->A Apply a two-pole Butterworth band-pass filter.
... bandreject A->A Apply a two-pole Butterworth band-reject filter.
... bass A->A Boost or cut lower frequencies.
... biquad A->A Apply a biquad IIR filter with the given coefficients. ... channelmap

Use fontconfig

Hi,

I use your another project(ffmpeg-android-java) to burn subtitles in the video,and execute:

ffmpeg -y -i input.mp4 -vf subtitles=input.srt -c:v mpeg4 -c:a aac -strict -2 output.mp4

but it doesn’t work well.

You told me that I should create the custom fontconfig,so I tried to rebuild the SO.
I’m able to get ffmpeg(bulid/xx/bin) files,but I don’t know how to specify the custom fontconfig config file.
I create a fonts.conf file and place it into my sdcard(storage/sdcard/).
Can you tell me how to configure?
Thank you!

Minimal Size Binary

is there any script to compile a minimal ffmpeg binary, to include only the video encoder?
Or a way to select easily which modules to compile?
I've seen some apps using a less than 1MB ffmpeg binary, which is understandable as ffmpeg has many features which a developer might not need at all, and size is an important factor when it comes to mobile.

Hi

I have a question.

how to make a ffmpeg binary added new codecs?
please help me.

Build failing "libpng support requested but library not found"

I am attempting to build this against Android L using ABI version 4.9.

SUPPORTED_ARCHITECTURES=(armeabi-v7a armeabi-v7a-neon)
ANDROID_NDK_ROOT_PATH=~/Android/ndk
ANDROID_API_VERSION=L
NDK_TOOLCHAIN_ABI_VERSION=4.9

This is on an Azure VM, running a fresh install of Ubuntu Server 14.04.

I have installed the following extra packages:

yasm bash patch make gawk aclocal automake libtool

build log: https://gist.github.com/reines/e3584625d1b3d92e1bd2

Fontconfig error: Cannot load default config file

I am using one of the prebuilt binaries in my project and am trying to draw text over a video file.

I am executing the process using a complex command in the form of a String[] instead of converting an ArrayList to a one command string. I had to do this to allow for the use of complex filters as having single or double quotes in a single string command doesn't work.

The binaries compiled claim to include libfreetype and libfribidi. The documentation for drawtext (http://ffmpeg.org/ffmpeg-filters.html#drawtext-1) says that libfontconfig also needs to be included to enable the font feature and the default font fallback feature.

This seems like a catch 22 as if you don't want include a font, ffmpeg has no way of falling back to a default.

Can you let me know if libfontconfig should be included and if not, would it be possible to make a prebuilt binary with it enabled? (I'd do it myself but am having trouble compiling)

Here is the complex command I am running:
final String[] complexCommand = {mFfmpegBin, "-i", inClip.path, "-vf", "drawtext=enable='between(t, 0, 3)':fontfile" + fontPath + ":text='Text to write is this, overlaid':fontsize=20:fontcolor=red:x=100:y=100", "-y", mediaOut.path};

Here is the shell output:
I/System.out﹕[Parsed_drawtext_0 @ 0xb5864420] Could not load font "(null)": invalid argument
I/System.out﹕ Fontconfig error: Cannot load default config file
I/System.out﹕ [Parsed_drawtext_0 @ 0xb5864420] Cannot find a valid font for the family Sans
I/System.out﹕ [AVFilterGraph @ 0xb5868080] Error initializing filter 'drawtext' with args 'enable=between(t, 0, 3):text=Text to write is this, overlaid:fontsize=20:fontcolor=red:x=100:y=100'
I/System.out﹕ Error opening filters!

Thanks

./libpng_build.sh: line 5: pushd: libpng-1.6.21: No such file or directory

Error compiling project due to the missing directory libpng-1.6.2.1 .

./libpng_build.sh: line 5: pushd: libpng-1.6.21: No such file or directory
make: *** No rule to make target 'clean'. Stop.
./libpng_build.sh: line 17: ./configure: No such file or directory

The reason is the file libpng-1.6.21.tar.xz gives an error when downloading from ftp server because it doesn't exists (when running the command ./init_update_libs.sh)

Output from ftp server:
ftp> pwd
Remote directory: /pub/libpng/png/src/libpng16
ftp> ls -laht
229 Entering Extended Passive Mode (|||58906|)
150 Opening ASCII mode data connection for file list
drwxr-sr-x 2 ftp ftp 12 Sep 1 03:45 .
-rw-r--r-- 1 ftp ftp 819 Sep 1 03:45 lpng1625.7z.asc
-rw-r--r-- 1 ftp ftp 819 Sep 1 03:45 libpng-1.6.25.tar.xz.asc
-rw-r--r-- 1 ftp ftp 819 Sep 1 03:45 lpng1625.zip.asc
-rw-r--r-- 1 ftp ftp 819 Sep 1 03:45 libpng-1.6.25.tar.gz.asc
-rw-r--r-- 1 ftp ftp 4.8k Sep 1 03:41 libpng-1.6.25-LICENSE.txt
-rw-r--r-- 1 ftp ftp 1.2k Sep 1 03:41 libpng-1.6.25-README.txt
-rw-r--r-- 1 ftp ftp 1.4M Sep 1 03:41 libpng-1.6.25.tar.gz
-rw-r--r-- 1 ftp ftp 724.4k Sep 1 03:41 lpng1625.7z
-rw-r--r-- 1 ftp ftp 1.2M Sep 1 03:41 lpng1625.zip
-rw-r--r-- 1 ftp ftp 959.2k Sep 1 03:41 libpng-1.6.25.tar.xz
drwxrwsr-x 11 ftp ftp 13 Nov 25 2015 ..
226 Transfer complete
ftp>

By the way, I solved by downloading the file from:
wget -c http://downloads.sourceforge.net/libpng/libpng-1.6.21.tar.xz

ffmpeg for cortex a-53?

Hi,

I'm trying to write an audio processing app with the tarsos library. Apparently the only (documented) way to get an audio dispatcher for a file is to use the AudioDispatcherFactory.fromPipe() method. This, however, requires an ffmpeg executable. The only device I have available to test is a moto g3, which has a Cortex A-53 cpu. When I use the supplied fix: AndroidFFMPEGLocator() I get a fatal exception. I don't know whether it's the cpu (one of the messages is Detected Native CPU Architecture: ARMEABI_V7A_NEON, which looks like it's supported) or AndroidFFMPEGLocator() not being able to find it.

I'm using studio - these are the messages I got:

2-29 09:32:29.657 6865-6865/net.pictnet.marigold.soundchunker I/art: Late-enabling -Xcheck:jni
02-29 09:32:29.754 6865-6865/net.pictnet.marigold.soundchunker D/AndroidFFMPEGLocator: CPUINFO line: processor : 0
02-29 09:32:29.754 6865-6865/net.pictnet.marigold.soundchunker D/AndroidFFMPEGLocator: CPUINFO line: model name : ARMv7 Processor rev 0 (v7l)
02-29 09:32:29.754 6865-6865/net.pictnet.marigold.soundchunker D/AndroidFFMPEGLocator: CPUINFO line: BogoMIPS : 38.40
02-29 09:32:29.754 6865-6865/net.pictnet.marigold.soundchunker D/AndroidFFMPEGLocator: CPUINFO line: Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 evtstrm
02-29 09:32:29.754 6865-6865/net.pictnet.marigold.soundchunker I/AndroidFFMPEGLocator: Detected Native CPU Architecture: ARMEABI_V7A_NEON
02-29 09:32:29.757 6865-6865/net.pictnet.marigold.soundchunker W/System.err: java.io.FileNotFoundException: armeabi-v7a-neon_ffmpeg
02-29 09:32:29.761 6865-6865/net.pictnet.marigold.soundchunker W/System.err: at android.content.res.AssetManager.openAsset(Native Method)
02-29 09:32:29.761 6865-6865/net.pictnet.marigold.soundchunker W/System.err: at android.content.res.AssetManager.open(AssetManager.java:313)
02-29 09:32:29.761 6865-6865/net.pictnet.marigold.soundchunker W/System.err: at android.content.res.AssetManager.open(AssetManager.java:287)
02-29 09:32:29.761 6865-6865/net.pictnet.marigold.soundchunker W/System.err: at be.tarsos.dsp.io.android.AndroidFFMPEGLocator.unpackFFmpeg(Unknown Source)
02-29 09:32:29.762 6865-6865/net.pictnet.marigold.soundchunker W/System.err: at be.tarsos.dsp.io.android.AndroidFFMPEGLocator.(Unknown Source)
02-29 09:32:29.762 6865-6865/net.pictnet.marigold.soundchunker W/System.err: at net.pictnet.marigold.soundchunker.MainActivity.onCreate(MainActivity.java:35)
02-29 09:32:29.762 6865-6865/net.pictnet.marigold.soundchunker W/System.err: at android.app.Activity.performCreate(Activity.java:6010)
02-29 09:32:29.762 6865-6865/net.pictnet.marigold.soundchunker W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1129)
02-29 09:32:29.762 6865-6865/net.pictnet.marigold.soundchunker W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292)
02-29 09:32:29.762 6865-6865/net.pictnet.marigold.soundchunker W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2413)
02-29 09:32:29.762 6865-6865/net.pictnet.marigold.soundchunker W/System.err: at android.app.ActivityThread.access$800(ActivityThread.java:155)
02-29 09:32:29.762 6865-6865/net.pictnet.marigold.soundchunker W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)
02-29 09:32:29.762 6865-6865/net.pictnet.marigold.soundchunker W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
02-29 09:32:29.762 6865-6865/net.pictnet.marigold.soundchunker W/System.err: at android.os.Looper.loop(Looper.java:135)
02-29 09:32:29.762 6865-6865/net.pictnet.marigold.soundchunker W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5343)
02-29 09:32:29.762 6865-6865/net.pictnet.marigold.soundchunker W/System.err: at java.lang.reflect.Method.invoke(Native Method)
02-29 09:32:29.762 6865-6865/net.pictnet.marigold.soundchunker W/System.err: at java.lang.reflect.Method.invoke(Method.java:372)
02-29 09:32:29.762 6865-6865/net.pictnet.marigold.soundchunker W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
02-29 09:32:29.762 6865-6865/net.pictnet.marigold.soundchunker W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:702)
02-29 09:32:29.762 6865-6865/net.pictnet.marigold.soundchunker I/AndroidFFMPEGLocator: Ffmpeg binary location: /data/data/net.pictnet.marigold.soundchunker/cache/ffmpeg is executable? false size: 0 bytes

Any light you could shed on this would be much appreciated.

libpng-1.6.21 is missing

ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng16/libpng-1.6.21.tar.xz is not avaliable

FFMpeg hangs on Nexus 5 having OS 5.1

I am trying following mix command using this ffmpeg prebuilt library on nexus 5 having 5.1 os. My app gets hang and does not execute full command. However this binary execute other simple commands correctly.

./ffmpeg -i ResampleBeat.wav -i ResampleRecording.wav -filter_complex amix=inputs=2:duration=longest:dropout_transition=3 MixAudio.m4a

error compiling ffmpeg

I got this error trying to build on Linux Mint (based on Ubuntu 14.04)

In file included from libavcodec/x86/mpegvideoenc.c:83:0:
libavcodec/x86/mpegvideoenc_template.c: In function 'dct_quantize_ssse3':
libavcodec/x86/mpegvideoenc_template.c:151:9: error: 'asm' operand has impossible constraints
         __asm__ volatile(
         ^
libavcodec/x86/mpegvideoenc_template.c:186:9: error: 'asm' operand has impossible constraints
         __asm__ volatile(
         ^

Build failing: ./configure. No such file or directory

Hello everyone. Unfortunately, this library could not be built, just following instructions in README, on latest version of Lubuntu i686 on step ./android_build.sh i receive build error. Any ideas to fix the build ?

building ffmpeg for android x86

.../ld: warning: skipping incompatible libavutil/libavutil.a while searching for avutil
.../ld: error: cannot find -lavutil

I encounter the above error when compelling ffmpeg3.1.2 for android x86. Anyone knows how to fix this?

Can't build the library

Hello!
I have followed all the instructions, and i can't seem to build the library.
I'm running ubuntu 16.04 in a VM, with android-ndk-r12b installed.
I followed all the steps including setting ANDROID_NDK, and the build failes at ./android_build.sh , here is the log:

david@david-VirtualBox:~/ffmpeg-android$ ./android_build.sh
patching file fontconfig/src/fcxml.c
Hunk #1 succeeded at 1345 (offset 31 lines).
Hunk #2 succeeded at 1392 (offset 31 lines).
abi_settings.sh: line 29: /home/longnd/build/android-ndk-r12b/build/tools/make-standalone-toolchain.sh: No such file or directory
~/ffmpeg-android/x264 ~/ffmpeg-android
Makefile:3: config.mak: No such file or directory
cat: config.h: No such file or directory
./configure
platform:      X86_64
byte order:    little-endian
system:        LINUX
cli:           yes
libx264:       internal
shared:        no
static:        no
asm:           yes
interlaced:    yes
avs:           avxsynth
lavf:          no
ffms:          no
mp4:           no
gpl:           yes
thread:        posix
opencl:        yes
filters:       crop select_every
debug:         no
gprof:         no
strip:         no
PIC:           no
bit depth:     8
chroma format: all

You can run 'make' or 'make fprofiled' now.
rm -f  common/mc.o common/predict.o common/pixel.o common/macroblock.o common/frame.o common/dct.o common/cpu.o common/cabac.o common/common.o common/osdep.o common/rectangle.o common/set.o common/quant.o common/deblock.o common/vlc.o common/mvpred.o common/bitstream.o encoder/analyse.o encoder/me.o encoder/ratecontrol.o encoder/set.o encoder/macroblock.o encoder/cabac.o encoder/cavlc.o encoder/encoder.o encoder/lookahead.o common/threadpool.o common/x86/mc-c.o common/x86/predict-c.o common/opencl.o encoder/slicetype-cl.o common/x86/const-a.o common/x86/cabac-a.o common/x86/dct-a.o common/x86/deblock-a.o common/x86/mc-a.o common/x86/mc-a2.o common/x86/pixel-a.o common/x86/predict-a.o common/x86/quant-a.o common/x86/cpu-a.o common/x86/dct-64.o common/x86/bitstream-a.o common/x86/sad-a.o common/x86/trellis-64.o  x264.o input/input.o input/timecode.o input/raw.o input/y4m.o output/raw.o output/matroska.o output/matroska_ebml.o output/flv.o output/flv_bytestream.o filters/filters.o filters/video/video.o filters/video/source.o filters/video/internal.o filters/video/resize.o filters/video/cache.o filters/video/fix_vfr_pts.o filters/video/select_every.o filters/video/crop.o filters/video/depth.o input/avs.o input/thread.o    *.a *.lib *.exp *.pdb x264 x264.exe .depend TAGS
rm -f checkasm checkasm.exe tools/checkasm.o tools/checkasm-a.o  common/oclobj.h x264_lookahead.clbin
rm -f example example.exe example.o
rm -f common/mc.gcda common/predict.gcda common/pixel.gcda common/macroblock.gcda common/frame.gcda common/dct.gcda common/cpu.gcda common/cabac.gcda common/common.gcda common/osdep.gcda common/rectangle.gcda common/set.gcda common/quant.gcda common/deblock.gcda common/vlc.gcda common/mvpred.gcda common/bitstream.gcda encoder/analyse.gcda encoder/me.gcda encoder/ratecontrol.gcda encoder/set.gcda encoder/macroblock.gcda encoder/cabac.gcda encoder/cavlc.gcda encoder/encoder.gcda encoder/lookahead.gcda common/threadpool.gcda common/x86/mc-c.gcda common/x86/predict-c.gcda common/opencl.gcda encoder/slicetype-cl.gcda x264.gcda input/input.gcda input/timecode.gcda input/raw.gcda input/y4m.gcda output/raw.gcda output/matroska.gcda output/matroska_ebml.gcda output/flv.gcda output/flv_bytestream.gcda filters/filters.gcda filters/video/video.gcda filters/video/source.gcda filters/video/internal.gcda filters/video/resize.gcda filters/video/cache.gcda filters/video/fix_vfr_pts.gcda filters/video/select_every.gcda filters/video/crop.gcda filters/video/depth.gcda input/avs.gcda input/thread.gcda common/mc.gcno common/predict.gcno common/pixel.gcno common/macroblock.gcno common/frame.gcno common/dct.gcno common/cpu.gcno common/cabac.gcno common/common.gcno common/osdep.gcno common/rectangle.gcno common/set.gcno common/quant.gcno common/deblock.gcno common/vlc.gcno common/mvpred.gcno common/bitstream.gcno encoder/analyse.gcno encoder/me.gcno encoder/ratecontrol.gcno encoder/set.gcno encoder/macroblock.gcno encoder/cabac.gcno encoder/cavlc.gcno encoder/encoder.gcno encoder/lookahead.gcno common/threadpool.gcno common/x86/mc-c.gcno common/x86/predict-c.gcno common/opencl.gcno encoder/slicetype-cl.gcno x264.gcno input/input.gcno input/timecode.gcno input/raw.gcno input/y4m.gcno output/raw.gcno output/matroska.gcno output/matroska_ebml.gcno output/flv.gcno output/flv_bytestream.gcno filters/filters.gcno filters/video/video.gcno filters/video/source.gcno filters/video/internal.gcno filters/video/resize.gcno filters/video/cache.gcno filters/video/fix_vfr_pts.gcno filters/video/select_every.gcno filters/video/crop.gcno filters/video/depth.gcno input/avs.gcno input/thread.gcno *.dyn pgopti.dpi pgopti.dpi.lock *.pgd *.pgc
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all
Unknown option --disable-shared, ignored
No working C compiler found.

Any ideas ?

libstagefright

How can we add libstagefright support? Adding to the ffmpeg_build.sh --enable-libstagefright-h264 fails with a Error:

ERROR: libstagefright_h264 not found

arm-linux-androideabi-gcc is unable to create an executable file.

Hi, I got this error bellow:
/home/parallels/Desktop/ffmpeg-android-master/toolchain-android/bin/arm-linux-androideabi-ranlib /home/parallels/Desktop/ffmpeg-android-master/toolchain-android/lib/libx264.a
~/Desktop/ffmpeg-android-master
~/Desktop/ffmpeg-android-master/ffmpeg ~/Desktop/ffmpeg-android-master
/home/parallels/Desktop/ffmpeg-android-master/toolchain-android/bin/arm-linux-androideabi-gcc is unable to create an executable file.
C compiler test failed.

I am sure that the arm-linux-androideabi-gcc is there at the location: "/home/parallels/Desktop/ffmpeg-android-master/toolchain-android/bin/"

Is anything wrong?
Thanks very much!

Rotates My Video.

-y -i /storage/emulated/0/A.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts -metadata:s:v:0 rotate=-90 /storage/emulated/0/A1.ts

This command working for me but it rotates my video.Please help asap!Thanks

Add ARMv6, MIPS and ARMv8, x86_64, MIPS64 builds

Not sure about MIPS64, but ARMv6, MIPS, ARMv8, and x86_64 are officialy supported by FFMPEG.

BTW, what about ARMv6-FPU and ARMv6-NoFPU?

I have Google Nexus 9 (HTC 0P82100/0P82200/0P82300) tablet codenamed Volantis/Flounder based on nVidia Tegra K1 T132 Denver ARMv8 64 bit SoC and I try to achieve maximum possible performance in decoding/encoding video using ffmpeg-android.

Handling spaces in filenames of ffmpeg command

I am using below ffmpeg command to cut videos.It works fine for video file names which doesn't have spaces but didn't worked for filenames having spaces..

execFFmpegBinary("-i " + path + " -ss " + startMs / 1000 + " -to " + endMs / 1000 + " -strict -2 -async 1 " + dest.getAbsolutePath());

where path is the path of original video.

startMs is the initial time of video form where you want to cut(start time of cropped video)

endMs is the time of video upto which you want to cut(end time of cropped video)

dest is the path where you want to save the cut/cropped video

The problem is with source path(path).I have seen this answer.But here i don't know the complete path since I am fetching paths of all the videos from storage. I need to handle spaces in filenames.
For resolving that i tried using string formatter as shown in below code .But with that it didn't worked in both cases.Where am i going wrong and how can i resolve the issue?

String command = String.format("-i \"%s\" -ss %d -to %d -strict -2 -async 1 \"%s\" ",path,startMs / 1000 , endMs / 1000, dest.getAbsolutePath());
execFFmpegBinary(command);

ffmpeg-android licence

I am new in github, my question is, can i use this library in my project and publish in google play or i need buy some license ?

update

I compiled today and needed to adjust few things:

diff --git a/init_update_libs.sh b/init_update_libs.sh
index 5e82329..f8acc71 100755
--- a/init_update_libs.sh
+++ b/init_update_libs.sh
@@ -10,7 +10,7 @@ rm -rf expat-*
rm -rf fribidi-*
rm -rf lame-*

-wget -O- ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng16/libpng-1.6.21.tar.xz | tar xJ
+wget -O- ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng16/libpng-1.6.22.tar.xz | tar xJ
wget -O- http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz | tar xz
wget -O- http://fribidi.org/download/fribidi-0.19.7.tar.bz2 | tar xj
wget -O- http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz | tar xz
diff --git a/libpng_build.sh b/libpng_build.sh
index a5d75dd..96570e6 100755
--- a/libpng_build.sh
+++ b/libpng_build.sh
@@ -2,7 +2,7 @@

. abi_settings.sh $1 $2 $3

-pushd libpng-1.6.21
+pushd libpng-1.6.22

make clean

diff --git a/settings.sh b/settings.sh
index bdf7b94..ad646c4 100755
--- a/settings.sh
+++ b/settings.sh
@@ -7,7 +7,7 @@ if [[ -z "$ANDROID_NDK_ROOT_PATH" ]]; then
exit
fi
ANDROID_API_VERSION=9
-NDK_TOOLCHAIN_ABI_VERSION=4.8
+NDK_TOOLCHAIN_ABI_VERSION=4.9

NUMBER_OF_CORES=$(nproc)
HOST_UNAME=$(uname -m)

Runtime error on Android 7 (Nougat)?

Users with Android 7 are reporting errors when the app runs ffmpeg commands.
Users with Android 6 are fine.
The app is targeting API 23.

Is that related to "NDK Apps Linking to Platform Libraries" below? If so, any way to fix it? Otherwise the binary will not be usable any more...
https://developer.android.com/about/versions/nougat/android-7.0-changes.html#ndk

In Android 6, there is also a section mentioning "text relocations" problems (below), but the app is already targeting 23...
https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-runtime

I will change targeting to 22 and let a user test it. But want to know if there is good fix.

http://unicode.org/cldr/utility/list-unicodeset.jsp ... service unavailable

When building Im getting the following error. There is a dependency on a web service that appears to not be functional. Is there an alternative you are aware of?

Making install in fc-blanks
make[1]: Entering directory `/home/aaron/git/ffmpeg-android/fontconfig/fc-blanks'
  GEN      fcblanks.h
Traceback (most recent call last):
  File "./fc-blanks.py", line 7, in <module>
    fp = urllib2.urlopen('http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[%3AGC%3DZs%3A][%3ADI%3A]&abb=on&ucd=on&esc=on&g')
  File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python2.7/urllib2.py", line 437, in open
    response = meth(req, response)
  File "/usr/lib64/python2.7/urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib64/python2.7/urllib2.py", line 475, in error
    return self._call_chain(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 558, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 503: Service Temporarily Unavailable
make[1]: *** [fcblanks.h] Error 1
make[1]: Leaving directory `/home/aaron/git/ffmpeg-android/fontconfig/fc-blanks'
make: *** [install-recursive] Error 1

subtitle command run properly but subtitles dont show

i am using this command

ffmpeg -i /home/s9iper1/a.mp4 -vf "subtitles=/home/s9iper1/titles.srt:force_style='Fontsize=24,PrimaryColour=&H0000ff&'" -c:a copy /home/s9iper1/out.mp4

this command perfectly works in terminal and setting the subtitles in video but in android its not working i cannot see any subtitles in video.
PrimaryColour is not identified in android.

Can you help me to find the ''android_build.sh'' error reasons? thx

My OS is centos 6.7. and when i run the ''android_build.sh'' ,it occurs something like this

config.mk:25: builds/unix/unix-def.mk: No such file or directory
config.mk:26: builds/unix/unix-cc.mk: No such file or directory
make: execvp: ./include/freetype/freetype.h: Permission denied
make: *** No rule to make target builds/unix/unix-cc.mk'. Stop. generatingconfigure.ac'
running aclocal -I . --force' runninglibtoolize --force --copy --install'
libtoolize: putting auxiliary files in .'. libtoolize: copying file./config.guess'
libtoolize: copying file ./config.sub' libtoolize: copying file./install-sh'
libtoolize: copying file ./ltmain.sh' libtoolize: Consider addingAC_CONFIG_MACRO_DIR([m4])' to configure.ac and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding -I m4' to ACLOCAL_AMFLAGS in Makefile.am. runningautoconf --force'

FreeType build system -- automatic system detection

The following settings are used:

platform unix
compiler /home/wupengqiang/work/crossCompile/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi-gcc --sysroot=/home/wupengqiang/work/crossCompile/ffmpeg-android/toolchain-android/sysroot
configuration directory ./builds/unix
configuration rules ./builds/unix/unix.mk

If this does not correspond to your system or settings please remove the file
`config.mk' from this directory then read the INSTALL file for help.

Otherwise, simply type make' again to build the library, ormake refdoc' to build the API reference (this needs python >= 2.6).

cd builds/unix;
./configure '--with-pic' '--with-sysroot=/home/wupengqiang/work/crossCompile/ffmpeg-android/toolchain-android/sysroot' '--host=arm-linux-androideabi' '--enable-static' '--disable-shared' '--with-png=yes' '--with-zlib=yes' '--prefix=/home/wupengqiang/work/crossCompile/ffmpeg-android/toolchain-android'
configure: WARNING: unrecognized options: --with-sysroot
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking build system type... x86_64-unknown-linux-gnu
checking host system type... Invalid configuration arm-linux-androideabi': systemandroideabi' not recognized
configure: error: /bin/sh ./config.sub arm-linux-androideabi failed

make: *** [setup] Error 1

Where is the configure file

when i run android_build.sh.

./x264_build.sh: line 21: ./configure: No such file or directory

Whats Happening !!! Why the script do'nt create the configure?.

Some videos are not trimming(or cut)

I am using
compile 'com.github.hiteshsondhi88.libffmpeg:FFmpegAndroid:0.2.5'
and using command
execFFmpegBinary("-i " + path + " -ss " + startMs / 1000 + " -to " + endMs / 1000 + " -strict -2 -async 1 " + dest.getAbsolutePath());

to trim or cut videos.

Its working for some videos but for some videos its not working especially for videos that are shared from whatssapp.

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.