Video Editing Trick: How to Replace the Audio Track of a Video

8 65

Here is the scenario

I run a pretty new fitness YouTube channel and periodically upload workout playlists with the best no copyright or free-to-useย  music on the internet. For that purpose I wanted to create a new playlist consisting of multiple audio files which I downloaded individually. I put the songs into my video editing software of choice -- which is the free VSDC video editor at the moment. (I'm not getting paid to say that. It's just the truth.)

I went ahead and created a nice music visualization and my laptop struggled through the rendering process. It took more than 4 hours of rendering time... My laptop is pretty slow... I never intended to do more than surfing the web and streaming videos with it, but well, things happened and now I'm trying to do video editing with it... ๐Ÿ˜…

After impatiently waiting more than 4 hours for the rendering to finish, I proudly opened the video file to admire my masterpiece.

And realized:

Oh no, I forgot to adjust the tracks to matching volumes.ย 

Explanation

Some tracks were much louder than others. In a workout playlist, this can be intentional: You want the high energy exercises accompanied by loud, pushing music. And you want the cooldown songs to be quieter and relaxing. However, that was not what I had. I had various songs with more or less random volumes strung together.ย That usually happens when you take music from different sources -- which was what I had done.

Maybe it's just because I am a perfectionist (which is not necessarily a good thing -- this is not a humble brag ๐Ÿ™ˆ), but I had to do something about it. Probably, nobody would have noticed (and maybe nobody will listen to the playlist anyway), but I had to fix it. I could not rest until the issue was solved. ๐Ÿ™ˆย 

What can I do now?

I could change the volume on a couple of tracks and run the rendering process again. That would mean another 4 hours of 100% CPU usage... And the resulting video output would be exactly the same -- only the audio would be slightly different.

Or I could insert the rendered video as input to my video editor, mute its audio track and add the songs again -- this time with the correct volumes. That would work and it would be faster than rendering the video from scratch, but the process would still take about 3 hours of rendering time. And the video quality would probably suffer, because of the video re-rendering. I would get away with it, though, because the artifacts would not be very noticeable. However, repeat that process a couple of times and the video would not look good any more.ย 

Here is my idea

To save some time, I rendered a blank video (only a black rectangle as video output to be exact) together with the fixed sound. The rendering process was much faster. It took about 15 minutes. I checked that the sound of this video was as I wanted it to be. (I actually ended up readjusting the volumes and rendering the video 3 more times until I was happy with the sound.)

That was a good idea so far, but now I still needed a method to remove the sound track from the original video and replace it with the audio track of the new video. And I would like to keep the video as it is -- without re-rendering it. That would not only preserve the video quality, it would also be much faster.

After trying several methods and with some trial and error, I ended up with the command

ffmpeg.exe -i input_video.mp4 -i replacement_audio.mp4 -vcodec copy -acodec copy -map 0:v:0 -map 1:a:0 output.mp4

This command uses ffmpeg to map the video stream of the first input file and the audio stream of the second input to the output video. An explanation can be found here.

The process took about 10 minutes and was mostly limited by the write speed of the microSD card that I used to save the output video file. -- Did I mention my laptop is slow? Yes, it also only sports 64 GB as an excuse for a SSD drive. And who knows how much of that space is taken up by Windows 10 and its updates -- so I had to use a microSD card to store the video with the humble size of almost 7 GB...

How did the video turn out?

I would say that it turned out really well. You can check the result for yourself here -- maybe you will even like the playlist. ๐Ÿ˜Š

So how much time did I save?

To be honest, none whatsoever... Because the research, trial and error to get to the above method took me more time than it would have taken my laptop to do the 4 hours of rendering. However, if I mess up again, now I know how to fix the problem in a less time-consuming way.

That's also one of the reasons why I am writing this article. I can not only help others searching for a solution to this problem -- now I have a place to look up the solution myself in case I ever need it again. ๐Ÿ˜„

What I plan to do next time

When I create a new workout Playlist, I will first add all the songs in the video editor, then render a blank video and check the audio until I am satisfied with it.ย 

Then and only then, I will start to work on the music visualization. Using this improved workflow the time-consuming video rendering has to be done only ONCE -- hopefully. If not, I keep a link to this post nearby...

ย Oh and by the way

If you are using a (micro-)SD card to expand your laptop's memory like I did, make sure NOT to use the FAT32 file system. Otherwise, you will waste time rendering a video and once it exceeds a file size of about 4 GB, the file is corrupted and you can restart the rendering process... (Use exFAT instead of FAT32 and the problem is solved.)

3
$ 0.84
$ 0.74 from @TheRandomRewarder
$ 0.05 from @Macronald
$ 0.05 from @tired_momma
Sponsors of MoreGainStrategies
empty
empty
empty

Comments

Wow, what a fantastic tutorial on video editing! The step-by-step guide on replacing the audio track of a video was incredibly helpful, and I appreciate the clear instructions provided. As a CapCut user, I'm always on the lookout for tips and tricks to enhance my editing skills, and this post delivered just that. For fellow CapCut enthusiasts looking to take their projects to the next level, I highly recommend checking out https://templates-capcut.in/ical-capcut-template/. The ical CapCut template for "thug love" is a game-changer and has added a unique flair to my videos. Thanks for sharing this valuable resourceโ€”it's a must-visit for all CapCut users!

$ 0.00
9 months ago

Thanks for the great post and helpful tips. It was very interesting to me. I also develop my blog on YouTube. And I try to use only high-quality services in order to develop and attract new users. On this page https://www.animatron.com/blog/10-best-video-hosting-sites-free-paid/ I recently found a list of the best video editing software that combines many useful features to create quality video content. What programs do you use? It would be interesting to know your professional opinion.

$ 0.00
1 year ago

Thanks for post!

$ 0.00
2 years ago

A patient/ impatient perfectionist! ๐Ÿ˜† But see the final result is now your masterpiece. I'm listening to it while typing and it's pretty cool! Well done. ๐Ÿ‘

$ 0.00
4 years ago

Hello everyone To create my own clips, I use a video editor from movavi https://www.movavi.com/support/how-to/how-to-make-picture-in-picture-video.html . The most favorite PiP effect

$ 0.00
3 years ago

Thank you so much for reading the article and for your comment. I'm glad you like the playlist. ๐Ÿ˜Š๐Ÿ‘

I'm looking forward to reading the article you are currently writing. ๐Ÿ˜Š

$ 0.00
4 years ago

lots of good info here...will bookmark this for future when i need to do this. great post my friend!

$ 0.00
4 years ago

Thank you so much. I'm glad you find the article helpful. ๐Ÿ˜Š๐Ÿ‘ Have a great start into your week!

$ 0.00
4 years ago