Impossible to mix audio file and video file using MediaMuxer?

nguoitotkhomaisao picture nguoitotkhomaisao · Dec 6, 2013 · Viewed 9.1k times · Source

I'm developing an Android App that records screen video and audio.
I recorded these 2 files : mp3 audio file and mp4 video file(no sound).

Now I want to mix them and create a new mp4 video file(with sound). From Android 4.3, Google suggests using the MediaMuxer class to mix stream audio and video. I have tried many times without success.

Any solution to resolve my issue with MediaMuxer API from Google? Any help will be greatly appreciated.

Answer

Guy picture Guy · Jun 25, 2014

MediaMuxer does not transcode. If you write out an MPEG4 file, it will expect the video file to be MPEG4/AAC and the audio file to be an AAC file (m4a) as well.

Once you feed it with an m4a, muxing will succeed.