Giter Club home page Giter Club logo

arthenica / ffmpeg-kit Goto Github PK

View Code? Open in Web Editor NEW
3.8K 51.0 513.0 12.8 MB

FFmpeg Kit for applications. Supports Android, Flutter, iOS, Linux, macOS, React Native and tvOS. Supersedes MobileFFmpeg, flutter_ffmpeg and react-native-ffmpeg.

Home Page: https://arthenica.github.io/ffmpeg-kit

License: GNU Lesser General Public License v3.0

Shell 15.76% C 54.28% Java 9.29% Makefile 3.44% M4 0.58% Objective-C 7.42% CMake 0.68% Ruby 0.29% JavaScript 0.01% Dart 3.32% C++ 4.94%
ffmpeg android macos ios tvos flutter linux react-native

ffmpeg-kit's Introduction

FFmpegKit GitHub release Maven Central CocoaPods pub npm

FFmpegKit is a collection of tools to use FFmpeg in Android, iOS, Linux, macOS, tvOS, Flutter and React Native applications.

It includes scripts to build FFmpeg native libraries, a wrapper library to run FFmpeg/FFprobe commands in applications and 8 prebuilt binary packages available at Github, Maven Central, CocoaPods, pub and npm.

1. Features

  • Scripts to build FFmpeg native libraries
  • FFmpegKit wrapper library to run FFmpeg/FFprobe commands in applications
  • Supports native platforms: Android, iOS, Linux, macOS and tvOS
  • Supports hybrid platforms: Flutter, React Native
  • Based on FFmpeg v4.5-dev or later with optional system and external libraries
  • 8 prebuilt binary packages available at Github, Maven Central, CocoaPods, pub and npm
  • Licensed under LGPL 3.0 by default, GPL v3.0 if GPL licensed libraries are enabled

2. Android

See Android to learn more about FFmpegKit for Android.

3. iOS, macOS, tvOS

See Apple to use FFmpegKit on Apple platforms (iOS, macOS, tvOS).

4. Flutter

See Flutter to learn more about FFmpegKit for Flutter.

5. Linux

See Linux to learn more about FFmpegKit for Linux.

6. React Native

See React Native to learn more about FFmpegKit for React Native.

7. Build Scripts

Use android.sh, ios.sh, linux.sh, macos.sh and tvos.sh to build FFmpegKit for each native platform.

All scripts support additional options to enable optional libraries and disable platform architectures. See Building wiki page for the details.

8. FFmpegKit Library

FFmpegKit is a wrapper library that allows you to easily run FFmpeg/FFprobe commands in applications. It provides additional features on top of FFmpeg to enable platform specific resources, control how commands are executed and how the results are handled.

Android library of FFmpegKit has a Java API, Apple libraries (iOS, macOS, tvOS) have an Objective-C API, Flutter library comes with a Dart API, Linux library has a C++ API and React Native library provides a JavaScript API with Typescript definitions, which are identical in terms of features and capabilities.

9. Packages

There are eight different ffmpeg-kit packages distributed on Github, Maven Central, CocoaPods, pub and npm. Below you can see which system libraries and external libraries are enabled in each one of them.

Please remember that some parts of FFmpeg are licensed under the GPL and only GPL licensed ffmpeg-kit 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
dav1d
fontconfig
freetype
fribidi
kvazaar
libass
libiconv
libtheora
libvpx
libwebp
snappy
zimg
dav1d
fontconfig
freetype
fribidi
gmp
gnutls
kvazaar
lame
libass
libiconv
libilbc
libtheora
libvorbis
libvpx
libwebp
libxml2
opencore-amr
opus
shine
snappy
soxr
speex
twolame
vo-amrwbenc
zimg
dav1d
fontconfig
freetype
fribidi
gmp
gnutls
kvazaar
lame
libass
libiconv
libilbc
libtheora
libvorbis
libvpx
libwebp
libxml2
opencore-amr
opus
shine
snappy
soxr
speex
twolame
vid.stab
vo-amrwbenc
x264
x265
xvidcore
zimg
android system libraries zlib
MediaCodec
ios system libraries bzip2
AudioToolbox
AVFoundation
iconv
VideoToolbox
zlib
macos system libraries bzip2
AudioToolbox
AVFoundation
Core Image
iconv
OpenCL
OpenGL
VideoToolbox
zlib
tvos system libraries bzip2
AudioToolbox
iconv
VideoToolbox
zlib
  • AVFoundation is not available on tvOS
  • VideoToolbox is not available on LTS releases of iOS and tvOS
  • zimg is supported since v4.5.1

10. Versions

FFmpegKit binaries generated use the same major and minor version numbers as the upstream FFmpeg project. The third and last number in the version string, if exists, is specific to FFmpegKit. It shows different releases from the same FFmpeg release branch.

dev part in the version string indicates that FFmpeg source code is cloned from the FFmpeg master branch and the exact version number of FFmpeg is obtained using the git describe --tags command.

Platforms FFmpegKit Version FFmpeg Version Release Date
Flutter 6.0.3 6.0 Sep 19, 2023
React Native 6.0.2 6.0 Sep 19, 2023
Flutter 6.0.2 6.0 Sep 03, 2023
React Native 6.0.1 6.0 Sep 03, 2023
Flutter 6.0.1 6.0 Sep 03, 2023
React Native 6.0.0 6.0 Aug 27, 2023
Flutter 6.0.0 6.0 Aug 27, 2023
Android
Apple
6.0 6.0 Aug 21, 2023
React Native 5.1.0 5.1.2 Oct 02, 2022
Flutter 5.1.0 5.1.2 Oct 02, 2022
Android
Apple
5.1 5.1.2 Sep 29, 2022
React Native 4.5.2 4.5-dev-3393 May 25, 2022
Flutter 4.5.1 4.5-dev-3393 Jan 02, 2022
React Native 4.5.1 4.5-dev-3393 Jan 02, 2022
Android 4.5.1 4.5-dev-3393 Jan 01, 2022
Apple 4.5.1 4.5-dev-3393 Dec 30, 2021
Flutter 4.5.0 4.5-dev-2008 Oct 05, 2021
React Native 4.5.0 4.5-dev-2008 Oct 01, 2021
Android
Apple
4.5 4.5-dev-2008 Sep 18, 2021
Android
Apple
4.4 4.4-dev-3015 Mar 03, 2021

11. LTS Releases

FFmpegKit binaries are published in two release 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
iOS Min SDK 12.1 10
iOS VideoToolbox Yes -
iOS AVFoundation Yes -
iOS Architectures arm64
arm64-simulator
arm64-mac-catalyst
x86-64
x86-64-mac-catalyst
armv7
arm64
i386
x86-64
iOS Bundle Format XCFrameworks Frameworks
Mac Catalyst Min Version 14.0 -
macOS Min SDK 10.15 10.12
macOS AVFoundation Yes -
macOS Architectures arm64
x86-64
x86-64
macOS Bundle Format XCFrameworks Frameworks
tvOS Min SDK 11.0 10.0
tvOS VideoToolbox Yes -
tvOS Architectures arm64
x86-64
arm64-simulator
arm64
x86-64
tvOS Bundle Format XCFrameworks Frameworks

12. Documentation

A more detailed documentation is available under Wiki.

13. Test Applications

You can see how FFmpegKit is used inside an application by running test applications created under FFmpegKit Test project.

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

14. License

FFmpegKit library alone is licensed under the LGPL v3.0.

FFmpegKit bundles (.aar archives, frameworks, xcframeworks), which include both FFmpegKit and FFmpeg libraries, are also licensed under the LGPL v3.0. However, if the source code is built using the optional --enable-gpl flag or prebuilt binaries with -gpl postfix are used, then FFmpegKit bundles become subject to the GPL v3.0. Because, FFmpeg is licensed under the GPL v3.0 in those bundles. And that makes the whole bundle effectively subject to the GPL v3.0.

FFmpegKit build scripts always configure FFmpeg with --enable-version3 option. And never enable non-free libraries. Thus, FFmpeg libraries created by FFmpegKit are licensed under the LGPL v3.0 by default. Only when --enable-gpl is provided they become subject to GPL v3.0. That is how prebuilt binaries with -gpl postfix are compiled.

Refer to Licenses to see the licenses of all libraries. Trademark lists the trademarks used in the FFmpegKit documentation.

15. 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 ffmpeg-kit with openh264 and distribute that library, then you are subject to pay MPEG LA licensing fees. Refer to OpenH264 FAQ page for the details.

16. Contributing

See our CONTRIBUTING guide.

17. See Also

ffmpeg-kit's People

Contributors

a-huk avatar daentech avatar deckerst avatar moffatman avatar pweisensee avatar shabinder avatar suencooper avatar superandrew213 avatar tanersener avatar twixes avatar yanivshaked avatar yeamin19 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

ffmpeg-kit's Issues

Unable to Run on Apple TV Device

Description
I'm able to build and run in simulator, but when trying to build to an Actual Apple TV I receive the following failure:

ld: in /Build/Products/Debug-appletvos/libavutil.framework/libavutil(mem.o), building for tvOS, but linking in object file /Build/Products/Debug-appletvos/libavutil.framework/libavutil(mem.o)) built for tvOS Simulator, for architecture arm64

Expected behavior
To run app on Apple TV Device

Current behavior
Fails to build and responds with error:

ld: in /Build/Products/Debug-appletvos/libavutil.framework/libavutil(mem.o), building for tvOS, but linking in object file /Build/Products/Debug-appletvos/libavutil.framework/libavutil(mem.o)) built for tvOS Simulator, for architecture arm64

To Reproduce
Add ffmpeg-kit to project and build to an apple tv device not simulator.

Screenshots
If applicable, add screenshots to help explain your problem.

