VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 4 of 4
  1. Member
    Join Date
    Sep 2009
    Iran, Islamic Republic of
    Search Comp PM
    How could I change the default audio stream in a Dual or Multi Audio AVI file?

    I own some .avi movie Files with the properties Like below

    Video: Xvid 720x296 25.00fps [Stream 00]
    Audio: Dolby AC3 48000Hz 6ch 448Kbps [Stream 01]
    Audio: Dolby AC3 48000Hz 5ch 448Kbps [Stream 02]

    The thing I Actually want to do is to have the second stream as [Stream 01] so it would be played by default in Media Player or MPC when opening ?

    is there any software which could do so ?
    Quote Quote  
  2. Try AVI-Mux gui , with the tracks loaded and audio track you want highlighted, you can right click the audio stream and select "default track"
    Quote Quote  
  3. Member
    Join Date
    Sep 2009
    Iran, Islamic Republic of
    Search Comp PM
    Thank you for the Suggestion, I take your advise do the job right as you said,
    for the first time both audio streams were selected as default I uncheck the first one as default, but after getting the output it was the same as input file again I do the whole job and this time I uncheck the first audio in addition of unchecking first stream default audio again it does not make any change to input file, please help if I should do anything I have n't done so far.
    Quote Quote  
  4. Hi,

    I was having the same problem and the above solution did not work for me. Furthermore, my situation was that I have hundreds of files sorted according to "seasons" which I wanted to process without much hassle. Unfortunately, programs such as handbrake do not allow for video passthrough while others, such as Avidemux only has limited support for a second audio track (which, in the case of Avidemux must come from an external file, not from within the video). "Standard" VirtualDub has no option to modify a second audio track, but finally I stumbled upon VirtualDubMod which is capable of doing the task I wanted. While not scriptable from command line, at least it offers plain text job files. To create customized job files, I wrote the script below in Perl. You can even use tinyperl to run it from within Windows without installing a large scale perl distribution.

    What the script does is that it browses through one (and just one!) level of subdirectories and adds all *.avi files to a job file called "". Simply load this file into VirtualDubMod's job processor and start the task. All files will be written to a respective subdirectory called "converted" with the same file name. Original files will be kept in place, so make sure you have enough disk space. Once you are satisfied with the results, you can move all files from the "converted" directory one level up, thereby replacing the old versions.

    Note that this program will always swap the first audio track with the second, so if you run the file again, you'll get back to the previous state. Also note that conversion will stall and not continue if there is only one audio track available. I also haven't checked the behaviour on three or more audio tracks (if that should be possible with AVIs).

    How to run the script:

    You need to have a directory structure like that:

    Put the in the directory "Name-of-Series" and run it with a perl interpreter, e.g.:
    \path\to\perl\tinyperl.exe .\ will output the names of the subdirectories it has processed and write the file in the current directory. As this file contains the full path names, you can put the jobs file wherever you like as long as you do not change the directory structure in which case you need to run the script again.
    Be reminded that the script expects the avi files in a subdirectory of the current directory, so if you have all files in the same directory, create a temporary subdirectory and move the avis there (such as ".\Name-of-Series\Temp"). Once the conversion is done, you can move the files to their original place.

    Another caveat are non-ASCII characters in file names or some characters not allowed in file names. I have included a limited conversion for German "Umlaute", but French, Spanish (and especially non-Latin-based languages) will have to do (a lot) of added conversion if the file names include or consist only of these characters. Batch processing will still continue, but VirtualDubMod will not process these specific files, marking them with an "Error" result code.

    Ok, enough talk, here's the code:

    use Cwd;
    open (JOBS, ">");
    opendir (PARENT, ".");
    @parentdir = readdir PARENT;
    foreach $parent (@parentdir) {
      if ((-x $parent) && ($parent ne "..") && ($parent ne ".")) {
        print "$parent\n";
        chdir ($parent);
        $dir = ".";
        mkdir ("./converted");
        $path = getcwd;
        $path =~ s/\//\\\\/g;
        opendir DIR, $dir;
        @dir = grep /.*\.avi/, readdir DIR;
        print JOBS <<ENDTEXT;
    // VirtualDub job list (Sylia script format)
    // This is a program generated file -- edit at your own risk.
        foreach $entry (@dir) {
          $entry =~ s//\\xc3\\x84/g;
          $entry =~ s//\\xc3\\xa4/g;
          $entry =~ s//\\xc3\\x96/g;
          $entry =~ s//\\xc3\\xb6/g;
          $entry =~ s//\\xc3\\x9c/g;
          $entry =~ s//\\xc3\\xbc/g;
          $entry =~ s//\\xc3\\x9f/g;
          $entry =~ s//\\xc3\\xa9/g;      
          $entry =~ s//\\xe2\\x80\\x99/g;
          print JOBS <<ENDTEXT;
    // \$job "Job $entry"
    // \$state 0
    // \$start_time 0 0
    // \$end_time 0 0
    // \$script
    // \$endjob
        chdir ("..");
    Hope this helps,

    Quote Quote  

Similar Threads