1

I will develop an android application to combine video and audio recordings (audio as the background sound of the recording), I have read some ffmpeg and mp4parser references, can anyone help me?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
keen
  • 11
  • 3

1 Answers1

0

Unfortunately, there is no simple way to make an application like you need. The source code will be huge, so I can give you a description of an algorithm and some useful links.

Video: You need to record a video using the camera 2 api and Surface. This Surface should be gotten from MediaCodec (encoder). The MediaCodec (encoder) will encode video frames from a camera and convert them into ByteBuffers.

Audio: You need to extract an audio from your raw file using MediaExtractor which will extract audio samples as ByteBuffers.

Muxing: Both, audio samples (ByteBuffers) and video frames (ByteBuffers) should be muxed using MediaMuxer.

Oleg Sokolov
  • 1,134
  • 1
  • 12
  • 19