Search code examples
androidffmpegmp3

Merge two mp3 files through ffmpeg in android not working


I'm trying to merge (overlap) two mp3 files in one output file through ffmpeg but I'm receiving the below log messages, I guess a syntax error which I'm not able to identify.

I'm using this external library to interact with ffmpeg: github.com/WritingMinds/ffmpeg-android-java

Command executed: ffmpeg -i /storage/emulated/0/bass.mp3 -i /storage/emulated/0/clap.mp3 -filter_complex amerge -c:a libmp3lame -q:a 4 /storage/emulated/0/output.mp3

(the paths are obtained with getabsolutepath)

Messages taken from log:

ffmpeg version n2.4.2 Copyright (c) 2000-2014 the FFmpeg developers

built on Oct 7 2014 15:08:46 with gcc 4.8 (GCC)

Input #0, mp3, from '/storage/emulated/0/bass.mp3':

[mp3 @ 0xb5886400] Estimating duration from bitrate, this may be inaccurate

[NULL @ 0xb5887000] Unable to find a suitable output format for 'ffmpeg'

ffmpeg: Invalid argument


Solution

  • Sooo, your problem is reported in the issues and it is here: you just do not have to type ffmpeg at the beginning of the command.