Merge Audio and Video in Seconds with FFmpeg

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so do you ever take a video and edit it in something like adobe audition and then you need to merge it back into the original video well doing that typically means going into your video editor and re-exporting which is a pain i do that several times a week and i really hate doing it so there's this tool called ffmpeg that can save you the trouble of doing that ever again thankfully it just takes a single command and it'll merge the two together in just a few seconds unfortunately ffmpeg is basically a world of eldridge knowledge it's super complicated that isn't so you read the docs then it starts to make sense so first things first you're going to need to install ffmpeg you can use your package manager like brew apt chocolatey whatever i'm using mac so i'm going to do brew install ffmpeg and beyond that you just need a video and an audio clip from the same source in my case i've got a recent video that i did and i'm just going to go into adobe edition and make some minor changes and from what i understand they're already using it in production okay perfect so let's go and merge these together here's the command now we've got these two inputs you'll see that it has a dash i file name we've got two of those the first one is the video the second one is the audio the order does matter here because it's going to reference those by the index of basically how it reads the streams so that video is going to be index zero the audio is index one next up we're going to set the codex for both video and audio that's that weird dash c colon v dash c colon a i'd expect v stands for video a for audio so what this is doing is it's setting the codec for the video for the output to match that of the input source and for the audio we're setting aac depending on your setup you might need to use something else but for me that's what works and then we've got these two map commands where we're saying from index 0 so the video source we want to take the video and map it to the output and then the second one we're doing map 1 colon a we're taking the source from index one we're grabbing the audio and putting that into the output and then finally we've got the output file name so pretty simple kind of an ugly syntax but hey it works so let's go ahead and give it a try alright gotta wait a few moments and pretty soon it's gonna be ready to go that's significantly faster than re-exporting from premiere now let's watch the clip hey folks there's a new rich text editor called lex gold that just hit the scene amazing i hope you found this useful let me know if you have any cool tips and tricks on ffmpeg or if there's anything else you'd like to see and i'll see in the next one
Info
Channel: CODE IS EVERYTHING
Views: 7,685
Rating: undefined out of 5
Keywords: ffmpeg, video editing, audio editing, ffmpeg command, merge audio, open source
Id: Q7XLtjMoMK4
Channel Id: undefined
Length: 2min 28sec (148 seconds)
Published: Thu Jun 30 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.