Merge Audio and Video in Seconds with FFmpeg
Вставка
- Опубліковано 29 чер 2022
- FFmpeg is an incredible tool that can seemingly do anything provided you can find the right incantation. I've been using this command a bunch recently and it has saved me a ton of time already.
The command:
ffmpeg -i input.mp4 -i input.wav -c:v copy -c:a aac -map 0:v -map 1:a output.mp4
(Replace input.mp4 with your video file, input.wav with your audio file, and output.mp4 with your desired output file name)
You can learn more about FFmpeg on their site: ffmpeg.org/
Let me know if you have any cool FFmpeg commands you run.
#ffmpeg #videoediting #opensource - Наука та технологія
ffmpeg -i input.mp4 -i input.mp3 -c:v copy -c:a aac -map 0:v -map 1:a output.mp4
Thank you :)
thanks,i was having trouble using ffmpeg and found out your vid and it worked like a charm
Very nice.... works like a charm :)
thanks, really helpful and well explained
Thank you very much. I try to encode two stereo streams (front & rear) into one binaural stereo file. The docs tell me to use sofa profiles. I found those, but no docs which one to use. Is there any straight forward command line like (GPT suggests):
ffmpeg -i front.wav -i rear.wav \
-filter_complex "[0:a]af=earwax=0.6[b0];[1:a]af=earwax=0.6[b1];[b0][b1]amerge=inputs=2,pan=stereo|FL=FL+0.30*FR|FR=FR+0.30*FL[a]" -map "[a]" -ac 2 -c:a pcm_s16le -y out.wav
Thanks, dude.
Thanks a lot.
I used this combined with yt-dlp to download UA-cam videos and oh is it so beautiful
that's what I am looking for. Did it work without re-encoding ?
That's the only thing I could see you using this for anytime soon. I haven't tried it yet though.
i always run `ffmpeg -i input.mkv output.mp4`
to reduce the video size for yt uploading
Thank you, another question, is there a way to extract audio from a video, loseless with ffmpeg?
SPLIT audio track out from an .mp4 as .m4a without re-encoding:
--------
ffmpeg -i input.mp4 -map 0:a:0 -c copy output.m4a
--------
I just learned this a few minutes ago from this
tutorial: v=I0buEOp3l1k&t=3m30s
I have not tested my tweaks to fit your request, but I expect it should work.
does it do it without re-encoding?
I have downloaded youtube video using yt-dlp and have audio and video separately . All it needs is merging together
Yeah the -c:v copy means it'll just copy the existing without re-encoding. I believe that if you tried to output to a different video format that doesn't support the codec from the original it will automatically try and re-encode. But if you're just doing mp4 -> mp4, or different types but that support the same codec it shouldn't re-encode.
@@CODE_IS_EVERYTHING thanks
0:41 your audio file is much bigger than your video file? interesting 🤔
Haha whenever I use Adobe audition it balloons my audio file size
Gimme the code!!!!!! :)
Gotta love simple videos that skip half the information you need to actually complete the process
And also don't post the command in the description or where to put it :)
Haha fair point, thanks for bringing that up, I've added the command to the description.
@@CODE_IS_EVERYTHING oh damn, thanks :o
And sorry about that, I was just trying to find a quick solution to merge my friend's audio layers for a video into a single MP4, but most videos either don't use windows or assume I'm not completely new to using ffmpeg