Software Category
DVD Authoring Software
DVD Converter Software
DVD Player Software
DVD Burning Software
iPod Software
DVD Copy Software
DVD Ripping Software
Other DVD Tools
Knowledge Base
DVD FAQ
DVD Articles
DVD Guides
DVD Tech Blog
Forum
Latest Posts
Hot Topics
DVD Resource
Home » DVD Guide >> Make Your Own Anime DVD Guide
  
Part 2. Extracting Video and Audio Streams

Overview

First, I'm going to assume you have either a MKV, OGM, or AVI file that you wish to encode to MPEG-2. These are the only formats I have experience with, so if you have formats other then these three you might be out of luck. The goal of this section is for you to have an AVI file ready for encoding, and an audio file ready for transcoding.

Read the section that corresponds to the file type of your source file (downloaded one).

Section 1 - Dealing with AVI files

AVI

For this type of file all you have to do is load the file up in VirtualDubMod, and extract the audio from the AVI file, and save the AVI file. To do this follow the instructions below:

  1. Load up VirtualDubMod
  2. File -> Open video File
  3. Streams -> Stream list
  4. Select the audio stream
  5. If the audio stream is a wav stream use Save Wav
  6. If the audio stream is not a wav stream use demux
  7. Give your audio file a name and hit save
  8. Now go to File Save as
  9. Choose a name for your AVI file, and hit save

If your extracted audio stream was an AC3 audio stream you will need to run ac3fix to fix the audio file.

To use ac3fix just make sure your AC3 audio stream file you extracted is in the same directory as the ac3fix.exe file. Once you have both of the files in the same directory just use the following syntax to fix your file.

ac3fix 19.ac3 19-complete.ac3

19.ac3 is my input ac3 audio stream (substitute this for the name of your ac3 stream). 19-complete.ac3 is the name of the fixed output file, so I can differentiate between the fixed file and the original.

You should now have an AVI file with no audio in it, ready for encoding. On top of this you should have a separate file containing the audio ready for transcoding.


Section 2 - Dealing with OGM and MKV files

OGM:

To convert an OGM file to AVI we will be using VirtualDubMod. Follow the steps below to covert your OGM to AVI.

  1. Load up Vdub
  2. Open up your OGM file
  3. Go to the streams menu, and select stream list
  4. Select the first audio stream
  5. If the audio stream is a wav stream use Save Wav
  6. If the audio stream is not a wav stream use demux
  7. Give your audio file a name and hit save
  8. Go to the video menu, and select direct stream copy
  9. File -> Save As...
  10. Give your file a name, and save it using the default AVI option
  11. Hit Save
If your file is extremely huge and takes a long time to save make sure you select direct stream copy in the video menu.

And thats all there is to converting OGM files to AVI. You should now have a separate video stream in AVI format, and an audio in some audio format. You are now ready to encode your video, and audio.

MKV

If your file is an MKV encode I strongly recommend you download mkvtoolnix, and get the GUI for it. For me Virtual Dub doesn't like MKV files, and trying to get Tmpgenc 2.5 plus to convert directly from MKV -> MPEG2 is like trying to fly, it just won't happen.

Once you have mkvtoolnix installed with the GUI your ready to start. This software kicks ass for extracting streams from MKV files, and in a minute I'll show you how to create a batch file to make it go even faster. First open your MKV file (browse button). Once the file is loaded select the audio and video tracks you wish to extract, (usually the first audio track is the English one) then where it says "output" choose a directory you want the extracted files to go.

Now you could load up each episode one by one, and extract the video and audio streams (The painfully slow way). On top of that you will keep overwriting the same file, because it refers to all files as track(x). So you would have to create a separate directory for each episode (Very painful way of doing things...).

So, how can we speed up this slow task, while also making it automated? By using batch files! Good old DOS is still very useful even to this day :) Now if you have never made a batch file before then shame on you :) Don't worry, all a batch file is, is a text file that contains commands saved in a .bat format.

To make this batch file work we must first rename our MKV files to something simple. It really sucks working with files that have such long names, so go to your downloaded mkv files and rename them all using this format.

  • 1.mkv
  • 2.mkv
  • 3.mkv
  • etc... until all your episodes are renamed.
Warning - When renaming files do not include the file extension in the name...

Now that you have renamed all your episodes open up notepad. Now minimize notepad, and load up mkvtools, and load up a file, and select the streams you want to extract. Now take your mouse and highlight all the text in the Tracks Commandline, copy, and paste it into notepad.

Now I am going to rename my track1.avi file 19.avi, and then I am going to rename my track2.aac 19.aac. This might make more sense when you see the big picture (screenshot below). The reason I am doing this is so I know which episode these two streams belong to. Since they are from episode 19 I renamed them accordingly.

Now assuming all your episodes are in the same directory we can create the whole batch list without using mkvtools anymore. Just copy and paste that one line for each episode you have, renaming each line.

Once you have finished your batch file save it using the following steps

  1. File -> Save as
  2. Under the Save as type box select All Files
  3. Choose a name for your file, and add a .bat to the end of it
  4. Save the batch file in the same directory as mkvextract.exe, or it won't work
  5. Click Save

Thats it! Now double-click your batch file, and watch it do it's magic :). After a few minutes you should now have a separate video and audio file for each episode ready for encoding, and transcoding. If you had difficulty understanding the batch file refer to the example below for additional help.


If your a bit confused by the big lines of text i'll break it down for you. The first part refers to the directory where my downloaded files are, and includes the name of the file.

mkvextract tracks D:\TORRENTS\_AX__N~1\19.mkv

The next part refers to the first track in the mkv container. This happens to be the video track. Notice how it starts with 1: this denotes it as the first track.

1:19.avi

The next part refers to the second track which contains audio. Notice how this starts with a 2: this denotes it as the second track

2:19.aac

And thats all there is to it. Just a quick tip. Sometimes a track is put out of order. Instead of the tracklist looking like 1,2,3,4 it's 1,3,2,4 or something weird like that. Before you encode your audio, and video run it to see if it works, and if the audio is in the right language.

>> Part 3. Video Encoding with TMPGenc 2.5 plus

Google
 
Web www.dvd-software.info

Contact | Site Map | Privacy Policy | Resource more
Copyright ©2004 DVD-Software.info