Logs

ld: in /Build/Products/Debug-appletvos/libavutil.framework/libavutil(mem.o), building for tvOS, but linking in object file /Build/Products/Debug-appletvos/libavutil.framework/libavutil(mem.o)) built for tvOS Simulator, for architecture arm64

Environment

  • Platform: tvOS
  • Architecture: arm64
  • Version 4.4
  • Source branch (if applicable) master
  • Xcode version (if applicable) 12.4
  • Cocoapods version (if applicable) [e.g. 1.9.1]
  • Android Studio version (if applicable) [e.g. 4.0]
  • Android NDK version (if applicable) [e.g. 16b, r17c, r21d]

Other
Add any other context about the problem here.

fileless input/output

Is your feature request related to a problem? Please describe.
be able to convert a media without writing the input and output to the disk

Describe the solution you'd like
allow inputs and outputs to be seen as inputstream and outputstream

Platform
Is this a general feature for all platforms or a platform specific feature?
ideally on all platforms also my interest is mainly android

Scoped Storage

Current behavior :
Now I am using ffmpegkit 4.4 for testing purpose and the command is
String videoPath = FFmpegKitConfig.getSafParameterForWrite(context, inputUri);
String cmd = "-ss " + start + " -t " + duration + " -accurate_seek" + " -i " + videoPath + " -codec copy -avoid_negative_ts 1 " + outputFile;

While executing the command , session is giving me the protocol not found error. (saf:-1/VID_20210423_053509.mp4: Protocol not found)
Can you help to identify the issue.

Please note : My app targets sdk 30 and have requestLegacyExternalStorage = false

ERROR: inflate returned error -3

My Project
ScreenRecordCase.zip
2021-05-10 15:06:44.699778+0800 ScreenRecordCase[2330:526317] Loading ffmpeg-kit.
2021-05-10 15:06:44.708987+0800 ScreenRecordCase[2330:526317] Loaded ffmpeg-kit-full-arm64-4.4-20210303
2021-05-10 15:06:44.716047+0800 ScreenRecordCase[2330:526487] INFO: ffmpeg version v4.4-dev-3015-gc0d0b1c4f6
2021-05-10 15:06:44.716194+0800 ScreenRecordCase[2330:526487] INFO: Copyright (c) 2000-2021 the FFmpeg developers
2021-05-10 15:06:44.716320+0800 ScreenRecordCase[2330:526487] INFO:
2021-05-10 15:06:44.716412+0800 ScreenRecordCase[2330:526487] INFO: built with Apple clang version 12.0.0 (clang-1200.0.32.29)
2021-05-10 15:06:44.716692+0800 ScreenRecordCase[2330:526487] INFO: configuration: --cross-prefix=arm64-ios-darwin- --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk --prefix=/Users/taner/Projects/ffmpeg-kit/prebuilt/apple-ios-arm64/ffmpeg --pkg-config=/usr/local/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8 --target-os=darwin --enable-neon --enable-asm --ar=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar --cc=clang --cxx=clang++ --as='/Users/taner/Projects/ffmpeg-kit/.tmp/gas-preprocessor.pl -arch aarch64 -- clang -arch arm64 -target arm64-apple-ios12.1 -march=armv8-a+crc+crypto -mcpu=generic -DFFMPEG_KIT_ARM64 -Wno-unused-function -Wno-deprecated-declarations -fstrict-aliasing -fembed-bitcode -DIOS -DFFMPEG_KIT_BUILD_DATE=20210303 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk -Oz -miphoneos-version-min=12.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk/usr/include' --ranlib=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib --strip=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip --ranlib=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib --strip=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip --nm=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm --disable-autodetect --enable-cross-compile --enable-pic --enable-inline-asm --enable-optimizations --enable-swscale --enable-static --disable-shared --enable-pthreads --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --enable-small --disable-openssl --disable-xmm-clobber-test --disable-debug --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --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-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libopencore-amrnb --enable-libshine --enable-libspeex --enable-libdav1d --enable-libkvazaar --enable-libilbc --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libtwolame --disable-sdl2 --enable-libvo-amrwbenc --enable-zlib --enable-audiotoolbox --disable-outdev=audiotoolbox --enable-bzlib --enable-videotoolbox --enable-avfoundation --enable-iconv --disable-coreimage --disable-appkit --disable-opencl --disable-opengl
2021-05-10 15:06:44.718160+0800 ScreenRecordCase[2330:526487] INFO: libavutil 56. 65.100 / 56. 65.100
2021-05-10 15:06:44.718293+0800 ScreenRecordCase[2330:526487] INFO: libavcodec 58.123.100 / 58.123.100
2021-05-10 15:06:44.718402+0800 ScreenRecordCase[2330:526487] INFO: libavformat 58. 67.100 / 58. 67.100
2021-05-10 15:06:44.718489+0800 ScreenRecordCase[2330:526487] INFO: libavdevice 58. 12.100 / 58. 12.100
2021-05-10 15:06:44.718581+0800 ScreenRecordCase[2330:526487] INFO: libavfilter 7.106.100 / 7.106.100
2021-05-10 15:06:44.718676+0800 ScreenRecordCase[2330:526487] INFO: libswscale 5. 8.100 / 5. 8.100
2021-05-10 15:06:44.718755+0800 ScreenRecordCase[2330:526487] INFO: libswresample 3. 8.100 / 3. 8.100
2021-05-10 15:06:44.735923+0800 ScreenRecordCase[2330:526487] ERROR: inflate returned error -3
2021-05-10 15:06:44.739700+0800 ScreenRecordCase[2330:526487] INFO: Input #0, png_pipe, from '/private/var/containers/Bundle/Application/17C17585-54F2-429C-8B8C-D60BF7096C31/ScreenRecordCase.app/Silver.png':
2021-05-10 15:06:44.739763+0800 ScreenRecordCase[2330:526487] INFO: Duration:
2021-05-10 15:06:44.739820+0800 ScreenRecordCase[2330:526487] INFO: N/A
2021-05-10 15:06:44.739862+0800 ScreenRecordCase[2330:526487] INFO: , bitrate:
2021-05-10 15:06:44.739911+0800 ScreenRecordCase[2330:526487] INFO: N/A
2021-05-10 15:06:44.739960+0800 ScreenRecordCase[2330:526487] INFO:
2021-05-10 15:06:44.739994+0800 ScreenRecordCase[2330:526487] INFO: Stream #0:0
2021-05-10 15:06:44.740032+0800 ScreenRecordCase[2330:526487] INFO: : Video: png, rgba(pc), 1405x2796
2021-05-10 15:06:44.740083+0800 ScreenRecordCase[2330:526487] INFO: ,
2021-05-10 15:06:44.740233+0800 ScreenRecordCase[2330:526487] INFO: 25 fps,
2021-05-10 15:06:44.740345+0800 ScreenRecordCase[2330:526487] INFO: 25 tbr,
2021-05-10 15:06:44.740476+0800 ScreenRecordCase[2330:526487] INFO: 25 tbn,
2021-05-10 15:06:44.740650+0800 ScreenRecordCase[2330:526487] INFO: 25 tbc
2021-05-10 15:06:44.740828+0800 ScreenRecordCase[2330:526487] INFO:
2021-05-10 15:06:44.776562+0800 ScreenRecordCase[2330:526487] INFO: Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/private/var/containers/Bundle/Application/17C17585-54F2-429C-8B8C-D60BF7096C31/ScreenRecordCase.app/input.mp4':
2021-05-10 15:06:44.776657+0800 ScreenRecordCase[2330:526487] INFO: Metadata:
2021-05-10 15:06:44.776682+0800 ScreenRecordCase[2330:526487] INFO: major_brand :
2021-05-10 15:06:44.776731+0800 ScreenRecordCase[2330:526487] INFO: mp42
2021-05-10 15:06:44.776791+0800 ScreenRecordCase[2330:526487] INFO:
2021-05-10 15:06:44.776827+0800 ScreenRecordCase[2330:526487] INFO: minor_version :
2021-05-10 15:06:44.776864+0800 ScreenRecordCase[2330:526487] INFO: 1
2021-05-10 15:06:44.776890+0800 ScreenRecordCase[2330:526487] INFO:
2021-05-10 15:06:44.777086+0800 ScreenRecordCase[2330:526487] INFO: compatible_brands:
2021-05-10 15:06:44.777264+0800 ScreenRecordCase[2330:526487] INFO: isommp41mp42
2021-05-10 15:06:44.777399+0800 ScreenRecordCase[2330:526487] INFO:
2021-05-10 15:06:44.777550+0800 ScreenRecordCase[2330:526487] INFO: creation_time :
2021-05-10 15:06:44.777681+0800 ScreenRecordCase[2330:526487] INFO: 2021-04-28T02:02:10.000000Z
2021-05-10 15:06:44.777834+0800 ScreenRecordCase[2330:526487] INFO:
2021-05-10 15:06:44.777943+0800 ScreenRecordCase[2330:526487] INFO: Duration:
2021-05-10 15:06:44.778059+0800 ScreenRecordCase[2330:526487] INFO: 00:00:08.93
2021-05-10 15:06:44.778212+0800 ScreenRecordCase[2330:526487] INFO: , start:
2021-05-10 15:06:44.778324+0800 ScreenRecordCase[2330:526487] INFO: 0.000000
2021-05-10 15:06:44.778426+0800 ScreenRecordCase[2330:526487] INFO: , bitrate:
2021-05-10 15:06:44.778548+0800 ScreenRecordCase[2330:526487] INFO: 13793 kb/s
2021-05-10 15:06:44.778688+0800 ScreenRecordCase[2330:526487] INFO:
2021-05-10 15:06:44.778791+0800 ScreenRecordCase[2330:526487] INFO: Stream #1:0
2021-05-10 15:06:44.778917+0800 ScreenRecordCase[2330:526487] INFO: (und)
2021-05-10 15:06:44.779031+0800 ScreenRecordCase[2330:526487] INFO: : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 100 kb/s
2021-05-10 15:06:44.779149+0800 ScreenRecordCase[2330:526487] INFO: (default)
2021-05-10 15:06:44.779297+0800 ScreenRecordCase[2330:526487] INFO:
2021-05-10 15:06:44.779417+0800 ScreenRecordCase[2330:526487] INFO: Metadata:
2021-05-10 15:06:44.779531+0800 ScreenRecordCase[2330:526487] INFO: creation_time :
2021-05-10 15:06:44.779640+0800 ScreenRecordCase[2330:526487] INFO: 2021-04-28T02:02:10.000000Z
2021-05-10 15:06:44.779765+0800 ScreenRecordCase[2330:526487] INFO:
2021-05-10 15:06:44.779865+0800 ScreenRecordCase[2330:526487] INFO: handler_name :
2021-05-10 15:06:44.779976+0800 ScreenRecordCase[2330:526487] INFO: Core Media Audio
2021-05-10 15:06:44.780143+0800 ScreenRecordCase[2330:526487] INFO:
2021-05-10 15:06:44.780231+0800 ScreenRecordCase[2330:526487] INFO: vendor_id :
2021-05-10 15:06:44.780318+0800 ScreenRecordCase[2330:526487] INFO: [0][0][0][0]
2021-05-10 15:06:44.780480+0800 ScreenRecordCase[2330:526487] INFO:
2021-05-10 15:06:44.780599+0800 ScreenRecordCase[2330:526487] INFO: Stream #1:1
2021-05-10 15:06:44.780733+0800 ScreenRecordCase[2330:526487] INFO: (und)
2021-05-10 15:06:44.780823+0800 ScreenRecordCase[2330:526487] INFO: : Video: h264 (avc1 / 0x31637661), yuvj420p(pc, bt709/bt709/iec61966-2-1), 828x1792, 13632 kb/s
2021-05-10 15:06:44.780982+0800 ScreenRecordCase[2330:526487] INFO: ,
2021-05-10 15:06:44.781113+0800 ScreenRecordCase[2330:526487] INFO: 59.67 fps,
2021-05-10 15:06:44.781194+0800 ScreenRecordCase[2330:526487] INFO: 60 tbr,
2021-05-10 15:06:44.781266+0800 ScreenRecordCase[2330:526487] INFO: 600 tbn,
2021-05-10 15:06:44.781442+0800 ScreenRecordCase[2330:526487] INFO: 1200 tbc
2021-05-10 15:06:44.781577+0800 ScreenRecordCase[2330:526487] INFO: (default)
2021-05-10 15:06:44.781704+0800 ScreenRecordCase[2330:526487] INFO:
2021-05-10 15:06:44.781882+0800 ScreenRecordCase[2330:526487] INFO: Metadata:
2021-05-10 15:06:44.782010+0800 ScreenRecordCase[2330:526487] INFO: creation_time :
2021-05-10 15:06:44.782129+0800 ScreenRecordCase[2330:526487] INFO: 2021-04-28T02:02:10.000000Z
2021-05-10 15:06:44.782277+0800 ScreenRecordCase[2330:526487] INFO:
2021-05-10 15:06:44.782397+0800 ScreenRecordCase[2330:526487] INFO: handler_name :
2021-05-10 15:06:44.782538+0800 ScreenRecordCase[2330:526487] INFO: Core Media Video
2021-05-10 15:06:44.782627+0800 ScreenRecordCase[2330:526487] INFO:
2021-05-10 15:06:44.782811+0800 ScreenRecordCase[2330:526487] INFO: vendor_id :
2021-05-10 15:06:44.782951+0800 ScreenRecordCase[2330:526487] INFO: [0][0][0][0]
2021-05-10 15:06:44.783086+0800 ScreenRecordCase[2330:526487] INFO:
2021-05-10 15:06:44.783198+0800 ScreenRecordCase[2330:526487] INFO: Stream mapping:
2021-05-10 15:06:44.783316+0800 ScreenRecordCase[2330:526487] INFO: Stream #0:0 (png) -> overlay:main
2021-05-10 15:06:44.783440+0800 ScreenRecordCase[2330:526487] INFO:
2021-05-10 15:06:44.783565+0800 ScreenRecordCase[2330:526487] INFO: Stream #1:1 (h264) -> overlay:overlay
2021-05-10 15:06:44.783709+0800 ScreenRecordCase[2330:526487] INFO:
2021-05-10 15:06:44.783793+0800 ScreenRecordCase[2330:526487] INFO: overlay
2021-05-10 15:06:44.783874+0800 ScreenRecordCase[2330:526487] INFO: -> Stream #0:0 (mpeg4)
2021-05-10 15:06:44.784006+0800 ScreenRecordCase[2330:526487] INFO: Stream #1:0 -> #0:1
2021-05-10 15:06:44.784174+0800 ScreenRecordCase[2330:526487] INFO: (copy)
2021-05-10 15:06:44.784296+0800 ScreenRecordCase[2330:526487] INFO:
2021-05-10 15:06:44.784394+0800 ScreenRecordCase[2330:526487] INFO: Press [q] to stop, [?] for help
2021-05-10 15:06:44.784509+0800 ScreenRecordCase[2330:526487] ERROR: inflate returned error -3
2021-05-10 15:06:44.784621+0800 ScreenRecordCase[2330:526487] ERROR: inflate returned error -3
2021-05-10 15:06:44.786021+0800 ScreenRecordCase[2330:526487] ERROR: inflate returned error -3
2021-05-10 15:06:44.788109+0800 ScreenRecordCase[2330:526487] ERROR: inflate returned error -3
2021-05-10 15:06:44.790279+0800 ScreenRecordCase[2330:526487] ERROR: inflate returned error -3

Ffmpeg Execution failed with Crash

Description
I am trimming video and suddenly app crash while calling FFmpegKit.executeAsync(command, new ExecuteCallback() {...}

Current behavior
App not crashes every time but i can't find any specific condition for why and when it is crashing.

Logs
java.lang.Error: FFmpegKit failed to start on brand: OnePlus, model: AC2001, device: Nord, api level: 30, abis: arm64-v8a armeabi-v7a armeabi, 32bit abis: armeabi-v7a armeabi, 64bit abis: arm64-v8a

Environment

  • Platform: Android
  • Architecture: arm64-v8a

Get File Info by filePath/ contentUri

Feature Request/Problem
In previous repo i'm able to get audio/video information by just providing file path but in this repo we can not do that..
(i.e. audio/video bitrate, format, sample rate, etc..)

Solution
Before i'm using AsyncGetMediaInformationTask and GetMediaInformationCallback for this purpose.

Platform
N/A

Let me just specify, i don't want this feature while command execution, i want it independently without execution, for example i want video bitrate before execution(i can also use MediaMetadataRetriever for getting video birtate but it's crash many times, so it's not trustworthy)

Support for harfbuzz complex shaper into libass

Is your feature request related to a problem? Please describe.
I am using flutter-ffmpeg for hardcoding subtitle file into video. Issue is i have arabic text and when i burn subtitle to video, it just shows blank rectangles. I checked with other languages too like chinese, thai, indic languages, and same issue happens everywhere.

Describe the solution you'd like
Fribidi is just a simple shaper, it can't handle complex languages. Harfbuzz support is really needed in ffmpeg-kit for libass library.
Fribidi is just good for latin text, but non latin languages looks totally scrambled or just appears blank rectangles or nothing at all. Few characters do appear but it makes no sense to watch anything at all. If possible, could you add harfbuzz support to ffmpeg-kit in the libass library ?

Describe alternatives you've considered
Currently i dont have any alternative solution for this.

Platform
its a general feature that can be added which will support all platforms, but basically i need it for android and ios currently.

Question: How to cancel a session completely

I'm trying to cancel a running rtmp session on android started with FFprobeKit.executeAsync(), but for some reason it doesn't completely close the connection even tho the session says it's completed. I get a callback and it seems like it ended, but it doesn't. Also canceled sessions seem to stick around after they get canceled. Is there a way to remove them?

This is what i do to cancel all running sessions...

List<Session> sessions = FFmpegKitConfig.getSessions();
for (int i = 0; i < sessions.size(); i++) {
  Session session = sessions.get(i);
  FFmpegKit.cancel(session.getSessionId());
}

Also tried FFmpegKit.cancel() but i get the same result

From the first session (that doesn't stop) i get this when i cancel it which looks like its done..

Exiting normally, received signal 2.
, state=COMPLETED, returnCode=255, failStackTrace='null'}

But my rtmp server still thinks there is a connection and when i try to start a new one i get this instantly..

[rtmp @ 0x7e2d0fcf80] Server error: Stream already publishing
rtmp://10.0.0.200/live/android: Operation not permitted
, state=COMPLETED, returnCode=1, failStackTrace='null'}

When i start multiple sessions i get all tries listed as sessions from getSessions() with completed state and they never seem to go away.

I'm very new to android and java so maybe i'm just missing something simple, or this is just normal, but it doesn't seem right.
Is there maybe another way to just force kill all ffmpeg processes?

About ffmpeg-kit-ios-full-xcframeworks.sh

My pod file like this:
platform :ios, '12.1'
target 'test' do
pod 'ffmpeg-kit-ios-full', '~> 4.4.LTS'
end
Run pod install,Run App on simulators,It's Ok.
But when I run app on my Iphone7P, I get error message:


