在Android中向视频添加音频 [英] Add audio to video in android

查看:223
本文介绍了在Android中向视频添加音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开发一个可以录制视频(mp4)的android应用程序,然后在我的资源文件夹中有一些音频文件(mp3),我想将其添加到视频末尾.因此,最终效果将类似于首先播放视频,然后在视频结束时听到添加的音频.我该怎么办?

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?

推荐答案

很难对具有不同音频编解码器的文件进行合并.我将执行以下操作:

Combing to files with different audio codecs is not easily possible. I would do the following:

  • 将MP3文件转换为与视频相同的格式(最有可能是MP4容器中的AAC)
  • 现在,您可以使用 mp4parser
  • 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.

全部披露:我是mp4parser的维护者.

Full disclosure: I am the maintainer of mp4parser.

这篇关于在Android中向视频添加音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