Add audio to video in android

前端 未结 3 1241
你的背包
你的背包 2021-02-19 08:43

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.

相关标签:
3条回答
  • 2021-02-19 09:06

    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

    0 讨论(0)
  • 2021-02-19 09:07

    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

    0 讨论(0)
  • 2021-02-19 09:17

    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.

    0 讨论(0)
提交回复
热议问题