n /Users/appworks/Library/Developer/Xcode/DerivedData/test-gvnlrtqxnqeyvsfeghzsfaluykbt/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/expat/expat.framework/expat(xmlparse.o), building for iOS, but linking in object file (/Users/appworks/Library/Developer/Xcode/DerivedData/test-gvnlrtqxnqeyvsfeghzsfaluykbt/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/expat/expat.framework/expat(xmlparse.o)) built for Mac Catalyst, file '/Users/appworks/Library/Developer/Xcode/DerivedData/test-gvnlrtqxnqeyvsfeghzsfaluykbt/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/expat/expat.framework/expat' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

So,I changed the file 'ffmpeg-kit-ios-full-xcframeworks.sh' :
install_xcframework "${PODS_ROOT}/ffmpeg-kit-ios-full/ffmpegkit.xcframework" "ffmpegkit" "framework" "ios-arm64/ffmpegkit.framework" "ios-arm64_x86_64-simulator/ffmpegkit.framework" "ios-arm64_x86_64-maccatalyst/ffmpegkit.framework"
....................(many lines like this)
changed to:
install_xcframework "${PODS_ROOT}/ffmpeg-kit-ios-full/ffmpegkit.xcframework" "ffmpegkit" "framework" "ios-arm64/ffmpegkit.framework"
....................
Now,I can run my app on my iPhone success.
Is this a bug?
(sorry about my poor english!)

Compression failed while app is Arabic

Description
While app is arabic, compression failed

Expected behavior
compression is done

Current behavior
failed to compress file. however if app is arabic compression is done

To Reproduce

  • change app localization into arabic and try to compress a video
    commpress command
  private fun compressCommand(media: Media, t: Int, path: String): Array<out String> {
        return arrayOf(
            "-i",
            media.mediaUrl!!,                 // input file
            "-t",
            t.secondsToTime,                  // duration of video
            "-vf",
            "scale=-2:'min(1024,ih)'",        // chnage height to be at max 1024 and perserve Width ratio
            "-c:v",
            "libx264",                      // H.264 encoding
            "-preset",
            "fast",
            "-c:a",
            "copy",                         // create another copy of audio without encoding
            "-y",                                   // overwrite output file without asking
            path
        )
    }

Expected behavior
compression is done

Screenshots
If applicable, add screenshots to help explain your problem.

Logs
Post logs here or paste them to Ghostbin and insert the link here.

Environment

  • Platform: [e.g. Android]
  • Architecture: [arm-v7a, arm-v7a-neon, arm64-v8a, x86, x86_64, armv7, armv7s, arm64, arm64-mac-catalyst, arm64-simulator, arm64e, i386, x86-64, x86-64-mac-catalyst ]
  • Version (if applicable) [e.g. v4.4]
  • Source branch (if applicable) [e.g. master, development, v4.4]
  • Xcode version (if applicable) [e.g. 7.3.1, 9.0.1, 12.0]
  • Android Studio version (if applicable) [e.g. 4.0]
  • Android NDK version (if applicable) [e.g. 16b, r17c, r21d]

Other
Add any other context about the problem here.

media information

@tanersener Hi I need get bitrate of video as I was using "FFmpeg.getMediaInformation(ipVideo).getBitrate();" in 4.2.2. Which method I have to call in 4.4.LTS to get bitrate and duration ?

Reasoning for this library

Out of curiosity: What is the reasoning / motivation that this library was created to replace mobile-ffmpeg?

Build error on ios device

Create a new app project ,add a podfile:
platform :ios, '12.1' target 'ffmpegkitTest' do pod 'ffmpeg-kit-ios-full', '~> 4.4.LTS' end
Run pod install,compile and run on my iPhone 7P, I get error message:

In /Users/appworks/Library/Developer/Xcode/DerivedData/ffmpegkitTest-dwvitzoituikboghqvvapxjojfve/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/expat/expat.framework/expat(xmlparse.o), building for iOS, but linking in object file (/Users/appworks/Library/Developer/Xcode/DerivedData/ffmpegkitTest-dwvitzoituikboghqvvapxjojfve/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/expat/expat.framework/expat(xmlparse.o)) built for Mac Catalyst, file '/Users/appworks/Library/Developer/Xcode/DerivedData/ffmpegkitTest-dwvitzoituikboghqvvapxjojfve/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/expat/expat.framework/expat' for architecture arm64

I did some test on simulator,
Simulators run success

Library increase the size of APK

A great library to use ffmpeg commands but it increases the size of the apk alot.
implementation 'com.arthenica:ffmpeg-kit-min:4.4.LTS'
just using this makes the size of apk 70mb
and if I use the 'full' version the size becomes 120mb
Kindly let me know if there is any way to decrease the size of apk

Scoped storage

Description
Hi Working on android 11 OS. As I was using your ffmpeg libray 4.2.2.LTS library every thing is working perfectly. Now as we have to use scope storage, can I use the same version 4.2.2.LTS or I have to use your latest 4.4.LTS ?

Current behavior
Now I am using 4.4.LTS for testing purpose and the command is "String cmommand = ("-y -i " + videoPath + " -t -vf hue=h=0:s=2.5 metadata:s:v rotate=0 -c:v libx264 -preset ultrafast -ar 44100 -c:a aac -ab 128k -strict -2 "+filePath);" its giving error like "Invalid duration specification for t: -vf". Please let me know which one I have to use 4.2.2.LTS or 4.4.LTS

couldn't find "libffmpegkit_abidetect.so"

I trying to run ffmpeg on armeabi device, but it throws this error:

 2021-05-12 13:20:52.748 25611-25703/com.aispad2.nfc.prod E/AudioSync: .(AudioSync.java:0) - java.lang.Error: FFmpegKit failed to start on brand: samsung, model: SM-T585, device: gtaxllte, api level: 27, abis: armeabi-v7a armeabi, 32bit abis: armeabi-v7a armeabi, 64bit abis: .
    at com.arthenica.ffmpegkit.NativeLoader.loadLibrary(NativeLoader.java:47)
    at com.arthenica.ffmpegkit.NativeLoader.loadFFmpegKitAbiDetect(NativeLoader.java:127)
    at com.arthenica.ffmpegkit.AbiDetect.<clinit>(AbiDetect.java:30)
    at com.arthenica.ffmpegkit.AbiDetect.getNativeAbi(Native Method)
    at com.arthenica.ffmpegkit.NativeLoader.loadNativeAbi(NativeLoader.java:62)
    at com.arthenica.ffmpegkit.NativeLoader.loadFFmpegKit(NativeLoader.java:167)
    at com.arthenica.ffmpegkit.FFmpegKitConfig.<clinit>(FFmpegKitConfig.java:100)
    at com.arthenica.ffmpegkit.FFmpegKitConfig.getLogRedirectionStrategy(FFmpegKitConfig.java:1094)
    at com.arthenica.ffmpegkit.FFmpegSession.<init>(FFmpegSession.java:76)
    at com.arthenica.ffmpegkit.FFmpegSession.<init>(FFmpegSession.java:61)
    at com.arthenica.ffmpegkit.FFmpegSession.<init>(FFmpegSession.java:51)
    at com.arthenica.ffmpegkit.FFmpegKit.execute(FFmpegKit.java:59)
    at com.arthenica.ffmpegkit.FFmpegKit.execute(FFmpegKit.java:151)
    at com.aispad2.sync.modules.AudioSync.lambda$convertAudio$7$AudioSync(AudioSync.java:376)
    at com.aispad2.sync.modules.-$$Lambda$AudioSync$t9b-OOepHchmWHoTd-tf7KlwuS0.subscribe(Unknown Source:4)
    at io.reactivex.internal.operators.single.SingleCreate.subscribeActual(SingleCreate.java:39)
    at io.reactivex.Single.subscribe(Single.java:3666)
    at io.reactivex.internal.operators.single.SingleFlatMap$SingleFlatMapCallback.onSuccess(SingleFlatMap.java:84)
    at io.reactivex.internal.operators.single.SingleCreate$Emitter.onSuccess(SingleCreate.java:67)
    at com.aispad2.sync.modules.AudioSync.lambda$compose$8$AudioSync(AudioSync.java:554)
    at com.aispad2.sync.modules.-$$Lambda$AudioSync$E1J3auGhVxVUtLxGNoACwJowtWM.subscribe(Unknown Source:6)
    at io.reactivex.internal.operators.single.SingleCreate.subscribeActual(SingleCreate.java:39)
    at io.reactivex.Single.subscribe(Single.java:3666)
    at io.reactivex.internal.operators.single.SingleFlatMap.subscribeActual(SingleFlatMap.java:36)
    at io.reactivex.Single.subscribe(Single.java:3666)
    at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
    at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
    at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
    at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
    at java.lang.Thread.run(Thread.java:764)
 Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.aispad2.nfc.prod-JIGLR1Wswh0B5yjpBFW-jg==/base.apk"],nativeLibraryDirectories=[/data/app/com.aispad2.nfc.prod-JIGLR1Wswh0B5yjpBFW-jg==/lib/arm, /system/lib, /system/vendor/lib]]] couldn't find "libffmpegkit_abidetect.so"
    at java.lang.Runtime.loadLibrary0(Runtime.java:1011)
    at java.lang.System.loadLibrary(System.java:1657)
    at com.arthenica.ffmpegkit.NativeLoader.loadLibrary(NativeLoader.java:45)
    at com.arthenica.ffmpegkit.NativeLoader.loadFFmpegKitAbiDetect(NativeLoader.java:127) 
    at com.arthenica.ffmpegkit.AbiDetect.<clinit>(AbiDetect.java:30) 
    at com.arthenica.ffmpegkit.AbiDetect.getNativeAbi(Native Method) 
    at com.arthenica.ffmpegkit.NativeLoader.loadNativeAbi(NativeLoader.java:62) 
    at com.arthenica.ffmpegkit.NativeLoader.loadFFmpegKit(NativeLoader.java:167) 
    at com.arthenica.ffmpegkit.FFmpegKitConfig.<clinit>(FFmpegKitConfig.java:100) 
    at com.arthenica.ffmpegkit.FFmpegKitConfig.getLogRedirectionStrategy(FFmpegKitConfig.java:1094) 
    at com.arthenica.ffmpegkit.FFmpegSession.<init>(FFmpegSession.java:76) 
    at com.arthenica.ffmpegkit.FFmpegSession.<init>(FFmpegSession.java:61) 
    at com.arthenica.ffmpegkit.FFmpegSession.<init>(FFmpegSession.java:51) 
    at com.arthenica.ffmpegkit.FFmpegKit.execute(FFmpegKit.java:59) 
    at com.arthenica.ffmpegkit.FFmpegKit.execute(FFmpegKit.java:151) 
    at com.aispad2.sync.modules.AudioSync.lambda$convertAudio$7$AudioSync(AudioSync.java:376) 
    at com.aispad2.sync.modules.-$$Lambda$AudioSync$t9b-OOepHchmWHoTd-tf7KlwuS0.subscribe(Unknown Source:4) 
    at io.reactivex.internal.operators.single.SingleCreate.subscribeActual(SingleCreate.java:39) 
    at io.reactivex.Single.subscribe(Single.java:3666) 
    at io.reactivex.internal.operators.single.SingleFlatMap$SingleFlatMapCallback.onSuccess(SingleFlatMap.java:84) 
    at io.reactivex.internal.operators.single.SingleCreate$Emitter.onSuccess(SingleCreate.java:67) 
    at com.aispad2.sync.modules.AudioSync.lambda$compose$8$AudioSync(AudioSync.java:554) 
    at com.aispad2.sync.modules.-$$Lambda$AudioSync$E1J3auGhVxVUtLxGNoACwJowtWM.subscribe(Unknown Source:6) 
    at io.reactivex.internal.operators.single.SingleCreate.subscribeActual(SingleCreate.java:39) 
    at io.reactivex.Single.subscribe(Single.java:3666) 
    at io.reactivex.internal.operators.single.SingleFlatMap.subscribeActual(SingleFlatMap.java:36) 
    at io.reactivex.Single.subscribe(Single.java:3666) 
    at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89) 
    at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578) 
    at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66) 
    at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) 
    at java.lang.Thread.run(Thread.java:764) 

