Closed pascaaaal closed 3 years ago
Would you mind explaining the mobile-ffmpeg
binary used in the application? Is it a prebuilt binary package installed from mavenCentral()
or a binary built locally?
It's the prebuild binary package full-gpl:4.4
from mavenCentral()
Tested your command using full-gpl
package on an arm64
device. I don't see anything wrong in the logs.
I suggest looking inside your apk file and checking if all mobile-ffmpeg
libraries are there for arm64
. Testing your application on another device can also help. It can be an issue about your device as well.
I/mobile-ffmpeg: Loading mobile-ffmpeg.
I/mobile-ffmpeg: Loaded mobile-ffmpeg-full-gpl-arm64-v8a-4.4-20210207.
D/mobile-ffmpeg-test: FFmpeg process started with arguments
'-i /data/user/0/com.arthenica.mobileffmpeg.test/cache/file.aac -ss 00:00:01.00 /data/user/0/com.arthenica.mobileffmpeg.test/files/file1.aac -y'.
I/mobile-ffmpeg: ffmpeg version v4.4-dev-416
I/mobile-ffmpeg: Copyright (c) 2000-2020 the FFmpeg developers
I/mobile-ffmpeg: built with Android (6454773 based on r365631c2) clang version 9.0.8 (https://android.googlesource.com/toolchain/llvm-project 98c855489587874b2a325e7a516b99d838599c6f) (based on LLVM 9.0.8svn)
I/mobile-ffmpeg: configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/home/taner/Projects/mobile-ffmpeg/prebuilt/android-arm64/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang++ --extra-libs='-L/home/taner/Projects/mobile-ffmpeg/prebuilt/android-arm64/cpu-features/lib -lndk_compat' --target-os=android --enable-neon --enable-asm --enable-inline-asm --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --enable-shared --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-openssl --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-audiotoolbox --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gmp --enable-gnutls --enable-libmp3lame --enable-libass --enable-iconv --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libopencore-amrnb --enable-libshine --enable-libspeex --enable-libwavpack --enable-libkvazaar --enable-libx264 --enable-gpl --enable-libxvid --enable-gpl --enable-libx265 --enable-gpl --enable-libvidstab --enable-gpl --enable-libilbc --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libaom --enable-libtwolame --disable-sdl2 --enable-libvo-amrwbenc --enable-zlib --enable-mediacodec
I/mobile-ffmpeg: libavutil 56. 55.100 / 56. 55.100
I/mobile-ffmpeg: libavcodec 58. 96.100 / 58. 96.100
I/mobile-ffmpeg: libavformat 58. 48.100 / 58. 48.100
I/mobile-ffmpeg: libavdevice 58. 11.101 / 58. 11.101
I/mobile-ffmpeg: libavfilter 7. 87.100 / 7. 87.100
I/mobile-ffmpeg: libswscale 5. 8.100 / 5. 8.100
I/mobile-ffmpeg: libswresample 3. 8.100 / 3. 8.100
W/mobile-ffmpeg: [aac @ 0x7816cb8200] Estimating duration from bitrate, this may be inaccurate
I/mobile-ffmpeg: Input #0, aac, from '/data/user/0/com.arthenica.mobileffmpeg.test/cache/file.aac':
I/mobile-ffmpeg: Duration:
I/mobile-ffmpeg: 00:03:05.99
I/mobile-ffmpeg: , bitrate:
I/mobile-ffmpeg: 128 kb/s
I/mobile-ffmpeg: Stream #0:0
I/mobile-ffmpeg: : Audio: aac, 44100 Hz, stereo, fltp, 128 kb/s
I/mobile-ffmpeg: Stream mapping:
I/mobile-ffmpeg: Stream #0:0 -> #0:0
I/mobile-ffmpeg: (aac (native) -> aac (native))
I/mobile-ffmpeg: Press [q] to stop, [?] for help
I/mobile-ffmpeg: Output #0, adts, to '/data/user/0/com.arthenica.mobileffmpeg.test/files/file1.aac':
I/mobile-ffmpeg: Metadata:
I/mobile-ffmpeg: encoder :
I/mobile-ffmpeg: Lavf58.48.100
I/mobile-ffmpeg: Stream #0:0
I/mobile-ffmpeg: : Audio: aac, 44100 Hz, stereo, fltp, 128 kb/s
I/mobile-ffmpeg: Metadata:
I/mobile-ffmpeg: encoder :
I/mobile-ffmpeg: Lavc58.96.100 aac
I/mobile-ffmpeg: size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x
I/mobile-ffmpeg: size= 132kB time=00:00:08.21 bitrate= 131.4kbits/s speed=16.4x
I/mobile-ffmpeg: size= 256kB time=00:00:18.39 bitrate= 114.0kbits/s speed=18.4x
I/mobile-ffmpeg: size= 256kB time=00:00:28.79 bitrate= 72.8kbits/s speed=19.2x
I/mobile-ffmpeg: size= 512kB time=00:00:40.26 bitrate= 104.2kbits/s speed=20.1x
I/mobile-ffmpeg: size= 768kB time=00:00:48.22 bitrate= 130.5kbits/s speed=19.3x
I/mobile-ffmpeg: size= 768kB time=00:00:58.49 bitrate= 107.6kbits/s speed=19.5x
I/mobile-ffmpeg: size= 1024kB time=00:01:08.84 bitrate= 121.8kbits/s speed=19.6x
I/mobile-ffmpeg: size= 1024kB time=00:01:18.59 bitrate= 106.7kbits/s speed=19.6x
I/mobile-ffmpeg: size= 1280kB time=00:01:28.76 bitrate= 118.1kbits/s speed=19.7x
I/mobile-ffmpeg: size= 1536kB time=00:01:38.89 bitrate= 127.2kbits/s speed=19.8x
I/mobile-ffmpeg: size= 1536kB time=00:01:49.29 bitrate= 115.1kbits/s speed=19.8x
I/mobile-ffmpeg: size= 1792kB time=00:02:00.04 bitrate= 122.3kbits/s speed= 20x
I/mobile-ffmpeg: size= 2048kB time=00:02:10.31 bitrate= 128.7kbits/s speed= 20x
I/mobile-ffmpeg: size= 2048kB time=00:02:15.44 bitrate= 123.9kbits/s speed=19.3x
I/mobile-ffmpeg: size= 2304kB time=00:02:24.72 bitrate= 130.4kbits/s speed=19.3x
I/mobile-ffmpeg: size= 2304kB time=00:02:35.01 bitrate= 121.8kbits/s speed=19.3x
I/mobile-ffmpeg: size= 2560kB time=00:02:46.71 bitrate= 125.8kbits/s speed=19.6x
I/mobile-ffmpeg: size= 2816kB time=00:02:58.97 bitrate= 128.9kbits/s speed=19.9x
I/mobile-ffmpeg: size= 2976kB time=00:03:06.15 bitrate= 131.0kbits/s speed=19.8x
I/mobile-ffmpeg: video:0kB audio:2921kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead:
I/mobile-ffmpeg: 1.876214%
I/mobile-ffmpeg: [aac @ 0x7813a8d300] Qavg: 1044.261
D/mobile-ffmpeg-test: FFmpeg process exited with rc 0.
Sorry for the delay, I tried different things, for example compiling mobile-ffmpeg myself and tweaking some Gradle Settings but nothing worked for arm64-v8a. I tried the App on a different ABI (armabi-v7a) and everything worked fine. I also tried the example code provided by the repo and it worked on arm64-v8a. I also checked the build, every file is present. My arm64-v8a device is a Google Pixel 5, I thought it should work on it. I also have some native code by myself in the app, could that be a problem?
I also have some native code by myself in the app, could that be a problem?
Yes, it can be. You can understand this by disabling your native code temporarily. Or disabling mobile-ffmpeg
if that is easier for you.
If I disable mobile-ffmpeg
it works. I use FFmpeg to decode my files. I compile this separately. It may be conflicting with mobile-ffmpeg
. Is there way to share these libraries?
Share?
That I can use the mobile-ffmpeg
binaries by my own native code. Eventually this will solve the conflict.
I checked it, I think the problem is, that I use mobile-ffmepg
besides a separate FFMpeg (for audio decoding) in the same app. Files like libavcodec conflict because they override themselves in the compiled app.
I'm not sure how you can do this using the aar
files of mobile-ffmpeg
. There is a prefab feature in Android to support native dependencies. However mobile-ffmpeg
doesn't support prefab
.
The only way I can think of is embedding your native code within mobile-ffmpeg
and building your own mobile-ffmpeg
binary using the build scripts.
Description When I run an Audio command like with the -ss filter. My App crashes. Command:
-i file.aac -ss 00:00:0100 file1.aac -y
Logs
Environment