Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 22nd August 2019, 10:17   #1  |  Link
deama
Registered User
 
Join Date: May 2018
Posts: 14
How to batch replace audio?

So I have a couple hundred .mkv videos but with bad audio. I also have the same amount (same name too) of .ac3 with good audio but in audio only. How do I replace the .mkv audio with the .ac3 ones using hybrid?
deama is offline   Reply With Quote
Old 22nd August 2019, 10:29   #2  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,564
I don't know about Hybrid but with Windows cmd and MKVToolNix it's a simple command.
Code:
for %a in (*.mkv) do mkvmerge -o "output\%~a" --no-audio "%~a" "%~na.ac3"
sneaker_ger is offline   Reply With Quote
Old 22nd August 2019, 10:39   #3  |  Link
deama
Registered User
 
Join Date: May 2018
Posts: 14
Quote:
Originally Posted by sneaker_ger View Post
I don't know about Hybrid but with Windows cmd and MKVToolNix it's a simple command.
Code:
for %a in (*.mkv) do mkvmerge -o "output\%~a" --no-audio "%~a" "%~na.ac3"
Can it be done with ffmpeg instead?
deama is offline   Reply With Quote
Old 22nd August 2019, 10:40   #4  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,564
Code:
for %a in (*.mkv) do ffmpeg -i "%~a" -i "%~na.ac3" -map 0:v -map 1:a -map 0:s? -c copy "output\%~a"
sneaker_ger is offline   Reply With Quote
Old 22nd August 2019, 12:31   #5  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,768
In powershell it looks like so:

Code:
gci *.mkv | % { mkvmerge -o "output\$($_.Name)" --no-audio "$($_.Name)" "$($_.BaseName).ac3" }
__________________
mpv.net - StaxRip - MediaInfo.NET - Get-MediaInfo - More

Last edited by stax76; 22nd August 2019 at 12:40.
stax76 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:53.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.