On arm64 device it works well. Can anyone help?

Environment

  • Platform: Android 8.1
  • Architecture: armeabi-v7a, armeabi
  • ffmpeg-kit-full, version: '4.4.LTS'
  • Android Studio version (if applicable) 4.1.3

Suggestion: Add (optional) librtmp support

Firstly, many thanks for this great wrapper library!

There's a long-standing bug in FFmpeg that seems to break RTMPS streaming (https://trac.ffmpeg.org/ticket/6471) depending on the configuration of the remote server. In the case of Facebook Live, and using h264_videotoolbox, the TLS connection hangs during handshake, and FFmpeg/ffmpeg-kit doesn't send over any content. The patches/changes mentioned in the RTMP lib and/or SSL libs in the comments above seem to resolve this issue with my testing.

Strangely, the issue didn't seem to appear when using libx264 as the video encoder, but if you want to make use of hardware video encoding/decoding and avoid GPL / licensing problems with using that library in a commercial product, you have to make that patch change above manually.

My local ffmpeg installation is compiled with the librtmp lib (--enable-librtmp), which doesn't seem to have this TLS issue, but FFmpegKit uses the in-built RTMP lib. I didn't investigate trying to get FFmpegKit to work with librtmp, but that might be another alternative to add to your script arguments.

feature: add rubberband support to change audio tempo/pitch

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Platform
Is this a general feature for all platforms or a platform specific feature?
Android/iOS

Additional context
Add any other context or screenshots about the feature request here.

Android archives do not include external library licenses

External libraries enabled in ffmpeg require to include their licenses and notices in the binary distributions. As of v4.4 and v4.4.LTS they are included in Apple platform distributions but Android archives do not contain them.

Allow GetMediaInformation Function to fail with response

Is your feature request related to a problem? Please describe.
When using FFprobeKit.getMediaInformation(url) it seems to only work if the url is valid. Which prevents subsequent code from being executed, by getting stuck.

Describe the solution you'd like
It would be useful if it provided a ReturnCode as the FFmpegKit provides. This way you know if the media information request failed and if so why. Or at a minimum, it could return nil if it fails.

Describe alternatives you've considered
I have added my own check before I execute GetMediaInformation. I check to see if I can hit the URL and get a response before trying the GetMediaInformation.

Platform
I'm currently experiencing the issue in Swift on tvOS but I would guess it would be a cross-platform issue.

Additional context

libavcodec is always compiled with support for all codecs

Description
the size of libavcodec is very large because it compiles support for all codecs, even those not supported by the current build

Expected behavior
if i build for a single codec it should be very small since it should support only that one

To Reproduce
./android.sh --lts --enable-opus
.....
check libavcodec

Expected behavior
the build of ffmpeg should be configured with --disable-everything and then later do --enable-encoder of only what is needed

Environment

  • Platform: Android
  • Architecture: *
  • Source branch: main
  • Android NDK version: r22.b-1

Support for Swift Packages Manager

Are there any plans to make the library available through the Swift Packages Manager?
CocoaPods are great but not perfect for everyone :)

Not able to trim video in android

Hi
I posted my code below, which I used to trim the video but every time it goes to the else block.
Please help me out

val cmd = arrayOf("-i", trimmerData.srcPath, "-ss", startTime, "-t", endTime,
"-s", "320x240", "-r", "25", "-vcodec", "mpeg4", "-b:v", "2097152", "-b:a", "48000", "-ac", "2", "-ar", "22050",
"-c", "copy", trimmerData.dstPath)

val session = FFmpegKit.execute(cmd)
if (ReturnCode.isSuccess(session.returnCode)) {
Log.i("ffmpeg","Success")
scanTrimFile(trimmerData)
// SUCCESS
} else if (ReturnCode.isCancel(session.returnCode)) {
Log.i("ffmpeg","Cancel")
// CANCEL
} else {
showTrimmingError()
// FAILURE
Log.d("ffmpeg", String.format("Command failed with state %s and rc %s.%s", session.state, session.returnCode, session.failStackTrace))
}

private fun scanTrimFile(trimmerData: TrimmerData) {
mediaScannerConnection = MediaScannerConnection(this,
object : MediaScannerConnection.MediaScannerConnectionClient {
override fun onMediaScannerConnected() {
mediaScannerConnection.scanFile(trimmerData.dstPath, "video/*")
}

                override fun onScanCompleted(path: String?, uri: Uri?) {
                    mediaScannerConnection.disconnect()
                    dismissWaitingDialog()
                    getResult(Uri.parse(trimmerData.dstPath))
                }

            })
    mediaScannerConnection.connect()
}

Error:
2021-04-20 09:39:09.448 20346-20706/org.xyz.ts W/ffmpeg-kit: Multiple -c, -codec, -acodec, -vcodec, -scodec or -dcodec options specified for stream 0, only the last option '-c copy' will be used.
2021-04-20 09:39:09.449 20346-20706/org.xyz.ts E/ffmpeg-kit: [mp4 @ 0xe6b84800] Could not find tag for codec amr_nb in stream #1, codec not currently supported in container
2021-04-20 09:39:09.449 20346-20706/org.xyz.ts E/ffmpeg-kit: Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
2021-04-20 09:39:09.451 20346-20706/org.xyz.ts E/ffmpeg-kit: Error initializing output stream 0:1 --
2021-04-20 09:39:09.451 20346-20706/org.xyz.ts I/ffmpeg-kit: Stream mapping:
2021-04-20 09:39:09.451 20346-20706/org.xyz.ts I/ffmpeg-kit: Stream #0:0 -> #0:0
2021-04-20 09:39:09.451 20346-20706/org.xyz.ts I/ffmpeg-kit: (copy)
2021-04-20 09:39:09.451 20346-20706/org.xyz.ts I/ffmpeg-kit: Stream #0:1 -> #0:1
2021-04-20 09:39:09.451 20346-20706/org.xyz.ts I/ffmpeg-kit: (copy)
2021-04-20 09:39:09.541 20346-20346/org.xyz.ts D/ffmpeg: Command failed with state COMPLETED and rc 1.null

Encoding from network takes ages compared with FFmpeg-mobile library

I'm using this command to encode a video from web:

-y -reconnect 1 -i https://snapcellvideos.s3.amazonaws.com/manual/24/manualupload_16098586962947166522.mp4 -filter_complex "[0:v] pad=iw:'if(gt(iw, ih), iw, ih)':(ow-iw)/2:(oh-ih)/2, crop=iw:iw, scale=-1:480, setsar=1 [clip0]; [0:a] anull [audio0]; [clip0][audio0] concat=n=1:v=1:a=1 [v][a]" -map '[v]' -map '[a]' -c:a aac -c:v h264 -crf 18 -r 30 -preset veryfast /output_path/output_file.mp4

With FFmpeg-mobile library it takes around 100 seconds to encode it but with FFmpeg-kit it takes 639 seconds

I've check with local videos and it takes the same aprox, so the problem is related to videos from web

Version: com.arthenica:ffmpeg-kit-full-gpl:4.4.LTS

Android mediacodec encoder

Is your feature request related to a problem? Please describe.

libx264 encoder is slow and it is gpl compliant

Describe the solution you'd like

