1
votes

I am trying to execute below command using ffmpeg-android-java

-i /storage/sdcard0/WhatsApp/Media/WhatsApp Video/VID-20170228-WA0000.mp4 -ss 180 -t 292 -strict -2 -async 1 /storage/sdcard0/Movies/cropper_video_1.mp4

I am getting below failure message-

FAILED with output : 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/sdcard0/WhatsApp/Media/WhatsApp Video/VID-20170228-WA0000.mp4 -ss 180 -t 292 -strict -2 -async 1 /storage/sdcard0/Movies/cropper_video_1.mp4'. Error splitting the argument list: Option not found

Why am i getting this error and how can i resolve it?

3
Looks like a dash missing before i : -i /storage....Gyan
@Mulvya I am adding dash..forgot to put there..not working..same errorAndroid Developer
Your error log shows otherwise: Unrecognized option 'i /storage/sdcard0... Maybe your quotes and string is malformed.Gyan
can you post your android String array hereVinesh Chauhan

3 Answers

4
votes

I faced a very similar issue. The command I gave was

"-y -i /sdcard/Movies/test_video.3gp /sdcard/Movies/test_video.mp4"

And I got following error

Unrecognized option 'y -i /sdcard/Movies/test_video.3gp /sdcard/Movies/test_video.mp4'. Error splitting the argument list: Option not found

The reason was, I was giving my command in a single String. Instead you have to break each command to its own String and provide a String array

val command: List<String> = listOf("-y", "-i", "/sdcard/Movies/test_video.3gp", "/sdcard/Movies/test_video.mp4")
2
votes

Issue is that the shell command required here needs you to split your string at whitespaces so that there are none.

The easiest way to do that would be :-

String ffmpegCmdString = "-y -i /sdcard/Movies/test_video.3gp /sdcard/Movies/test_video.mp4"

String[] splitCmd = ffmpegCmdString.split(" ");

You can now pass this splitCmd variable to run your command and it will work like a charm.

0
votes

It means some features of ffmpeg are not fully implemented for this build. The solutions: 1. Create your custom build for ffmpeg for Android. 2. Remove -strict -2 -async 1 flags