1
votes

I'm pretty new to use of ffmpeg library. I used this http://writingminds.github.io/ffmpeg-android-java/ to add library to my android studio project. It works well when I run the command -version or -devices However when I try any command with -i beginning like for example -i video.avi I get the error :

onFailure : ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 4.8 (GCC) configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-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/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --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 Unrecognized option 'i /storage/emulated/0/Movies/test4.avi'. Error splitting the argument list: Option not found

Am I doing something wrong? ANybody have idea why basic command like "-i" doesnt work?

3
Not know why exactly. But I have one clue: The error says 'i /storage/emulated/0/Movies/test4.avi' is unrecognized. It means ffmpeg takes 'i /storage/emulated/0/Movies/test4.avi' as a option. It works like calling ffmpeg with this command: ffmpeg -"not a option". This will report not a option is unrecognized, while if calling with ffmpeg -not a option, ffmpeg will complain not is unrecognized.halfelf

3 Answers

2
votes

Write your command like this

String[] command = new String[]{

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

According to the error I think your your video is already in .avi format. Please try .mp4 format and check there is issue.

0
votes

I am a bit late but It works like this:

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

The problem with this code is that the whole command is being considered as an option, So separate each option and value of each option by using the provided code. Hope it helps someone.