VideoHelp Forum
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. Member
    Join Date
    Jan 2010
    Location
    Brazil
    Search Comp PM
    Hello there.

    I have lots and lots of files with dual audio, and I want to keep just one audio. I'm trying to automate this process, but with no success.
    I know there is scripting language to VirtualDub and VirtualdubMod. And know that this is possible with .bat with mencoder and ffmpeg. And there is avi-mux gui and avidemux also...
    So far, I wasn't able to find a solution over the net. So I'm asking for help to anyone who knows about scripts or CLI.
    Quote Quote  
  2. what kind of files? which audio track do you want to keep? Are they always the same between video files? e.g. always track #0 and track #1 ? or is it sometimes a different number ?

    If they are different formats and specs, it's going to be difficult. If they are all the same file type , then it will be easier
    Quote Quote  
  3. Member
    Join Date
    Jan 2010
    Location
    Brazil
    Search Comp PM
    Always AVIs, XviD, most cases is to keep the audio track #0. 90% of cases is to keep track 0 (first audio).
    Quote Quote  
  4. 1) Download FFMpeg binary , put ffmpeg.exe in same directory as files to be remuxed
    http://ffmpeg.zeranoe.com/

    2) open a text file in notepad, in the same directory as the files, copy & paste the following , save it, rename the .txt extension to .bat

    Code:
    for %%a in ("*.avi") do ffmpeg -i %%a -map 0:0 -vcodec copy -map 0:1 -acodec copy %%~na.new.avi
    pause
    3) double click the .bat file

    This will copy the 1st video track, and 1st audio track into a new AVI, and it will have the same file name with "new" appended

    e.g.

    "input.avi" will generate a new file "input.new.avi" . Original file will not be overwritten
    Quote Quote  
  5. Member
    Join Date
    Jan 2010
    Location
    Brazil
    Search Comp PM
    In case with the second audio would be?
    Quote Quote  
  6. If it was the 2nd audio track to be retained, change the 2nd map statement to -map 0:2 instead of -map 0:1

    Code:
    for %%a in ("*.avi") do ffmpeg -i %%a -map 0:0 -vcodec copy -map 0:2 -acodec copy %%~na.new.avi 
    pause
    Quote Quote  
  7. Member
    Join Date
    Jan 2010
    Location
    Brazil
    Search Comp PM
    Ok, it's working. Save me a lot of time. So simple to you but its like gold to me. Thanks a lot. I'm gonna test in my dvd players if these are ok...

    You know a little about ffmpeg. Have another question for you.

    ffmpeg.exe -i "InputFile.aviORmkv" -f null - 2> report.txt
    report.txt

    i use this sometimes to test downloaded files for corruption. It's decodes the entire file without any image in screen. And if there are problems in the inputfile it will warn error codes. This command is correct or i'm missing something?
    Quote Quote  
  8. Not sure about that one , you might want to open up another thread maybe someone else knows (they might not look if you bury that question in this thread because the title is unrelated)
    Quote Quote  
  9. Member
    Join Date
    Jan 2010
    Location
    Brazil
    Search Comp PM
    Thanks again about the fast reply.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!