0

I want to find a way to create a new MP4 container and add an MP3 file into it. Whether the MP3 file is to be encoded or not does not matter to me. Is there any easy way to do this without using ffmpeg? I have found the following example for muxing:

android - How to mux audio file and video file?

Though, it has issues and also it is supposed to mux the audio file into an existing video.

Can someone point me to a guide or at least in the right direction to accomplish what I need?

John Anderson
  • 124
  • 1
  • 1
  • 9

1 Answers1

1

U can do this using MediaCodec and MediaMuxer but right now i think mp3 is not supported u should first decode mp3 to wav and encode to supported format like aac using MediaExtractor and MediaCodec and then u can add to mp4 container using Muxer. U might find this link helpful https://www.sisik.eu/blog/android/media/mix-audio-into-video

boompsy
  • 66
  • 2