https://github.com/iocaster/FFmpegMC264Kit

this seems an alternative to libx264 that uses the MediaCodec api, so i think it might be tested inside ffmpeg-kit

Platform
Android

How to configure libfdk-aac enabled?

Is your feature request related to a problem? Please describe.
Not a bug

Describe the solution you'd like
A feature to support libfdk-aac or some options is needed

Describe alternatives you've considered
A sample way for me to enable it .

Platform
iOS

Additional context
I think the fdk-aac is required for most of codec situations

Failing to compile dav1d under Github CI and WSL Ubuntu 20.04

Description
I've been trying to self compile the project with the --speed flag since I need a performance critical version of FFMPEG for my use case.

While compiling, dav1d fails, which both logs I'll provide prove

Expected behavior
A successful compile with no errors, but we don't live in a perfect world I suppose.

Current behavior
Fails to sanity check an exe under Linux?

To Reproduce
Compiling using this command:

./android.sh --speed --full --enable-gpl --enable-x264 --enable-x265 --disable-arm-v7a --disable-arm-v7a-neon --disable-x86 --disable-x86-64

Logs
meson-log.txt

Environment

  • Platform: Android
  • Architecture: arm64-v8a
  • Version: Commit: 46afc3f
  • Source branch (if applicable): main
  • Android Studio version: Not sure what to say here really, it's just Android SDK tools?
  • Android NDK version: attempted both 21.3.6528147 and 22.1.7171670

Github CI result:
https://github.com/Fernthedev/ffmpeg-kit-speed/runs/2610500387?check_suite_focus=true

how to enable libpostproc?

File ffmpeg-kit/scripts/android/ffmpeg.sh has line

 --disable-postproc \

If I don't delete it, ffmpeg-kit/prebuilt/android-arm64/ffmpeg/lib/libpostproc.so will not be build.

What is the proper way to enable building of libpostproc.so? I have tried adding --enable-postproc or --enable-libpostproc argument to android.sh, but I get error message about unknown library.

WIth mobile-ffmpeg the lib got build by default.

Execution Failed With "Null" Error

Description
I'm using your old repo from more than one and a half year and i just moved on to this new repo and i found that some tasks are failing like video mirror, motion change and resize which are working fine in old repo. I have't tested all the task in this new repo but some are working fine like - audio trim, merge, video to mp3, video trimand some more.

Expected behavior
I think it should work fine same as old version

Current behavior
Some Command Failure

Logs
This is my current command for Video Motion Change

[-ss, 00:02, -t, 00:21, 
-y, -i, /storage/emulated/0/save_1597392480187.mp4, 
-filter_complex, [0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a], 
-map, [v], -map, [a], -b:v, 2097k, 
-vcodec, libx264, -preset, ultrafast, 
/storage/emulated/0/Movies/Video to mp3 Converter/Video Motion/.pending-1620201845-test 1.mp4]

and it just failed, i tried to print session.getFailStackTrace() and it prints null,
Command failed with state COMPLETED and rc 1.null (as log was added in README file)
is there any other variable to check error logs?

Environment

  • Platform: Android
  • Architecture: arm64-v8a

Android builds fail to compile saf_wrapper on Android NDK r22

Compilation of saf_wrapper.c fails for arm64-v8a architecture on macOS Android NDK r22.

jni/../app/src/main/cpp/saf_wrapper.c:41:14: error: cast to smaller integer type 'int' from 'void *' [-Werror,-Wvoid-pointer-to-int-cast]
    int fd = (int)opaque;
             ^~~~~~~~~~~
jni/../app/src/main/cpp/saf_wrapper.c:46:14: error: cast to smaller integer type 'int' from 'void *' [-Werror,-Wvoid-pointer-to-int-cast]
    int fd = (int)opaque;
             ^~~~~~~~~~~
jni/../app/src/main/cpp/saf_wrapper.c:51:14: error: cast to smaller integer type 'int' from 'void *' [-Werror,-Wvoid-pointer-to-int-cast]
    int fd = (int)opaque;
             ^~~~~~~~~~~
jni/../app/src/main/cpp/saf_wrapper.c:93:18: error: cast to smaller integer type 'int' from 'void *' [-Werror,-Wvoid-pointer-to-int-cast]
        int fd = (int)ctx->opaque;
                 ^~~~~~~~~~~~~~~~
4 errors generated.

getPackageName not accessible on Android API

Getting the name of the ffmpeg-kit package loaded is not possible using the current API.

Packages class has a getPackageName method. And, Android API uses it internally. However that class and method is not accessible from another package. Access modifier of Packages class must be updated. By applying this change other Packages methods like getExternalLibraries will also become accessible.

file descriptor leak

Expected behavior
file should be closed

Current behavior
dont close files after command execution

To Reproduce
compile and install a debuggable application that use ffmpegkit

ex:
FFmpegKit.executeAsync("-hide_banner -y -f s16le -ar 16000 -i $pcmPath -ac 1 -c:a libvorbis -f ogg $oggPath")

now:
adb shell
run-as [package name]
lsof | grep [package name]

you will see that the input and output files remain open after command execution

Screenshots
Screenshot from 2021-04-27 15-05-29

^^leaked file descriptor

Environment

  • Platform: Android
  • Architecture: all
  • Version: 4.4 lts
  • Source branch: last commit (tanersener@46afc3f)
  • Android Studio version: 4.1.3
  • Android NDK version: 21.4.7075529

Scoped Storage - Could not open file

Description
I'm trying to write a ffmpeg generated output image to the MediaStore and not to an app-specific-directory on Android 10 using the code below. In this case I'm always getting an error Could not open file : saf:173/image.jpg av_interleaved_write_frame(): I/O error
Using an app-specific-directory and not the MediaStore as output works just fine.

Expected behavior
Writing the image to MediaStore successfully.

Current behavior
An empty file image file gets generated in the MediaStore. Ffmpeg-kit error is:
Could not open file : saf:173/image.jpg av_interleaved_write_frame(): I/O error

To Reproduce
The following Kotlin code is used to generate the output safUri used for the ffmpeg command.

        val filePrefix = "image"
        val fileExtn = ".jpg"
        val contentValues = ContentValues()
        contentValues.put(MediaStore.Images.Media.RELATIVE_PATH, "Pictures/Test")
        contentValues.put(MediaStore.Images.Media.DISPLAY_NAME, filePrefix + fileExtn)
        contentValues.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg")
        val uri = context.contentResolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, contentValues)

        val safUri = getSafParameterForWrite(context, uri)

