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. |
25th February 2012, 21:09 | #1 | Link |
Registered User
Join Date: Nov 2010
Posts: 12
|
.bat's with FFMpeg
Heythere.
I got plenty of episodes of a show, with english and russian audio tracks. Now, the thing is, russian audiotracks are separately from containers with the video and english tracks, are lying in the folder, when I need them to be inside the containers, with the video and english track. Tracks are named after containers, they got the same names, just the extension is different. (like 1.mkv, 1.mp3, 2.mkv, 2.mp3...) I need to write a .bat file that would join the files with the same name into new container, using FFMpeg. When I write... Code:
FOR %%i IN (*.mkv) DO ( ffmpeg -i %%i -i "%%~ni".mp3 -acodec copy -vcodec copy "%%~ni"1.mkv ) Any1, help with the code please. |
25th February 2012, 21:21 | #2 | Link |
brontosaurusrex
Join Date: Oct 2001
Posts: 2,392
|
you can either
a. try to understand the channel -map command (which i don't) or do a two step process: b. 1. dump video (ignore audio) to temporary file (use -an to ignore all? audio tracks) 2. merge them like you do now. c. use mkvmerge
__________________
certain other member |
25th February 2012, 22:03 | #3 | Link |
Registered User
Join Date: Nov 2010
Posts: 12
|
Option a. won't work either, unfortunately, tried. Same thing - can copy anything inside the container, but nothing on what's outside. Or I just tried it wrong.
Option c. would b 2 long. As I sad, it's not a single file, think of it as if u had 100+files=) Option b would take two operations to be done. Somehow I believe... there should b an easier way, with only one bat file. |
26th February 2012, 00:09 | #5 | Link | |||
Registered User
Join Date: Nov 2010
Posts: 12
|
Thankx for mkvmerge advie man! But I need to know about FF too.
I tried to use -newaudio but had no luck with that. I tried this Quote:
Quote:
Quote:
Last edited by linkRed; 26th February 2012 at 00:14. |
|||
26th February 2012, 00:52 | #6 | Link |
Registered User
Join Date: Dec 2002
Posts: 5,565
|
Had some problems there myself, stupid ffmpeg always breaking stuff or not working as documented/badly documented. Try:
Code:
for %%a in (*.mkv) do ffmpeg -i "%%a" -i "%%~na.mp3" -vcodec copy -acodec copy -map 0:0 -map 1:0 -map 0:1 "%%~na1.mkv" |
26th February 2012, 05:34 | #7 | Link | ||
Registered User
Join Date: Nov 2010
Posts: 12
|
Sir, you are awesome. And brilliant. Choose what you like more.
I also find out one interesting thing, that might be useful as well. When your code is Quote:
While here Quote:
Yet I didn't find a way to mux another audiotrack to container when it already has two of them -_- Last edited by linkRed; 26th February 2012 at 05:43. |
||
26th February 2012, 14:41 | #8 | Link | |
Registered User
Join Date: Dec 2002
Posts: 5,565
|
Quote:
Code:
for %%a in (*.mkv) do ffmpeg -i "%%a" -i "%%~na.mp3" -vcodec copy -acodec copy -map 0:0 -map 1:0 -map 0:1 -map 0:2 "%%~na1.mkv" |
|
26th February 2012, 16:23 | #9 | Link | ||
Registered User
Join Date: Nov 2010
Posts: 12
|
Na-ah...
Quote:
Quote:
|
||
26th February 2012, 16:36 | #10 | Link |
Registered User
Join Date: Dec 2002
Posts: 5,565
|
Decoding time stamp, which should be increasing (or at least not decreasing, though some programs require increasing), so that all frames are in the chronologically correct order.
Can't help you with that. ffmpeg can be a PITA, that's why I use mkvmerge whenever possible. |
27th February 2012, 08:47 | #12 | Link |
brontosaurusrex
Join Date: Oct 2001
Posts: 2,392
|
@sneaker_ger, yeah, but all that assumes that 1st track is video, which is not always the case, so -map is pretty problematic for scripting use, one way or another.
__________________
certain other member Last edited by smok3; 27th February 2012 at 08:51. |
Tags |
bat, ffmpeg |
|
|