Greetings from the Lost Coast of Northern California,
I have a number of videos I recorded while on vacation, and a lot of old recordings I think would make perfect soundtracks for them.
Can someone tell me how to write a simple batch file for this?
ffmpeg -i video.mp4 -i audio.aac -c:v copy -c:a copy c_1.mp4
Any assistance would be greatly appreciated.
Ax
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 7 of 7
Thread
-
-
Perhaps you could clarify your naming convention a bit more (video.mp4, audio.acc) an whether you want to keep the audio track from video.mp4 (giving two audio tracks in c_1.mp4) or not.
-
Sorry... I didn't think of that. The .mp4 files were originally .mov files from my camera, that the audio was recorded with the video, but was just the voices of my family. I converted them to .mp4 files and would like to drop the original audio and replace it with music I recorded.
-
Code:
ffmpeg -i video.mp4 -i audio.aac -c:v copy -c:a copy -map 0:v -map 1:a c_1.mp4
-map 1:a means take the audio from the second inputLast edited by jagabo; 6th Jul 2020 at 08:01.
-
Thanks! That explains something I didn't even realize I needed. Any suggestions on how to write the command into a batch file?
-
If your audio and video have the same base name (My Movie.mp4, My Movie.aac), to remux all file pairs in a folder:
Code:md New for %%F in (*.mp4) do ( ffmpeg -i "%%~nF.mp4" -i "%%~nF.aac" -c:v copy -c:a copy -map 0:v -map 1:a "New\%%~nxF" ) pause
-
Thanks again! It works like a charm. I had a feeling it would, because after looking around the forum and reading many posts looking for an answer before I posted my question (I know, I'm a rarity in that department) I was hoping you would reply. Kudos to you!
Similar Threads
-
Create batch file for ffmpeg to increment the file output
By Bassquake in forum Video ConversionReplies: 2Last Post: 25th Nov 2019, 05:03 -
How to set ffmpeg File Path on Batch File
By Daringbaaz in forum Newbie / General discussionsReplies: 2Last Post: 28th Jul 2019, 05:55 -
FFmpeg does not convert file through command line
By Vidikon in forum Newbie / General discussionsReplies: 2Last Post: 5th Jun 2019, 02:13 -
FFmpeg - How to Handle Blank Spaces on Batch Command
By grafx77 in forum Newbie / General discussionsReplies: 4Last Post: 1st May 2017, 16:55 -
FFMPEG - Looking for simple batch script to convert entire folder
By steptoe in forum Video ConversionReplies: 6Last Post: 20th Mar 2017, 22:49