Logs
2021-05-03 22:22:24.125 27125-28059/com.app.name I/ffmpeg-kit: ffmpeg version v4.4-dev-3015-gc0d0b1c4f6
2021-05-03 22:22:24.125 27125-28059/com.app.name I/ffmpeg-kit: Copyright (c) 2000-2021 the FFmpeg developers
2021-05-03 22:22:24.126 27125-28059/com.app.name I/ffmpeg-kit: built with Android (6875598, based on r399163b) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d)
2021-05-03 22:22:24.126 27125-28059/com.app.name I/ffmpeg-kit: configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/storage/dark/projects/ffmpeg-kit/prebuilt/android-arm64-lts/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --cc=aarch64-linux-android21-clang --cxx=aarch64-linux-android21-clang++ --ranlib=aarch64-linux-android-ranlib --strip=aarch64-linux-android-strip --nm=aarch64-linux-android-nm --extra-libs='-L/storage/dark/projects/ffmpeg-kit/prebuilt/android-arm64-lts/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 --disable-static --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-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-libdav1d --enable-libkvazaar --enable-libilbc --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libtwolame --enable-libvo-amrwbenc --enable-zlib --enable-mediacodec
2021-05-03 22:22:24.126 27125-28059/com.app.name I/ffmpeg-kit: libavutil 56. 65.100 / 56. 65.100
2021-05-03 22:22:24.126 27125-28059/com.app.name I/ffmpeg-kit: libavcodec 58.123.100 / 58.123.100
2021-05-03 22:22:24.126 27125-28059/com.app.name I/ffmpeg-kit: libavformat 58. 67.100 / 58. 67.100
2021-05-03 22:22:24.126 27125-28059/com.app.name I/ffmpeg-kit: libavdevice 58. 12.100 / 58. 12.100
2021-05-03 22:22:24.126 27125-28059/com.app.name I/ffmpeg-kit: libavfilter 7.106.100 / 7.106.100
2021-05-03 22:22:24.126 27125-28059/com.app.name I/ffmpeg-kit: libswscale 5. 8.100 / 5. 8.100
2021-05-03 22:22:24.126 27125-28059/com.app.name I/ffmpeg-kit: libswresample 3. 8.100 / 3. 8.100
2021-05-03 22:22:24.152 27125-28059/com.app.name I/ffmpeg-kit: Input #0, image2, from 'file:///storage/emulated/0/Android/data/com.app.name/files/Pictures/03-05-2021-22-22-22.tmp.jpg':
2021-05-03 22:22:24.152 27125-28059/com.app.name I/ffmpeg-kit: Duration:
2021-05-03 22:22:24.153 27125-28059/com.app.name I/ffmpeg-kit: 00:00:00.04
2021-05-03 22:22:24.153 27125-28059/com.app.name I/ffmpeg-kit: , start:
2021-05-03 22:22:24.153 27125-28059/com.app.name I/ffmpeg-kit: 0.000000
2021-05-03 22:22:24.154 27125-28059/com.app.name I/ffmpeg-kit: , bitrate:
2021-05-03 22:22:24.154 27125-28059/com.app.name I/ffmpeg-kit: 1123439 kb/s
2021-05-03 22:22:24.155 27125-28059/com.app.name I/ffmpeg-kit: Stream #0:0
2021-05-03 22:22:24.155 27125-28059/com.app.name I/ffmpeg-kit: : Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 4000x2250
2021-05-03 22:22:24.156 27125-28059/com.app.name I/ffmpeg-kit: ,
2021-05-03 22:22:24.156 27125-28059/com.app.name I/ffmpeg-kit: 25 fps,
2021-05-03 22:22:24.156 27125-28059/com.app.name I/ffmpeg-kit: 25 tbr,
2021-05-03 22:22:24.156 27125-28059/com.app.name I/ffmpeg-kit: 25 tbn,
2021-05-03 22:22:24.156 27125-28059/com.app.name I/ffmpeg-kit: 25 tbc
2021-05-03 22:22:24.195 27125-28059/com.app.name I/ffmpeg-kit: Input #1, png_pipe, from '/data/user/0/com.app.name/files/OverlayImg.png':
2021-05-03 22:22:24.195 27125-28059/com.app.name I/ffmpeg-kit: Duration:
2021-05-03 22:22:24.195 27125-28059/com.app.name I/ffmpeg-kit: N/A
2021-05-03 22:22:24.195 27125-28059/com.app.name I/ffmpeg-kit: , bitrate:
2021-05-03 22:22:24.195 27125-28059/com.app.name I/ffmpeg-kit: N/A
2021-05-03 22:22:24.195 27125-28059/com.app.name I/ffmpeg-kit: Stream #1:0
2021-05-03 22:22:24.195 27125-28059/com.app.name I/ffmpeg-kit: : Video: png, rgba(pc), 1080x2021
2021-05-03 22:22:24.195 27125-28059/com.app.name I/ffmpeg-kit: ,
2021-05-03 22:22:24.195 27125-28059/com.app.name I/ffmpeg-kit: 25 fps,
2021-05-03 22:22:24.195 27125-28059/com.app.name I/ffmpeg-kit: 25 tbr,
2021-05-03 22:22:24.195 27125-28059/com.app.name I/ffmpeg-kit: 25 tbn,
2021-05-03 22:22:24.195 27125-28059/com.app.name I/ffmpeg-kit: 25 tbc
2021-05-03 22:22:24.212 27125-28059/com.app.name I/ffmpeg-kit: Stream mapping:
2021-05-03 22:22:24.212 27125-28059/com.app.name I/ffmpeg-kit: Stream #0:0 (mjpeg) -> transpose
2021-05-03 22:22:24.213 27125-28059/com.app.name I/ffmpeg-kit: Stream #1:0 (png) -> scale
2021-05-03 22:22:24.213 27125-28059/com.app.name I/ffmpeg-kit: drawtext
2021-05-03 22:22:24.214 27125-28059/com.app.name I/ffmpeg-kit: -> Stream #0:0 (mjpeg)
2021-05-03 22:22:24.214 27125-28059/com.app.name I/ffmpeg-kit: Press [q] to stop, [?] for help
2021-05-03 22:22:24.592 27125-28059/com.app.name I/ffmpeg-kit: Output #0, image2, to 'saf:163/image.jpg':
2021-05-03 22:22:24.592 27125-28059/com.app.name I/ffmpeg-kit: Metadata:
2021-05-03 22:22:24.592 27125-28059/com.app.name I/ffmpeg-kit: encoder :
2021-05-03 22:22:24.593 27125-28059/com.app.name I/ffmpeg-kit: Lavf58.67.100
2021-05-03 22:22:24.593 27125-28059/com.app.name I/ffmpeg-kit: Stream #0:0
2021-05-03 22:22:24.593 27125-28059/com.app.name I/ffmpeg-kit: : Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown, progressive), 2250x4000, q=2-31, 200 kb/s
2021-05-03 22:22:24.594 27125-28059/com.app.name I/ffmpeg-kit: ,
2021-05-03 22:22:24.594 27125-28059/com.app.name I/ffmpeg-kit: 25 fps,
2021-05-03 22:22:24.594 27125-28059/com.app.name I/ffmpeg-kit: 25 tbn
2021-05-03 22:22:24.595 27125-28059/com.app.name I/ffmpeg-kit: (default)
2021-05-03 22:22:24.595 27125-28059/com.app.name I/ffmpeg-kit: Metadata:
2021-05-03 22:22:24.596 27125-28059/com.app.name I/ffmpeg-kit: encoder :
2021-05-03 22:22:24.596 27125-28059/com.app.name I/ffmpeg-kit: Lavc58.123.100 mjpeg
2021-05-03 22:22:24.596 27125-28059/com.app.name I/ffmpeg-kit: Side data:
2021-05-03 22:22:24.596 27125-28059/com.app.name I/ffmpeg-kit:
2021-05-03 22:22:24.604 27125-28059/com.app.name I/ffmpeg-kit: cpb:
2021-05-03 22:22:24.604 27125-28059/com.app.name I/ffmpeg-kit: bitrate max/min/avg: 0/0/200000 buffer size: 0
2021-05-03 22:22:24.604 27125-28059/com.app.name I/ffmpeg-kit: vbv_delay: N/A
2021-05-03 22:22:24.605 27125-28059/com.app.name I/ffmpeg-kit: frame= 1 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x
2021-05-03 22:22:24.929 27125-28059/com.app.name E/ffmpeg-kit: [image2 @ 0x7e88243000] Could not open file : saf:163/image.jpg
2021-05-03 22:22:24.930 27125-28059/com.app.name E/ffmpeg-kit: av_interleaved_write_frame(): I/O error
2021-05-03 22:22:24.932 27125-28059/com.app.name I/ffmpeg-kit: frame= 1 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A speed=0.0557x
2021-05-03 22:22:24.934 27125-28059/com.app.name I/ffmpeg-kit: video:1144kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead:
2021-05-03 22:22:24.934 27125-28059/com.app.name I/ffmpeg-kit: unknown
2021-05-03 22:22:24.940 27125-28056/com.app.name D/MyFfmpegHelper: Command failed with state COMPLETED and rc 1.null
2021-05-03 22:22:24.944 27125-28059/com.app.name I/ffmpeg-kit: Conversion failed!

Environment

  • Android10
  • ffmpeg-kit: 4.4.LTS
  • Android Studio: 4.1.2

Log callbacks for FFprobe includes the executionId of a previous async FFmpeg execution

Current Behaviour
When the same thread calls Config.ffmpegExecute() first and FFprobe.execute() later, log callbacks received for FFprobe includes the executionId of the ffmpeg execution.

Expected Behaviour
FFprobe does not support async operations. So, log callbacks for FFprobe should always have executionId = 0.

Environment
This issue originates from MobileFFmpeg v4.4 and v4.4.LTS, affects all platforms including react-native and flutter plugins based on MobileFFmpeg.

Burning subtitles hangs on Android

When the following command is used to burn subtitles on Android, the execution does not return and hangs forever.

-y -i .../video.mp4 -vf subtitles=.../subtitle.srt:force_style='FontName=MyFontName' -c:v mpeg4 .../video-with-subtitles.mp4

This behaviour can be seen on the test application as well. Sometimes, after the test-application is upgraded on a device this issue happens. Restarting the app doesn't fix the issue. The only way to fix this is to uninstall the test app and install it again.

Both LTS and Main releases are affected from this. mobile-ffmpeg also has the same issue. It was seen on most mobile-ffmpeg releases since v3.1.

Test application use setFontDirectory method before burning subtitles. It can be related to the issue.

These are the latest log lines printed.

D/ffmpeg-kit-test: [Parsed_subtitles_0 @ 0xb908d380] Setting 'filename' to value '/data/data/com.arthenica.ffmpegkit.test/cache/subtitle.srt'
D/ffmpeg-kit-test: [Parsed_subtitles_0 @ 0xb908d380] Setting 'force_style' to value 'FontName=MyFontName'
D/ffmpeg-kit-test: [Parsed_subtitles_0 @ 0xb908d380] Raster: FreeType 2.10.2
D/ffmpeg-kit-test: [Parsed_subtitles_0 @ 0xb908d380] 
D/ffmpeg-kit-test: [Parsed_subtitles_0 @ 0xb908d380] Shaper: FriBidi 1.0.10 (SIMPLE) HarfBuzz-ng 2.7.4 (COMPLEX)
D/ffmpeg-kit-test: [Parsed_subtitles_0 @ 0xb908d380] 
D/ffmpeg-kit-test: [Parsed_subtitles_0 @ 0xb908d380] Initialized
D/ffmpeg-kit-test: [Parsed_subtitles_0 @ 0xb908d380] 
D/ffmpeg-kit-test: [NULL @ 0xb928a380] Opening '/data/data/com.arthenica.ffmpegkit.test/cache/subtitle.srt' for reading
D/ffmpeg-kit-test: [file @ 0xb91f8a70] Setting default whitelist 'file,crypto,data'
D/ffmpeg-kit-test: [srt @ 0xb928a380] Format srt probed with size=2048 and score=100
D/ffmpeg-kit-test: [srt @ 0xb928a380] Before avformat_find_stream_info() pos: 441 bytes read:441 seeks:0 nb_streams:1
D/ffmpeg-kit-test: [srt @ 0xb928a380] All info found
D/ffmpeg-kit-test: [srt @ 0xb928a380] After avformat_find_stream_info() pos: 441 bytes read:441 seeks:0 frames:0

The following logs belong to a similar run where burning does not fail.

