[英]Android Ffmpeg- Root Permission not granted to “su” Working Directory:null
I have compiled ffmpeg for android using ndk r10e on os x but it does not produce ffmpeg.so. 我已经在OS X上使用ndk r10e为android编译了ffmpeg,但是它不会产生ffmpeg.so。 All other libraries are generated. 生成所有其他库。 I have been searching this for over a week. 我已经搜索了一个多星期。 I have tried various methods to execute ffmpeg command but none were successful. 我尝试了各种方法来执行ffmpeg命令,但没有一个成功。 I used 我用了
Process p=new ProcessBuilder("su /data/data/com.example.ffmpegtem/").start();
Process p = Runtime.getRuntime().exec(
getBaseContext().getApplicationInfo().nativeLibraryDir);
Process p = Runtime.getRuntime().exec(Environment.getExternalStorageDirectory().getPath());
Process p = Runtime.getRuntime().exec("chmod 700 /data/data/com.example.ffmpegtem/app_bin/ffmpeg");
All resulted in IOException-Working Directory: null. 全部导致IOException-Working Directory:null。 I also tried Shell Callback method provided by Github android ffmpeg library project which resulted in Nullpointerexception. 我还尝试了Github android ffmpeg库项目提供的Shell Callback方法,该方法导致Nullpointerexception。 I have written read/write permission. 我有书面读/写许可。
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
Convert 1 image to video code: 将1张图片转换为视频代码:
DataOutputStream os = new DataOutputStream(chperm.getOutputStream());
os.writeBytes("-loop 1 -i " + inpath + " -c:v libx264 -t 15 -pix_fmt yuv420p -vf scale=320:240 "+outpath);
What am I doing wrong? 我究竟做错了什么? Please help 请帮忙
Why do you want to run ffmpeg cmd in Android enviroment? 为什么要在Android环境中运行ffmpeg cmd? Why not use it programatically? 为什么不以编程方式使用它? You could try a library here https://github.com/search?utf8=%E2%9C%93&q=ffmpeg+android and write some code to achieve your goal. 您可以在这里尝试一个库https://github.com/search?utf8=%E2%9C%93&q=ffmpeg+android并编写一些代码来实现您的目标。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.