繁体   English   中英

Android ffmpeg库使用

[英]Android ffmpeg library use

我对使用ffmpeg库很陌生。 我使用此http://writingminds.github.io/ffmpeg-android-java/将库添加到我的android studio项目中。 当我运行命令-version-devices时,它运行良好。但是,当我尝试以-i开头的任何命令(例如-i video.avi ,出现错误:

onFailure:ffmpeg版本n3.0.1版权所有(c)2000-2016使用gcc 4.8(GCC)配置构建的FFmpeg开发人员:--target-os = linux --cross-prefix = / home / vagrant / SourceCode / ffmpeg-android /工具链-android / bin / arm-linux-androideabi- --arch = arm --cpu = cortex-a8 --enable-runtime-cpudetect --sysroot = / home / vagrant / SourceCode / ffmpeg-android / toolchain-android / sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable- ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static- pkg-config = / home / vagrant / SourceCode / ffmpeg-android / ffmpeg-pkg-config --prefix = / home / vagrant / SourceCode / ffmpeg-android / build / armeabi-v7a --extra-cflags ='-I /主页/无用/ SourceCode / ffmpeg-android / toolchain-android / include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE = 2 -fno-strict-overflow -fstack-protector- 全部'--extra-ldflags ='-L / home / vagrant / SourceCode / ffmpeg-android / toolchain-android / lib -Wl,-z,relro -Wl,-z,now -pie'--extra-libs = '-lpng -lexpat -lm'--extra-cxxflags = libavutil 55. 17.103 / 55. 17.103 libavcodec 57. 24.102 / 57. 24.102 libavformat 57. 25.100 / 57. 25.100 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 31.100 / 6. 31.100 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100无法识别的选项'i /storage/emulated/0/Movies/test4.avi'。 拆分参数列表时出错:找不到选项

难道我做错了什么? 谁知道为什么像“ -i”这样的基本命令不起作用?

这样写你的命令

String[] command = new String[]{

                    "-i", "video.avi"};

根据错误,我认为您的视频已经是.avi格式。 请尝试.mp4格式并检查是否存在问题。

我来晚了一点,但是它是这样的:

 String cmd = "Complete command you want to execute";
String[] myArr = cmd.split(" ");
ffmpeg.execute(myArr, new ExecuteBinaryResponseHandler(){
 });

此代码的问题在于,整个命令被视为一个选项,因此请使用提供的代码将每个选项和每个选项的值分开。 希望它可以帮助某人。

暂无
暂无

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

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