使用Android Q ffmpeg拒绝权限":错误= 13,权限被拒绝 [英] permission is denied using Android Q ffmpeg": error=13, Permission denied

查看:1051
本文介绍了使用Android Q ffmpeg拒绝权限":错误= 13,权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用ffmpeg从RTSP视频中获取帧.但是对于上面的android 10,我得到如下错误.

I want to get the frames from the RTSP video using ffmpeg. But for android 10 above I am getting error as below.

 E/FFmpeg: Exception while trying to run: [Ljava.lang.String;@55e447f
java.io.IOException: Cannot run program "/data/user/0/com.example.downloadimagefromurl/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:10)
    at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:38)
    at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:10)
    at android.os.AsyncTask$3.call(AsyncTask.java:378)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
    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.<init>(UNIXProcess.java:133)

作为@Saurabh Thorat提供的答案,Google不允许应用程序从/data/user目录运行二进制文件.

As the answer provided by @Saurabh Thorat, Google doesn't allow apps to run binary files from /data/user directory.

我知道一个糟糕的解决方案是将compileSdkVersion和targetSdkVersion更改为28或更低,然后重新发布我的应用程序,这是不推荐的.

One bad solution that I know is to change compileSdkVersion and targetSdkVersion to 28 or below and re-release my application which is not recommended.

因此,我也在寻找将来版本的更可行的解决方案.

Hence, I am looking for more viable solutions for future releases as well.

任何提示,链接或建议将不胜感激.预先感谢.

Any hint, links or suggestion would be highly appreciated. Thanks in advance.

推荐答案

仅在Build.gradle文件上更改 targetSdkVersion 29至28 和 在您的设备上重新安装您的应用-由于targetSdkVersion 29是在Play商店上发布版本所必需的平台,因此已解决您的临时权限问题,建议您使用此库

Change only on Build.gradle file targetSdkVersion 29 to 28 and Re-Install your app on your device - It is resolved your permission issue for temporary because of the targetSdkVersion 29 is required platform for released build on play store so I suggest to you use this library

https://github.com/tanersener/mobile-ffmpeg

这篇关于使用Android Q ffmpeg拒绝权限":错误= 13,权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