I want to develop an android application which can record a video (mp4), then I have some audio files (mp3) in my resources folder, and I want to add it to the end of the video. So the final effect will be like first the video is played and at the end of video the added audio will be heard. how can I do it?
Asked
Active
Viewed 1.4k times
15
-
1By writing the code of each component and combining them? What exactly are you asking? You should try to ask [specific programming-related questions](http://stackoverflow.com/faq) that are actually answerable. – Cat Jul 31 '12 at 03:31
-
what you want to do?clearly ask.otherwise we can't help you.do you want to add audio in your video attachment? – MBMJ Jul 31 '12 at 03:36
-
1I want to concatenate a video and audio so as to have an other video as result – NMNM Jul 31 '12 at 03:49
-
concatenate a video and audio ? so as to have an other video as result??? – MBMJ Jul 31 '12 at 03:56
-
1The idea is I record a video (.mp4), and to have a funny video I want to add at the end a funny voices those are .mp3, I'm sorry if I can't explain my problem. – NMNM Jul 31 '12 at 04:00
-
that means u add audio at the end of the video when the video end? – MBMJ Jul 31 '12 at 04:09
-
can anyone help me to convert mp3 into mp4 ?(audio to video conversion) and there will be image which i have to display in video ... i cannot post a question and i am in need – Drashti Jan 17 '19 at 12:16
3 Answers
8
Combing to files with different audio codecs is not easily possible. I would do the following:
- convert the MP3 files to the same format as the video (most likely AAC in an MP4 container)
- Now you can use mp4parser's AppendExample to append the recorded video with the pre-recorded sound
- The result will be one MP4 file containing the video first and the sound.
Full disclosure: I am the maintainer of mp4parser.

Sebastian Annies
- 2,438
- 1
- 20
- 38
-
1I made Android application [TestMp4parser](https://github.com/dadachi/TestMp4parser) with [mp4parser](http://mp4parser.googlecode.com/)'s [AppendExample](https://mp4parser.googlecode.com/svn/trunk/examples/src/main/java/com/googlecode/mp4parser/AppendExample.java) and [ShortenExample](https://mp4parser.googlecode.com/svn/trunk/examples/src/main/java/com/googlecode/mp4parser/ShortenExample.java). – dadachi Nov 29 '12 at 00:32
-
hi sebastian,how to add audio in video file.is it possible in android and mp4 parser? – rams Dec 14 '12 at 09:39
-
can anyone help me to convert mp3 into mp4 ?(audio to video conversion) and there will be image which i have to display in video ... i cannot post a question and i am in need – Drashti Jan 17 '19 at 12:16
1
After api version 18 android MediaCodec apis supports to access the low level api. MediaMuxer muxing the elementary streams.
https://developer.android.com/reference/android/media/MediaMuxer.html

rKrishna
- 1,399
- 12
- 22
-
1can anyone help me to convert mp3 into mp4 ?(audio to video conversion) and there will be image which i have to display in video ... i cannot post a question and i am in need – Drashti Jan 17 '19 at 12:17
-
-5
Make two activity ,one for video,and one for audio.Make the video activity main .Then set waiting time for audio.And call the audio activity using intend.So play the video,after the waiting time end the audio will be played at the end of the video.Set the audio waiting time perfectly.So it will play after the video end

MBMJ
- 5,323
- 8
- 32
- 51