2

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?

1
  • 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. Commented Aug 5, 2016 at 9:41

3 Answers 3

2

Write your command like this

String[] command = new String[]{ "-i", "video.avi"}; 
Sign up to request clarification or add additional context in comments.

Comments

0

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

3 Comments

Yes, it is in .avi format. However according to catswhocode.com/blog/19-ffmpeg-commands-for-all-needs my command -i test4.avi should just return info about this video file. no convert or anything. Also i checked for the .mp4 format. Nothing changed
I used ffmpeg for video compression and that was working finely. I dont get the real cause of your error. Can you please check if there is space between - and i in your code
FfmpegCMD(new String[]{"-i "+inPath+"}); of course there is space
0

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.