FFmpeg"无法识别的选项"尝试合并Android中的2个音频文件时出错

时间:2017-03-20 09:13:33

标签: android audio merge ffmpeg

查看ThisThis链接以创建使用ffmpeg合并2个音频文件的命令,但它无法正常工作。

我的命令:

String input1 = "/storage/emulated/0/jd.m4a "; 
String input2 = "/storage/emulated/0/jd.m4a "; //trying with same audio just to check if it works or not
String filter = "-filter_complex [0:a]volume=0.99[a1];[1:a]volume=0.3[a2];[a1][a2]amerge=inputs=2,volume=1.3,pan=stereo|c0<c0+c2|c1<c1+c3[aout] ";
String output = "-map [aout] -strict -2 /storage/emulated/0/mergefile.m4a";

String[] cmd = {"-i",input1,"-i",input2,filter,output};

控制台输出:

03-20 13:52:04.981 32013-32013/io.whispero.soundmerger E/onProgress: ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
03-20 13:52:04.981 32013-32013/io.whispero.soundmerger E/onProgress:   built with gcc 4.8 (GCC)
03-20 13:52:04.982 32013-32013/io.whispero.soundmerger E/onProgress:   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=
03-20 13:52:04.982 32013-32013/io.whispero.soundmerger E/onProgress:   libavutil      55. 17.103 / 55. 17.103
03-20 13:52:04.983 32013-32013/io.whispero.soundmerger E/onProgress:   libavcodec     57. 24.102 / 57. 24.102
03-20 13:52:04.983 32013-32013/io.whispero.soundmerger E/onProgress:   libavformat    57. 25.100 / 57. 25.100
03-20 13:52:04.984 32013-32013/io.whispero.soundmerger E/onProgress:   libavdevice    57.  0.101 / 57.  0.101
03-20 13:52:04.984 32013-32013/io.whispero.soundmerger E/onProgress:   libavfilter     6. 31.100 /  6. 31.100
03-20 13:52:04.985 32013-32013/io.whispero.soundmerger E/onProgress:   libswscale      4.  0.100 /  4.  0.100
03-20 13:52:04.985 32013-32013/io.whispero.soundmerger E/onProgress:   libswresample   2.  0.101 /  2.  0.101
03-20 13:52:04.985 32013-32013/io.whispero.soundmerger E/onProgress:   libpostproc    54.  0.100 / 54.  0.100
03-20 13:52:04.986 32013-32013/io.whispero.soundmerger E/onProgress: Unrecognized option 'filter_complex [0:a]volume=0.99[a1];[1:a]volume=0.3[a2];[a1][a2]amerge=inputs=2,volume=1.3,pan=stereo|c0<c0+c2|c1<c1+c3[aout] '.
03-20 13:52:04.987 32013-32013/io.whispero.soundmerger E/onProgress: Error splitting the argument list: Option not found

根据我的理解,ffmpeg无法拆分和区分command的输入,过滤和输出,但我尝试了很多变化,仍然无效:(< / p>

请帮忙。看了很多,但没有一个命令正常工作。

提前致谢!

修改: 在-report之前添加-filter_complex并运行。 LOG在AS @Mulvya问下面

03-20 16:29:06.830 27671-27671/io.whispero.soundmerger E/onProgress: ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
03-20 16:29:06.830 27671-27671/io.whispero.soundmerger E/onProgress:   built with gcc 4.8 (GCC)
03-20 16:29:06.830 27671-27671/io.whispero.soundmerger E/onProgress:   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=
03-20 16:29:06.830 27671-27671/io.whispero.soundmerger E/onProgress:   libavutil      55. 17.103 / 55. 17.103
03-20 16:29:06.830 27671-27671/io.whispero.soundmerger E/onProgress:   libavcodec     57. 24.102 / 57. 24.102
03-20 16:29:06.832 27671-27671/io.whispero.soundmerger E/onProgress:   libavformat    57. 25.100 / 57. 25.100
03-20 16:29:06.832 27671-27671/io.whispero.soundmerger E/onProgress:   libavdevice    57.  0.101 / 57.  0.101
03-20 16:29:06.833 27671-27671/io.whispero.soundmerger E/onProgress:   libavfilter     6. 31.100 /  6. 31.100
03-20 16:29:06.834 27671-27671/io.whispero.soundmerger E/onProgress:   libswscale      4.  0.100 /  4.  0.100
03-20 16:29:06.834 27671-27671/io.whispero.soundmerger E/onProgress:   libswresample   2.  0.101 /  2.  0.101
03-20 16:29:06.835 27671-27671/io.whispero.soundmerger E/onProgress:   libpostproc    54.  0.100 / 54.  0.100
03-20 16:29:06.836 27671-27671/io.whispero.soundmerger E/onProgress: Unrecognized option 'i '.
03-20 16:29:06.837 27671-27671/io.whispero.soundmerger E/onProgress: Error splitting the argument list: Option not found
03-20 16:29:06.846 27671-27671/io.whispero.soundmerger E/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 '.
                                                                    Error splitting the argument list: Option not found
03-20 16:29:06.848 27671-27671/io.whispero.soundmerger E/onFinish: onFinish

0 个答案:

没有答案