I'm converting two different audio formats to mp3 using the below command.
String[] nonmp3ToMp3 = new String[]{"-y","-i", path, "-acodec","libmp3lame",convertedFinalOutput};
I want to concatenate converted audios using the below command
String[] mergeCmd = new String[]{"-y","-i","concat:"+convertedAudio1+"|"+convertedAudio2,"-c","copy",finalOutput};
It's concatenating, but, second audio is not getting played as there is difference in bitrates.
Below is the output with error. Please let me know command to concatenate two audios with different bitrate and different formats.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I'm converting two different audio formats to mp3 using the below command. String[] nonmp3ToMp3 = new String[]{"-y","-i", path, "-acodec","libmp3lame",convertedFinalOutput};
I want to concatenate converted audios using the below command String[] mergeCmd = new String[]{"-y","-i","concat:"+convertedAudio1+"|"+convertedAudio2,"-c","copy",finalOutput};
It's concatenating, but, second audio is not getting played as there is difference in bitrates. Below is the output with error. Please let me know command to concatenate two audios with different bitrate and different formats.
ERROR
FFmpegSession{sessionId=9, createTime=Thu Jan 27 15:38:06 GMT+05:30 2022, startTime=Thu Jan 27 15:38:06 GMT+05:30 2022, endTime=Thu Jan 27 15:38:06 GMT+05:30 2022, arguments=-y -i concat:/storage/emulated/0/Converted Audio/1643277919.mp3|/storage/emulated/0/Converted Audio/1643278008.mp3 -c copy /storage/emulated/0/Audio Merge/1643278080.mp3, logs=ffmpeg version v4.4-dev-3015-gc0d0b1c4f6 Copyright (c) 2000-2021 the FFmpeg developers built with Android (6875598, based on r399163b) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d) configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/storage/dark/projects/ffmpeg-kit/prebuilt/android-arm64-lts/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --cc=aarch64-linux-android21-clang --cxx=aarch64-linux-android21-clang++ --ranlib=aarch64-linux-android-ranlib --strip=aarch64-linux-android-strip --nm=aarch64-linux-android-nm --extra-libs='-L/storage/dark/projects/ffmpeg-kit/prebuilt/android-arm64-lts/cpu-features/lib -lndk_compat' --target-os=android --enable-neon --enable-asm --enable-inline-asm --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --disable-static --enable-shared --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-openssl --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-audiotoolbox --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gmp --enable-gnutls --enable-libmp3lame --enable-libass --enable-iconv --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libopencore-amrnb --enable-libshine --enable-libspeex --enable-libdav1d --enable-libkvazaar --enable-libx264 --enable-gpl --enable-libxvid --enable-gpl --enable-libx265 --enable-gpl --enable-libvidstab --enable-gpl --enable-libilbc --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libtwolame --enable-libvo-amrwbenc --enable-zlib --enable-mediacodec libavutil 56. 65.100 / 56. 65.100 libavcodec 58.123.100 / 58.123.100 libavformat 58. 67.100 / 58. 67.100 libavdevice 58. 12.100 / 58. 12.100 libavfilter 7.106.100 / 7.106.100 libswscale 5. 8.100 / 5. 8.100 libswresample 3. 8.100 / 3. 8.100 [mp3 @ 0x753024e600] invalid concatenated file detected - using bitrate for duration [mp3 @ 0x753024e600] Estimating duration from bitrate, this may be inaccurate Input #0, mp3, from 'concat:/storage/emulated/0/Converted Audio/1643277919.mp3|/storage/emulated/0/Converted Audio/1643278008.mp3': Metadata: encoder : Lavf58.67.100 Duration: 00:01:01.66, start: 0.025057, bitrate: 128 kb/s Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s Metadata: encoder : Lavc58.12 Output #0, mp3, to '/storage/emulated/0/Audio Merge/1643278080.mp3': Metadata: TSSE : Lavf58.67.100 Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s Metadata: encoder : Lavc58.12 Stream mapping: Stream #0:0 -> #0:0 (copy) Press [q] to stop, [?] for help size= 1kB time=-00:00:00.02 bitrate=N/A speed=N/A
[mp3 @ 0x753024fe00] Audio packet of size 344 (starting with 49443304...) is invalid, writing it anyway. size= 964kB time=00:06:06.57 bitrate= 21.5kbits/s speed=2.18e+03x
video:0kB audio:963kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.046829% , state=COMPLETED, returnCode=0, failStackTrace='null'}