cropsly / ffmpeg-android-java

Android java library for FFmpeg binary compiled using https://github.com/writingminds/ffmpeg-android
http://writingminds.github.io/ffmpeg-android-java
GNU General Public License v3.0
3.32k stars 830 forks source link

Merge two audio files "Output file #0 does not contain any stream" #272

Open sruthipg opened 6 years ago

sruthipg commented 6 years ago

I am executing the following command to merge two audio file:

ffmpeg -i /storage/emulated/0/AudioRecorder/1519635839069.mp3 -i /storage/emulated/0/AudioRecorder/SampleAudio_0.4mb.mp3 -filter_complex amix=inputs=2:duration=first:dropout_transition=2 /storage/emulated/0/AudioRecorder/1519710922139.mp3

but I am getting the following error

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 Output #0, mp3, to 'ffmpeg -i /storage/emulated/0/AudioRecorder/1519635839069.mp3 -i /storage/emulated/0/AudioRecorder/SampleAudio_0.4mb.mp3 -filter_complex amix=inputs=2:duration=first:dropout_transition=2/storage/emulated/0/AudioRecorder/1519710922139.mp3': Output file #0 does not contain any stream

sruthipg commented 6 years ago

Finally I found the solution String s="-i "+mFileTemp.getPath()+" -i "+mFileTemp2.getPath()+" -i "+mFileTemp3.getPath()+" -filter_complex [0:0][1:0][2:0]concat=n=3:v=0:a=1[out] -map [out] "+originalFile.getPath(); String [] ss= s.split(" "); Pass this array to ffmpeg.execute(..). This works for me.

tutysathish commented 6 years ago

Hi @sruthipg I was getting the following error message while concat three audio files Invalid file index 2 in filtergraph description [0:0][1:0][2:0]concat=n=3:v=0:a=1[out]

Please let me know if there any solutions available for this?