D/ffmpeg-kit-test: [Parsed_subtitles_0 @ 0xb9097b30] Shaper: FriBidi 1.0.10 (SIMPLE) HarfBuzz-ng 2.7.4 (COMPLEX)
D/ffmpeg-kit-test: [Parsed_subtitles_0 @ 0xb9097b30] 
D/ffmpeg-kit-test: [Parsed_subtitles_0 @ 0xb9097b30] Initialized
D/ffmpeg-kit-test: [Parsed_subtitles_0 @ 0xb9097b30] 
D/ffmpeg-kit-test: [NULL @ 0xb92802a0] Opening '/data/data/com.arthenica.ffmpegkit.test/cache/subtitle.srt' for reading
D/ffmpeg-kit-test: [file @ 0xb8f7f5d0] Setting default whitelist 'file,crypto,data'
D/ffmpeg-kit-test: [srt @ 0xb92802a0] Format srt probed with size=2048 and score=100
D/ffmpeg-kit-test: [srt @ 0xb92802a0] Before avformat_find_stream_info() pos: 441 bytes read:441 seeks:0 nb_streams:1
D/ffmpeg-kit-test: [srt @ 0xb92802a0] All info found
D/ffmpeg-kit-test: [srt @ 0xb92802a0] After avformat_find_stream_info() pos: 441 bytes read:441 seeks:0 frames:0
D/ffmpeg-kit-test: [Parsed_subtitles_0 @ 0xb9021f80] Using font provider fontconfig
D/ffmpeg-kit-test: [Parsed_subtitles_0 @ 0xb9021f80] 
D/ffmpeg-kit-test: [Parsed_subtitles_0 @ 0xb9021f80] Event: [Script Info]

Further tests show that <application-home>/cache/.ffmpeg-kit folder which is registered as font directory using the setFontDirectory method have a fonts.conf file inside as it should be when this issue occurs in the test application.

And these are the logs printed on application start-up. Nothing is wrong here as well.

I/ffmpeg-kit: Loaded ffmpeg-kit-full-gpl-x86-4.4-lts-20210123.
D/ffmpeg-kit: Deleted old temporary font configuration: true.
D/ffmpeg-kit: Saved new temporary font configuration with 1 font name mappings.
D/ffmpeg-kit: Font directory /data/data/com.arthenica.ffmpegkit.test/cache registered successfully.
D/ffmpeg-kit-test: Application fonts registered.

Question: is it possible to add custom libraries not included in the build script

Is your feature request related to a problem? Please describe.
We want to use ffmpeg library for SRT streaming

Describe the solution you'd like
When compiling library for android we can specify --enable-srt to add SRT module (https://github.com/Haivision/srt.git)

Platform
Would be great to have on all platforms

Additional context
Here is how it's enabled when compiling ffmpeg https://medium.com/@eyevinntechnology/using-ffmpeg-and-srt-to-transport-video-signal-to-the-cloud-7160960f846a

Android media codec

Description
A clear and concise description of what the bug is.
Android media codec can not work normaly ,command line is ffmpeg -vcodec h264_mediacodec -i /sdcard/4k.mp4 /sdcard/4k.yuv
Expected behavior
What you expected to happen.
4k yuv file play by some software such as vooya
Current behavior
What happened.
4k yuv file only has first frame
To Reproduce
Steps to reproduce the behaviour.
Just use commond line ffmpeg -vcodec h264_mediacodec -i /sdcard/4k.mp4 /sdcard/4k.yuv
Expected behavior
A clear and concise description of what you expected to happen.
android media codec can work normaly
Screenshots
If applicable, add screenshots to help explain your problem.

Logs
Post logs here or paste them to Ghostbin and insert the link here.

Environment
Android armv8-a,version is 4.4,development,android studio version 4.2,NDK is 21b

  • Platform: [e.g. Android/iOS/macOS/tvOS]
  • Architecture: [arm-v7a, arm-v7a-neon, arm64-v8a, x86, x86_64, armv7, armv7s, arm64, arm64-mac-catalyst, arm64-simulator, arm64e, i386, x86-64, x86-64-mac-catalyst ]
  • Version (if applicable) [e.g. v4.4]
  • Source branch (if applicable) [e.g. master, development, v4.4]
  • Xcode version (if applicable) [e.g. 7.3.1, 9.0.1, 12.0]
  • Cocoapods version (if applicable) [e.g. 1.9.1]
  • Android Studio version (if applicable) [e.g. 4.0]
  • Android NDK version (if applicable) [e.g. 16b, r17c, r21d]

Other
Add any other context about the problem here.

Getting build error

> $ ./android.sh --disable-arm-v7a-neon --disable-arm64-v8a --disable-x86 --disable-x86-64


Building ffmpeg-kit library for Android

Architectures: arm-v7a
Libraries: none

Downloading sources: ok

Building arm-v7a platform on API level 24

cpu-features: ok

ffmpeg: ok

ffmpeg-kit: failed


> $ tail build.log 
[armeabi-v7a] Compile arm    : ffmpegkit <= ffprobekit.c
[armeabi-v7a] Compile arm    : ffmpegkit <= ffmpegkit_exception.c
[armeabi-v7a] Compile arm    : ffmpegkit <= fftools_cmdutils.c
[armeabi-v7a] Compile arm    : ffmpegkit <= fftools_ffmpeg.c
jni/../ffmpeg-kit-android-lib/src/main/cpp/fftools_ffmpeg.c:507:32: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
    struct sigaction action = {0};
                               ^
                               {}
1 error generated.
make: *** [/home/vishal/Android/Sdk/ndk/21.3.6528147/build/core/build-binary.mk:476: obj/local/armeabi-v7a/objs/ffmpegkit/fftools_ffmpeg.o] Error 1

@tanersener while compiling your library I'm getting above error. How to solve this issue?

OS - linux
ndk version - 21.3.6528147

About Using ffmpegkit and MobileVLCKit at the same iOS Application

I did a test:

  1. Create a new app project in Xcode(Version 12.4 (12D4e))
  2. Edit podfile:pod 'ffmpeg-kit-ios-full', '~> 4.4.LTS' pod 'MobileVLCKit', '~>3.3.0'
  3. Run pod install.
  4. Build app success
  5. Run app on simulator

I get some errors:

`Found bundle at /Users/appworks/Library/Developer/CoreSimulator/Devices/616EA04F-F09A-48AE-8B86-DF04043B0A5A/data/Library/Caches/com.apple.mobile.installd.staging/temp.vjV39u/extracted/Payload/ffmpegTest.app/Frameworks/libtheora.framework with the same identifier (com.arthenica.ffmpegkit.Libtheora) as bundle at /Users/appworks/Library/Developer/CoreSimulator/Devices/616EA04F-F09A-48AE-8B86-DF04043B0A5A/data/Library/Caches/com.apple.mobile.installd.staging/temp.vjV39u/extracted/Payload/ffmpegTest.app/Frameworks/libtheoradec.framework
Domain: MIInstallerErrorDomain
Code: 57
User Info: {
FunctionName = "-[MIInstallableBundle performPreflightWithError:]";
LegacyErrorString = DuplicateIdentifier;
SourceFileLine = 417;
}

System Information

macOS Version 11.2.3 (Build 20D91)
Xcode 12.4 (17801) (Build 12D4e)
`
I have read this article:https://github.com/tanersener/mobile-ffmpeg/wiki/Using-Multiple-FFmpeg-Implementations-In-The-Same-iOS-Application and make some changes ,but does't work for me,How can i fix this issue?

Overlay enable not working in ios FFmpegKit 4.4 (tried all versions)

I tried so many times . Android run same code is working fine but in ios that is not working perfectly..

Here is some code that i want to make the video

"-i (img0) -i (img1) -i (img2) -i (img3) -i (bgPath) -i (firstimg) -filter_complex "[4]split=2[color][alpha];[color]crop=iw/2:ih:0:0[color]; [alpha]crop=iw/2:ih:iw/2:0[alpha]; [color][alpha]alphamerge[ovrly]; [0]scale=540:960[0_scalled]; [1]scale=540:960[1_scalled]; [2]scale=540:960[2_scalled]; [3]scale=540:960[3_scalled]; [5][0_scalled]overlay=enable='between=(t,0,3.4)'[v1]; [v1][1_scalled]overlay=enable='between=(t,3.4,6.8)'[v2]; [v2][2_scalled]overlay=enable='between=(t,6.8,10.7)'[v3]; [v3][3_scalled]overlay=enable='between=(t,10.7,15)'[v4]; [v4][ovrly]overlay=0:0[final_video]" -map [final_video] -map 4:a -t 15 (outputPath)"

I tried this code , it gives only first image output in video .

Second , third & fourth image not showing in the video , even i add time on overlay function . please help me

Thanks

iOS pod 'ffmpeg-kit-ios-full', '~> 4.4.LTS' not working

Trying to integrate FFMPeg using cocoapods in iOS Swift project, but getting following error:
Analyzing dependencies
/usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-core-1.9.3/lib/cocoapods-core/cdn_source.rb:342: warning: URI.escape is obsolete
[!] Unable to find a specification for ffmpeg-kit-ios-full

You have either:

  • out-of-date source repos which you can update with pod repo update or with pod install --repo-update.
  • mistyped the name or version.
  • not added the source repo that hosts the Podspec to your Podfile.

Attached screenshot for your reference see below.

Note: Using Xcode12.

Error

Support Web Platform

Provide scripts for a WASM based implementation.
Do no publish binaries if it is not possible to prevent end-users using them on their devices directly. That can create legal problems for us (maintainers).

Add support to untrunc

I'd like to be able to use untrunc on Android and iOS.

This is a very useful tool to fix corrupted mp4 videos and depends on libav to work properly.

Solution
It'd be good to be able to generated a pre-built binary of this tool along with ffmpeg.

I tried to do it myself, but I failed trying to build to Android architectures.

I don't think it's so hard to be done, but I didn't find the right way to do so.

I can help to create this feature, if I get any help on how to add this.

Platform
Android and iOS

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.