madhavanmalolan / ffmpegandroidlibrary

One line integration for FFMPEG Library in Android
MIT License
90 stars 15 forks source link

Application terminated #9

Closed dimcey closed 6 years ago

dimcey commented 6 years ago

Hey! I have added " compile 'com.madhavanmalolan.android:ffmpegandroidlibrary:0.0.4' " in my build.gradle, and testing the run function with your code: String filesDir = "/storage/sdcard0/"; Controller.getInstance().run(new String[] { "-y", "-i", filesDir + "in.mp4", "-vcodec", "copy", "-an", filesDir + "out.mp4" });

But my application gets terminated for some reason and this is the log that I see: I/InjectionManager: featureStore :{} D/SecWifiDisplayUtil: Metadata value : SecSettings2 W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable D/PhoneWindow: FMB installDecor mIsFloating : false D/PhoneWindow: FMB installDecor flags : -2139029248 W/linker: libffmpeg.so: unused DT entry: type 0x6ffffffe arg 0x4d0c W/linker: libffmpeg.so: unused DT entry: type 0x6fffffff arg 0x9 W/linker: libavformat-56.so: unused DT entry: type 0x6ffffffe arg 0x5fa0 W/linker: libavformat-56.so: unused DT entry: type 0x6fffffff arg 0x4 W/linker: libavcodec-56.so: unused DT entry: type 0x6ffffffe arg 0x56d4 W/linker: libavcodec-56.so: unused DT entry: type 0x6fffffff arg 0x4 W/linker: libswscale-3.so: unused DT entry: type 0x6ffffffe arg 0xda8 W/linker: libswscale-3.so: unused DT entry: type 0x6fffffff arg 0x3 W/linker: libavutil-54.so: unused DT entry: type 0x6ffffffe arg 0x5d78 W/linker: libavutil-54.so: unused DT entry: type 0x6fffffff arg 0x2 W/linker: libswresample-1.so: unused DT entry: type 0x6ffffffe arg 0xc78 W/linker: libswresample-1.so: unused DT entry: type 0x6fffffff arg 0x3 W/linker: libavfilter-5.so: unused DT entry: type 0x6ffffffe arg 0x40f4 W/linker: libavfilter-5.so: unused DT entry: type 0x6fffffff arg 0x7 W/linker: libavdevice-56.so: unused DT entry: type 0x6ffffffe arg 0x19fc W/linker: libavdevice-56.so: unused DT entry: type 0x6fffffff arg 0x5 I/Videokit: start run in main. I/Videokit: register_exit I/Videokit: term_init & parse options. I/TMSDISP: AcsAndroidVirtualDisplayIntfImpl::~AcsAndroidVirtualDisplayIntfImpl - Enter AcsAndroidVirtualDisplayIntfImpl::~AcsAndroidVirtualDisplayIntfImpl - Enter2 AcsAndroidVirtualDisplayIntfImpl::~AcsAndroidVirtualDisplayIntfImpl - mSource2 AcsAndroidVirtualDisplayIntfImpl::~AcsAndroidVirtualDisplayIntfImpl - Exit Application terminated.

Any ideas?

madhavanmalolan commented 6 years ago

Do you have external storage permissions in android manifest?

On 22-Feb-2018 3:28 PM, "dimcey" notifications@github.com wrote:

Hey! I have added " compile 'com.madhavanmalolan.android:ffmpegandroidlibrary:0.0.4' " in my build.gradle, and testing the run function with your code: String filesDir = "/storage/sdcard0/"; Controller.getInstance().run(new String[] { "-y", "-i", filesDir + "in.mp4", "-vcodec", "copy", "-an", filesDir + "out.mp4" });

But my application gets terminated for some reason and this is the log that I see: I/InjectionManager: featureStore :{} D/SecWifiDisplayUtil: Metadata value : SecSettings2 W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat. updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable D/PhoneWindow: FMB installDecor mIsFloating : false D/PhoneWindow: FMB installDecor flags : -2139029248 W/linker: libffmpeg.so: unused DT entry: type 0x6ffffffe arg 0x4d0c W/linker: libffmpeg.so: unused DT entry: type 0x6fffffff arg 0x9 W/linker: libavformat-56.so: unused DT entry: type 0x6ffffffe arg 0x5fa0 W/linker: libavformat-56.so: unused DT entry: type 0x6fffffff arg 0x4 W/linker: libavcodec-56.so: unused DT entry: type 0x6ffffffe arg 0x56d4 W/linker: libavcodec-56.so: unused DT entry: type 0x6fffffff arg 0x4 W/linker: libswscale-3.so: unused DT entry: type 0x6ffffffe arg 0xda8 W/linker: libswscale-3.so: unused DT entry: type 0x6fffffff arg 0x3 W/linker: libavutil-54.so: unused DT entry: type 0x6ffffffe arg 0x5d78 W/linker: libavutil-54.so: unused DT entry: type 0x6fffffff arg 0x2 W/linker: libswresample-1.so: unused DT entry: type 0x6ffffffe arg 0xc78 W/linker: libswresample-1.so: unused DT entry: type 0x6fffffff arg 0x3 W/linker: libavfilter-5.so: unused DT entry: type 0x6ffffffe arg 0x40f4 W/linker: libavfilter-5.so: unused DT entry: type 0x6fffffff arg 0x7 W/linker: libavdevice-56.so: unused DT entry: type 0x6ffffffe arg 0x19fc W/linker: libavdevice-56.so: unused DT entry: type 0x6fffffff arg 0x5 I/Videokit: start run in main. I/Videokit: register_exit I/Videokit: term_init & parse options. I/TMSDISP: AcsAndroidVirtualDisplayIntfImpl::~ AcsAndroidVirtualDisplayIntfImpl - Enter AcsAndroidVirtualDisplayIntfImpl::~AcsAndroidVirtualDisplayIntfImpl - Enter2 AcsAndroidVirtualDisplayIntfImpl::~AcsAndroidVirtualDisplayIntfImpl - mSource2 AcsAndroidVirtualDisplayIntfImpl::~AcsAndroidVirtualDisplayIntfImpl - Exit Application terminated.

Any ideas?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/madhavanmalolan/ffmpegandroidlibrary/issues/9, or mute the thread https://github.com/notifications/unsubscribe-auth/ACA3FWANkkj-yMJv4ONH_1jh9fQIvLM8ks5tXTo0gaJpZM4SPBpU .

dimcey commented 6 years ago

Apparently there was some issue with the phone. It worked when I changed it.

Another question, is it possible to modify the ffmpeg library loaded in the Controller to return the output? I want to stream a video using rtp and while doing so it would be nice to display the output in real-time that ffmpeg produces.

madhavanmalolan commented 6 years ago

Yes, it is possible. You can modify the ffmpeg_controller.c to redirect STDOUT and STDERR to a pipe, from which you can read.

How to : https://stackoverflow.com/a/42715692/1596181

Compilation instructions : https://medium.com/madhavanmalolan/ffmpeg-for-android-b307f2613c82

Will be happy to accept a PR on this, sounds like this will be useful to a lot of people. Let me know if you are working on it