-
Notifications
You must be signed in to change notification settings - Fork 828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot run program "/data/user/0/com.package.name/files/ffmpeg": error=13, Permission denied #343
Comments
Hey,
if (ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
package appsforactors.com.myselftapeapp.Mp4Tasks; import android.content.Context; import com.crashlytics.android.Crashlytics; import org.bytedeco.javacpp.presets.opencv_core; import java.lang.reflect.Field; import appsforactors.com.myselftapeapp.Utility.FileUtility; /**
|
is this worked for u? |
Any updates on this? |
I suppose its the limitation of Android Q and target api 29, as the library executes binary file. Indeed it looks really tricky |
Hi there, i am facing the same issue with android Q on target api 29. Taking write permission and waiting for library to load is not helping. Do anyone has any solution?? |
@rkkalkii, I would recommend you to try MediaCodec API, it really works as ffmpeg. The only limitation is api 18+. |
Does anybody got the solution for this ? I am also stuck here |
Yeah, as I wrote below, this solution will not work anymore until authors will not recompile binary file as a static library and wrap the code with JNI methods. The optimal solution without using any library is to use MediaCodec API provided by Android since API 18+ |
i recommend google/android to remove this scoped storage shit. Same issue... |
Hi............ |
@gowthami77 the temporary solution is set target api < 29 or you can use MediaCodec API. |
I have the same issue on Android 10+ with targetsdk 29. I can confirm it works fine with targetSdk 28. But I would like to force it work with the latest sdk. And I cannot use MediaCodec API due to limited functionallity. |
Also stuck on this issue. If anybody found a solution except for adding targetSdk 28. Please any help will be appreaciated. |
@aliraza96, if MediaCodec is not applicable for you, its still possible to compile ffmpeg from sources as shared library. Here you may found some related info about compilation for Android. Also this one repo structured very well. |
I found this library and it worked well on Android 10 https://github.com/tanersener/mobile-ffmpeg |
@gowthami77 is it working without any errors?? can you post a sample code over here. |
@gowthami77 i tried to use library but it requires minsdk 24 so its useless. |
|
can you please share how to implement this library because I can't find implementation about this library? Thanks |
but in his documentation saying it requires API 16+ |
I solved the same problem as below. |
Yeah. I started using this lib too. The problem has gone. Everything works fine on Android 11. |
Use below library, and put below packagingOptions in build.gradle: packagingOptions { it will solve your problem
this work for android 11 also (tested) |
i have error "error=13, Permission denied" while trying to run Ffmpeg in android 10 (Q).
java.io.IOException: Cannot run program "/data/user/0/com.package.name/files/ffmpeg": error=13, Permission denied
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1050)
at java.lang.Runtime.exec(Runtime.java:698)
at java.lang.Runtime.exec(Runtime.java:563)
at com.github.hiteshsondhi88.libffmpeg.ShellCommand.run(ShellCommand.java:11)
at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:40)
at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:12)
at android.os.AsyncTask$3.call(AsyncTask.java:378)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Caused by: java.io.IOException: error=13, Permission denied
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.(UNIXProcess.java:133)
at java.lang.ProcessImpl.start(ProcessImpl.java:141)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
at java.lang.Runtime.exec(Runtime.java:698)
at java.lang.Runtime.exec(Runtime.java:563)
at com.github.hiteshsondhi88.libffmpeg.ShellCommand.run(ShellCommand.java:11)
at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:40)
at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:12)
at android.os.AsyncTask$3.call(AsyncTask.java:378)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
The text was updated successfully, but these errors were encountered: