简体   繁体   English

在Android开发中使用命令行安装ffmpeg库

[英]installing ffmpeg library using command line in android development

I have tried to run a command from the application to install the ffmpeg library. 我试图从应用程序运行命令以安装ffmpeg库。 This is my code: 这是我的代码:

try {
    Process process =Runtime.getRuntime().exec("/system/bin/pm install ffmpeg");
    BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
} catch (IOException e) {
    e.printStackTrace();
    Toast.makeText(getApplicationContext(),"failed",Toast.LENGTH_SHORT).show();
}

Problem: 问题:

It doesn't work and prints the output " failed ". 它不起作用,并打印输出“ failed ”。

pm is not apt , and Android does not have a standard repo from which you can install ffmpeg (alas!). pm不是apt ,并且Android没有标准回购协议,您可以从中安装ffmpeg (alas!)。 It is not clear what you want to install. 目前尚不清楚您要安装什么。 If your app depends on some other app being installed from PlayStore, see this method . 如果您的应用程序依赖于PlayStore中正在安装的其他应用程序,请参见此方法 If your app uses the ffmpeg binary (in form of executable or shared library), you must package it with your APK. 如果您的应用使用ffmpeg二进制文件(以可执行文件或共享库的形式),则必须将其与APK打包在一起。 Note that recently Google introduced Dynamic feature modules - a new way to package parts of your APK so that they may be downloaded on demand. 请注意,最近Google引入了动态功能模块 -一种打包APK部分的新方法,以便可以按需下载。 One such feature for your app could contain ffmpeg . 您的应用程序的一种此类功能可能包含ffmpeg

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM