简体   繁体   English

如何在Android中使用ffmpeg命令

[英]How to use ffmpeg command for Android

I would like to separate audio and video from given input video file .I have build ffmpeg sos for Android using http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/ this link. 我想从给定的input video file分离audiovideo 。我已经使用http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/这个链接为Android构建了ffmpeg sos。

generated SOS 生成的SOS

 libavcodec-56.so,libavfilter-5.so,libavformat-56.so,libavutil-54.so,libswscale-3.so

ffmpeg command for separate video file(doesn't contain audio) from input video file ffmpeg命令,用于从输入视频文件中分离video file(doesn't contain audio)

ffmpeg -i input.mkv -map 0:v -codec copy output.mkv

I know the command which we have used in command prompt to get the desired output 我所知道的command ,我们在已经使用command prompt以获得所需的输出

I dont know how to call the ffmpeg command from Android Java Native method.and also dont know about write a JNI wrapper for this command. 我不知道如何从Android Java Native方法调用ffmpeg命令,也不知道为该命令编写JNI包装器。

Since you are doing the ffmpeg library porting to android, not the ffmpeg binary format. 由于您正在将ffmpeg库移植到android,而不是ffmpeg二进制格式。 You need to reference the ffmpeg library documents to call APIs exported in the library instead invoking the ffmpeg command. 您需要引用ffmpeg库文档来调用在库中导出的API,而不是调用ffmpeg命令。

You could use system() or exec() Linux C api to call the command ffmpeg in JNI, but i don't think this is the way you are looking for. 您可以使用system()exec() Linux C api在JNI中调用命令ffmpeg ,但是我不认为这是您要寻找的方式。

The article link you posted already provide the examples , have you checked? 您发布的文章链接已经提供了示例 ,您检查了吗?

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

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