

You just needs to remember that the length of output file will be equal to the length of maximum media stream.įor example, if audio length is 10 seconds and video length is 15 seconds, the new output will be of 15 seconds. Because we do not wanted to make any changes in the original file. We will be creating a separate file for output that will contain your video and new audio. And then get the audio streams from audio file. You can add any audio to your video by first removing the audio streams from video file. It means the number of audio steams in that file is 0. If you have ever watched any video that does not have any sound.

Each video has audio input streams which we can hear when we play the video. Or wanted to put some background music on any of your video. You can use it to either replace the video’s audio.

Add audio to videoĪdding audio to a video will replace the video’s actual audio. We will be using PHP and FFmpeg for both purposes. And also, how you can extract the audio from the video. In this article, we are going to teach you how you can add audio to a video.
