This is the command. I am trying to merge audio into video.
val tempFile = File(requireActivity().cacheDir, "output.mp4")
tempFile.createNewFile()
Log.e(TAG, ": " + tempFile.length())
val command: String = "ffmpeg \\\n" +
" -i $video \\\n" +
" -i $audio \\\n" +
" -c:v copy \\\n" +
" -c:a copy \\\n" +
" -shortest \\\n" +
" -f mp4 \\\n" +
" ${tempFile.absolutePath}"
The command becomes:
ffmpeg \
-i /data/user/0/com.rohaitas.example/cache/temp_video.mp4 \
-i /data/user/0/com.rohaitas.example/cache/temp_audio.mp3 \
-c:v copy \
-c:a copy \
-shortest \
-f mp4 \
/data/user/0/com.rohaitas.example/cache/output.mp4
[NULL @ 0xb4000076a3da3b00] Unable to find a suitable output format for 'ffmpeg' ffmpeg: Invalid argument
Dependency implementation 'com.arthenica:ffmpeg-kit-full:5.1'
Command failed with state COMPLETED and rc 1.null
Stream #1:0
Audio: mp3, 48000 Hz, stereo, fltp, 199 kb/s
Metadata:
encode:
Lavc59.18
[NULL @ 0xb4000076a6f4ec80] Unable to find a suitable output format for 'ffmpeg'
ffmpeg: Invalid argument
Just managed to Fixed the issue, Now it doesn't give error.