Docstoc

daemon tools lite

Document Sample
daemon tools lite Powered By Docstoc
					Hi-Def Encoding with TMPGEnc Xpress 4
(Blu-ray/MKV->WVC1)




Written by Chris Lynch (chris[dot]lynch[dot]hp{at}gmail{dot}com)

Version 1.1.20080219




                                                                   Page | 1
Table of Contents
Revision History ....................................................................................................................................... 3
Section 1 The Ground Rules ..................................................................................................................... 4
Section 2 Preparation .............................................................................................................................. 6
   Section 2.1 CoreAVC Configuration ...................................................................................................... 6
   Section 2.2 AC3filter Configuration ...................................................................................................... 7
Section 3 Let the encoding begin! (MKV Source) ...................................................................................... 9
   Section 3.1 I’m the boss; Need the Info. ............................................................................................ 10
   Section 3.2 Break out the MKV! ......................................................................................................... 11
   Section 3.3 Engage Number One!....................................................................................................... 13
Section 4 Let the encoding begin! (Blu-ray Source) ***NOT COMPLETE ................................................. 20
   Section 4.1 BD+ Encrypted Source to WMV ........................................................................................ 20
   Section 4.2 Non-BD+ Encrypted Source to WMV ................................................................................ 20
Appendix A ffdshow-tryouts Installation and Config .............................................................................. 23
Appendix B Encoding with subtitles ....................................................................................................... 31
Appendix C To CBR or VBR: That is the question.................................................................................... 36
   Constant Bit Rate ............................................................................................................................... 36
   Peak Limited VBR ............................................................................................................................... 37
   So which do I choose again?............................................................................................................... 37
Appendix D Table of Figures................................................................................................................... 38
   Tables ................................................................................................................................................ 38
   Images ............................................................................................................................................... 38




                                                                                                                                                Page | 2
Revision History
Version                    Change Log
1.0.20080129               First release.
1.0.20080130.2             Added Subtitle section (Appendix C) (NOT COMPLETE YET); Updated Page
                           13 with more info on Avg/Peak Bitrate
1.0.20080131               Added Appendix D
1.0.20080211               Added Appendix B Encoding with subtitles; Added Appendix C CBR vs VBR
1.0.20080218               Updated Appendix A for ffdshow install with H.264/x264/AVC support
1.1.20080219               Major update. Expanded encoding process to include extracting x264
                           stream, and muxing into MP4 container before encoding.
1.1.20080221               Updated Appendix B to use Subtitle Workshop and TMPGEnc’s Subtitles
                           filter




Acknowledgments:

I want to thank impimpin206 on the Xbox-scene.com forums. He originally wrote a tutorial on how to
use TMPGEnc to convert Matroska files to WVC1 format.

I want to thank thelelander on the Xbox-scene.com forums. He pointed me to Subtitle Workshop, which
converts various subtitle formats to other formats.




                                                                                            Page | 3
Welcome to my guide. I will walk you through a simple process to produce HD content to stream to
your Xbox 360. I will first outline some key items regarding what Microsoft supports streaming to the
Xbox 360, playing via a local HD and DVD. I will then go into detail on how to prepare your system to
encode WVC1 video.

The encoding process to convert MKV sources to wonderful WMV-HD, is not a simple one step shot
process. Rather, you will need some tools, and you will get your hands dirty (so to speak.) It is a much
easier process then others I have seen out there, and is the best when using TMPGEnc as your encoding
tool.

Please note that I assume that you have some fairly basic knowledge around computers and networking
in general. I will not cover these points, nor go into detail. If you do not, Google and Xbox Live Support
are your friends.


Section 1 The Ground Rules
For those that are un-aware or simply do not know, Microsoft has a basic and strict video and audio
codec support for the Xbox 360. The following outlines this as of the Fall 2007 Firmware release1:

File Extensions     Containers       Video Profiles         Video Bitrate    Audio Profiles     Audio Bitrate
MPEG-4 Part2:       MPEG-4,          Simple & Advanced      5 Mbps with      2 channel AAC      No restrictions.
.mp4, .m4v,         QuickTime        Simple Profile         resolutions of   low complexity
.mp4v, .mov                                                 1280 x 720 at    (LC)
                                                            30fps.
AVI: .avi, .divx    AVI              MPEG-4 Part 2,         5 Mbps with      Dolby® Digital 2   No restrictions.
                                     Simple & Advanced      resolutions of   channel and 5.1
                                     Simple Profile         1280 x 720 at    channel, MP3
                                                            30fps.
H.264: .mp4,        MPEG-4,          Baseline, main, and    10 Mbps with     2 channel AAC      No restrictions.
.m4v, mp4v,         QuickTime        high (up to Level      resolutions of   low complexity
.mov                                 4.1) profiles.         1920 x 1080 at   (LC)
                                                            30fps.
WMV (VC-1):         asf              WMV7 (WMV1),           15 Mbps with     WMA7/8, WMA        No restrictions.
.wmv                                 WMV8 (WMV2),           resolutions of   10 Pro (stereo
                                     WMV9 (WMV3), VC-       1920 x 1080 at   and 5.1), WMA 9
                                     1 (WVC1 or WMVA)       30fps.           lossless
                                     in simple, main, and
                                     advanced up to
                                     Level 3
Table 1. Supported Codec's and Containers

Scenario                                               Supported Codecs
From USB storage to Xbox 360 Dashboard Player          WMV(Unprotected), Mpeg4, H.264, AVI
From WMP 11 to Xbox 360 Dashboard Player               WMV(Protected), WMV(Unprotected), Mpeg42, H.2642, AVI
From Zune Software to Xbox 360 Dashboard Player        WMV(Unprotected), Mpeg4, H.264



1
    http://blogs.msdn.com/xboxteam/archive/2007/11/30/december-2007-video-playback-faq.aspx
2
    http://blogs.msdn.com/xboxteam/archive/2007/11/30/december-2007-video-playback-faq.aspx, Question 32
                                                                                                        Page | 4
From Windows Home Server to Xbox 360 Dashboard           WMV(Protected), WMV(Unprotected), AVI
Player
From Windows Media Center to Xbox Media Center           WMV(Protected), WMV(Unprotected), Mpeg2
Extender
Table 2. Location where the source can be played from

Question 5 in the FAQ asks:

      Can I mix and match the video and audio codec’s outside of those defined in questions 1 through 4
      above?

The answer is no. Microsoft does not allow mixing different audio and video streams (or Audiences to
those that are more familiar with the Windows Media Encoder SDK) into difference containers. In the
case of ASF (Microsoft’s container format), or more commonly known as WMV, the Xbox 360 only
supports the outlined codec’s in Table 1.

For the purpose of this tutorial, we will only be using WMV9 AP and WMA10 Professional. We will not
use, nor cover the differences between other Windows Media codec’s. However, WMV9 AP (WVC1) is
Microsoft’s implementation of the VC-1 codec. Do not get this confused with H.264, or MPEG-4 Part 10.
They are two different codec’s.

Now armed with the above knowledge, you may still ask how is the best way to present my wonderful
HD digital content to my Xbox 360? This question isn’t so easily answered. There are numerous
answers to this question. Use the following table as a guide, as each will present their own pros and
cons.

Connectivity           Pros                                           Cons
Wired (Best)           Provides the best connectivity possible. No    Well, running the cable if your home is not
                       interference with other wireless networks.     already pre-wired.
                       Low latency, and lots of bandwidth.
802.11n (Better)       Provides more bandwidth than wired             Still in Draft format. However, the Draft
                       Ethernet (max 130Mbps.) Operates in the        should become standard this year. No
                       same 5Ghz range as 802.11a. Low latency.       guarantees though. Expensive. D-Link DAL-
                       The replacement to 802.11a and 802.11g, as     1555 ($399 for two) and Netgear ($199 for
                                                                           3
                       it combines the benefits of both, while        two ) make HD Media Bridges.
                       incorporating MIMO technology.
802.11a (Good)         Can provide enough bandwidth for 720p          Bandwidth can become a concern. Limited
                       content. Operates in the 5Ghz range.           range/distance. Not enough bandwidth for
                       Numerous channels for operation. Low           1080p content.
                       latency.
802.11g (OK)           Can provide enough bandwidth for 720p          Operates in the 2.4Ghz range. Limited
                       content. The most common wireless              number of channels. Channel overlap will
                       protocol out there.                            occur, and can introduce a bouncing wireless
                                                                      network. Not enough bandwidth for 1080p
                                                                      content. HIGH LATENCY
Table 3. Connectivity options




3
    I have not tested the Netgear HD Bridge. I have the D-Link products (DAL-1555) and they work great.
                                                                                                           Page | 5
Section 2 Preparation
Just as a warning, I will not cover, nor support codec packs. These include, but are not limited to:

    •   CCCP
    •   Vista Codec Pack
    •   XP Codec Pack
    •   K-Lite Codec Pack

I have used codec packs in the past, and have found they are not beneficial by any means. You are
better off downloading the basic codec’s you need, or require for video and/or audio playback. I
strongly advise you remove any existing codec packs before continuing with this guide.

The following will be used for the purpose of this tutorial4:

    •   Haali Media Splitter
    •   CoreCodec CoreAVC Standard or Professional or ffdshow-tryouts5|mirror (ffdshow fix|mirror)
    •   AC3Filter
    •   MediaInfo
    •   My Format Templates (Mirror)
    •   Tsremux
    •   MKVtoolnix and MKVExtractGUI
    •   YAMB (Yet Another MP4Box UI)
    •   Slysoft AnyDVD HD6
    •   Your favorite ISO mounting tool. I suggest Daemon-tools Lite6.

    NOTE: The CoreAVC installer includes the Haali Media Splitter. However, it is an older version. Do
    not install it when you install CoreAVC.

If you are having problems installing codec’s, or using them, I highly recommend K-Lite Codec Tweak
Tool and CCleaner. I will not cover these utilities in this tutorial. They are quite simple to use.

Once you have installed Haali Media Splitter, CoreAVC, and AC3filter, you will need to configure them.

Section 2.1 CoreAVC Configuration
Open Configure CoreAVC from the Start Menu. Compare the settings to the image below.




4
  I am running Windows Vista Home Premium 32-bit. As of this writing, I am not using the RC-1 build of Vista SP1.
5
  Go to Appendix A to know how to install ffdshow-tryouts as an alternate codec for H.264/x264/AVC sources.
6
  Required if source is BD+ encrypted Blu-ray ISO.
                                                                                                         Page | 6
Image 1. CoreAVC Settings

Section 2.2 AC3filter Configuration
Next, we need to configure AC3filter. Launch AC3filter Config from the Start Menu. On the Main tab,
you will need to change the Output Format to 3/2+SW 5.1 Channels and PCM 24bit. This will maintain
the 5.1 surround sound that is contained in the source.




Image 2. AC3filter Main Tab settings

Now, click on the System tab. Here, we need to make sure that AC3filter is configured to be the filter to
decode not only AC3, but DTS as well.




                                                                                                 Page | 7
         NOTE: If you are using this tutorial to rip HD-DVD or Blu-ray sources, AC3filter does not support
         DTS-HD or Dolby TrueHD. You will lose the audio quality that these two new HD audio codec’s
         can provide. Currently, only Nero and Sonic provide DirectShow filter audio codec’s to decode
         the above mentioned audio streams, and are not covered in this tutorial. However, you can use
         TsRemux v0.20 or greater to extract the AC3 or DTS core audio, which AC3filter will decode,
         from these newer audio streams. I cover this later in the tutorial.




Image 3. AC3filter System Tab settings

The final item we need to verify is that the Prefetch feature of TMPGEnc is enabled. In the main
window, select Options -> Preferences -> Multithread settings. Verify that Use multithread for filtering,
Prefetch video and Prefetch audio are enabled.




                                                                                                  Page | 8
Image 4. Setting Prefetch Video and Audio Cache

We also need to disable the internal MPEG-2 decoder within TMPGEnc. In the TMPGEnc Preferences
window, navigate the tree to File input plug-in. Disable the MPEG file reader option. Click OK to save.




Image 5. Disable TMPGEnc MPEG decoding



Section 3 Let the encoding begin! (MKV Source)
Ok, enough of the technology lesson. Let’s start encoding. I am warning, you. You need twice the disk
space temporarily. And, if you have a lot of video to encode, I would highly suggest you save each
project, and add them to the TMGPEnc Batch tool.



                                                                                                 Page | 9
Section 3.1 I’m the boss; Need the Info.
Before we can begin encoding, we need to examine the source to figure out a few things. Use
MediaInfo, and open your source file. In the example below, I have opened a Matroska file in order to
view all of the audio and video streams.




Image 6. MediaInfo application

As you can see, MediaInfo shows us all of the available streams inside the container. The most
important streams to us are the Video and Audio streams. The Text streams are subtitles. You can use
mkvextract to extract the subtitles, if you want to burn them into the output video.

You will notice that Video #0 contains an MPEG-4 AVC stream. This is the x264 encoded video, which
will be decoded with CoreAVC or ffdshow. You will also notice the playtime, resolution, aspect ratio,
and frame rate. The Audio #0 stream shows us that the stream is 6-channel DTS. AC3filter will be used
to decode this stream. If your MKV file contains multiple audio streams, it’s most likely other audio
languages. Audio #0 is typically English.

However, if you wish an alternate Audio stream to be encoded with your video, then you only have two
options: use Haali Media Splitter to load the audio stream by the language ID, or remux the source into
a new container with only the audio and video streams you want. To use Haali Media Splitter, open
Haali Media Splitter in the Start Menu, select the Options tab, expand Languages, select Audio Language
Priority, and type in the 3-letter ID for the language you want. For example, if you wanted German, use
“ger” as the language ID.




                                                                                              Page | 10
Image 7. Haali Media Splitter Properties, setting language ID.

The General #0 stream contains container information. You will notice the bit rate is 14Mbps. With the
Audio #0 stream being DTS (which is almost always 1.5Mbps), you can figure out that the Video #0
stream was encoded at ~12Mbps bit rate. Your output should be as close to this value as possible.

You may want to burn your WMV file to DVD5 or DVD9 media. You can use a bit rate calculator to figure
out what bit rate you should encode at. Doom9.org zambelli’s online WMV Bit Rate Calculator7 is an
excellent place to get this value. Or, you can use the built-in TMPGEnc’s calculator.

Section 3.2 Break out the MKV!
In order to eliminate the video stuttering and glitch issues people have reported, we will extract the
x264 video stream and mux it into an MP4 container. However, TMPGEnc doesn’t handle MP4 files in
the “right way.” TMPGEnc does handle MOV containers just fine.

Begin by opening MKVextractGUI, which should be located in c:\Program Files\mkvtoolnix. Click the …
button, and browse for the MKV source. Once selected, you should now see a list of “tracks” in the
Content window. Select the video track ID, then the Extract button. The tool will extract the raw video
stream to the MKV source location. If prompted for a file extension, use .h264.




7
    http://www.citizeninsomniac.com/WMV/WMVBitCalc.html

                                                                                               Page | 11
Image 8. MKVExtractGUI to extract video stream

Next, we need to put the extracted raw x264 video into an MP4 container. Open YAMB, and select
Creation then Click to create an MP4 file, as shown in Image 8.




Image 9. YAMB Select Task

You can either drag-and-drop the source h264 into YAMB, or click the Add button to browse for it. Once
the source is added, click on the Properties button.




                                                                                             Page | 12
Image 10. YAMB MP4 File Creation

The important setting we need to change/add in the Track properties window is the Frame-Rate. This
should match the source, which should always be 23.976.




Image 11. YAMB Change Track Properties

Click OK to save the source properties. Do not forget to change the Output filename to .MOV instead of
.MP4, as shown in Image 9. Click the Next button to create the new source. Once complete, you can
delete the extracted h264 file, as we have no further use for it.

        NOTE: You cannot open the file into Media Player Classic to verify playback. If you want to view
        the result in MPC, you should rename the file from MOV back to MP4. Just remember to
        rename the extension back to MOV before adding to TMPGEnc.

Section 3.3 Engage Number One!
Begin by opening TMPGEnc 4.0 Xpress. Click on the Start a new project or Source button.

                                                                                              Page | 13
Image 12. TMPGEnc begin new project

You can click on the Add file button or simply drag-and-drop the source into the Source window.




Image 13. TMPGEnc setting source

If you clicked on the Add file button, you will need to change the Files of type drop-down list to All Files
(*.*) in order to locate your source MOV file in the File Open dialog box.




                                                                                                   Page | 14
Image 14. TMPGEnc change files of type view

Once the file has loaded into TMPGEnc, the Clip editing window will appear. You will need to verify that
the Aspect Ratio is set to Pixel 1:1 (Square pixel) and Framerate is 23.976 (or whatever the source
framerate actually is.) We will use the original MKV as the audio source. Click the Browse button in the
Audio section, and locate the original MKV. You will be prompted that the audio source has changed,
and all video edits need to be reset; select Yes. Note that the source format for video and audio should
show DirectShow file reader. The audio is very important, and should show 5.1 ch as shown in the image
below.




Image 15. TMPGEnc change source FPS

Next, click on the Cut-Edit button. This will allow you to make edits to your source. Some content that
you can acquire is ripped from on-demand presentations. They may contain frames that you do not
want to encode in the beginning. You can cut and remove these frames if you want. However, the main
purpose for using this feature is to create a small sample. I strongly suggest you create one, to make
sure that audio and video are in sync before you waste 10+ hours of encode time. I normally create a
small 1 minute sample.

Begin by clicking the button labeled 1, as shown in Image 16, which sets the beginning marker. Adjust
the slider, labeled 2, to move ahead the amount of time you want to encode. Click the button labeled 3
to set the end marker. Then, click OK.


                                                                                              Page | 15
Image 16. TMPGEnc create small clip

If you want to press the Play button to view the source video before clicking OK, I would suggest
disabling the Audio Waveform and Thumbnail panes. Right-click in the video screen, make sure that
Display audio waveform and then Thumbnail display settings -> Display thumbnail are not checked.




Image 17. TMPGEnc disable thumbnail view

If the source happens to be interlaced video, then you should change the default Interlace Filter setting;
click on the Filters tab. The first filter in the list should be Deinterlace. Change the Deinterlace method
to Inverse pulldown (reinforced anti-stripes.) This produces the best output to progressive format than
the other algorithms.

Once your source has been set, click the Format button. Note the source resolution.




                                                                                                  Page | 16
Image 18. TMPGEnc note source resolution

After you click on the Format button, the Output format selection window will appear. Click on the
Browse button, and navigate to the TMPGEnc Format Templates I have provided. Remember that the
templates provided are specific to 720p and 1080p content. You would not select the 1080p template if
the source is 720p.




Image 19. TMPGEnc specify format template

Once the template has been loaded, you will need to change the vertical resolution (#1) and Average
bitrate (2.) The average should match the source bitrate as close as possible. You can use TMPGEnc’s
built-in bitrate calculator, if you want to produce a smaller sized video (i.e. DVD5.) The video codec we
are using is WMV 9 Advanced Profile, or otherwise known as VC-1 (or WVC1 for the FourCC.) Please go
to Appendix C if you want to learn more about CBR vs. VBR encoding.


                                                                                                Page | 17
Image 20. TMPGEnc set output format

Clicking on the Audio tab will provide you the ability to change the codec format. By default, we are
using WMA 10 Professional (which is a lossy codec, but one you will not be able to notice from the
source), at 768kbps. You can change this value if you want. I would not recommend going below
440kbps, as you will then lose audio quality.




Image 21. TMPGEnc set output audio

                                                                                                Page | 18
I would recommend saving the project so you can use the batch tool.




Image 22. TMPGEnc save as a project

Once you have encoded a sample, go back to the Source, and click the Edit button. You will need to
remove the marker edits you made earlier. Click the button labeled 5, and select Reset Range Selection.




Image 23. TMPGEnc remove cut-edit markers




                                                                                              Page | 19
Section 4 Let the encoding begin! (Blu-ray Source) ***NOT COMPLETE
Before we get into the process, let me take a few moments to go over the Blu-ray file system structure.
You will find in Image 24, the file system outline from “Application Definition Blu-ray Disc Format”8
public whitepaper.




Image 24. Blu-ray disk file system structure

The directory we really care about is <root>\BDMV\Stream. This directory contains the m2ts AV
streams. The file naming convention is supposed to be cryptic, and cannot be deciphered easily. We
will simply need to play a guessing game at this point.

Section 4.1 BD+ Encrypted Source to WMV
As studios release Blu-ray media, they are protected not only with AACS (to prevent physical disk
copying,) but BD+; a requirement for Blu-ray Profile 1.1 and 2.0. A future release of Slysoft AnyDVD HD
will provide the ability to remove the BD+ encryption, so you can perform a backup of your media, or rip
it to ASF format. Until then, you will not be able to encode from BD+ encrypted sources.

Section 4.2 Non-BD+ Encrypted Source to WMV
If you have an ISO of your Blu-ray source, you should mount it with Daemon Tools. Open Windows
Explorer, and browse to the root of the Blu-ray source. As you can see in Image 25, I have sorted
<root>\BDMV\Stream by file size. The largest file should be the source video we want to encode. The
remaining files should simply be the additional content the Blu-ray disk contains.



8
 http://www.bluraydisc.com/assets/downloadablefile/bdj_gem_application_definition_050307-13404.pdf, Page
15
                                                                                                Page | 20
Image 25. Locating Blu-ray source in file system

However, there are some older Blu-ray disks on the market (prior to Blu-ray changing to AVC/H.264
codec instead of the older MPEG-2 codec) where the source video is split into different M2TS files (i.e.
Finding Neverland.) If that is the case, you will need to open each with either Windows Media Player, or
Media Player Classic. Once you found them, you will need to use the Windows Command Prompt copy
tool to combine the split m2ts files together.

         Example: copy /b “00001.m2ts+00000.m2ts+00005.m2ts” “movie.m2ts”

After they have been combined, you will need to use TsRemux to create a fixed m2ts container.




Image 26. Using TsRemux
                                                                                              Page | 21
TsRemux is a very simple tool to use. Simply select the video stream, and the audio stream you want to
keep, ignoring the Presentation Graphics streams. If the detected audio streams are TrueHD or DTS-HD,
TsRemux will extract the core audio (AC3 or DTS) for you when you select the Blu-Ray TrueHD to
AC3/DTS HD to DTS option. Leave the Bypass Audio Alignment and Use async I/O as defaults (which
should be selected.) Under the Output Format section, there is a Blu-Ray option. Do not select this,
even if the source is from a Blu-ray disk. Finally, click the Browse button next to the Output File field,
and then select the Remux button. Sit back, and wait for it to complete.

You now have a corrected m2ts source.




Image 27. Using MediaInfo to view audio and video streams

Now, simply use the m2ts as the video and audio source in TMPGEnc, and follow the steps outlined in
Section 3.3.




                                                                                                Page | 22
Appendix A ffdshow-tryouts Installation and Config
This section will walk you through the installation of ffdshow-tryouts, for those that do not want to use
CoreAVC to decode H.264/x264/AVC video. These steps could also be used to install ffdshow to decode
MPEG-2 video in certain Blu-ray sources. The encoding steps outlined in the main section of this tutorial
do not change.




Image 28. ffdshow welcome screen




Image 29. ffdshow installation directory.




                                                                                               Page | 23
Image 30. ffdshow component installation.




Image 31. ffdshow Start Menu location




                                            Page | 24
Image 32. ffdshow codec support

         NOTE: If you are using CoreAVC for H.264/x264/AVC decoding, then do not select H.264/AVC
         shown in Image 31 above.




Image 33. ffdshow codec support, continued.




                                                                                          Page | 25
Image 34. ffdshow codec support, continued.




Image 35. ffdshow codec support, continued. Disable AC3 and DTS support.

Using the above installation selections, you will not overwrite AC3filter or CoreAVC from decoding
AC3/DTS audio and H.264/x264/AVC video.




                                                                                               Page | 26
Image 36. ffdshow codec support, continued.




Image 37. ffdshow codec support, continued.




                                              Page | 27
Image 38. ffdshow video compatibility management.




Image 39. ffdshow audio compatibility management.




                                                    Page | 28
Image 40. ffdshow speaker setup.




Image 41. ffdshow installation summary.

After ffdshow is installed, we need to import a registry file to “fix” ffdshow. This will help eliminate
video stuttering and glitches within TMPGEnc. Extract ffdshow.reg from the ZIP file. Then, double-click
on it. You will be presented with a dialog box confirming the import action. Select Yes.

I currently do not know what “fixes” address this issue with TMPGEnc. There are too many differences
between the registry settings that this import contains, versus a default ffdshow installation.




                                                                                               Page | 29
Image 42. Importing ffdshow registry configuration.




                                                      Page | 30
Appendix B Encoding with subtitles
Software you will need:

       •   MKVtoolnix
       •   MKVExtractGUI
       •   MediaInfo
       •   TMPGEnc v4.4.2.3289
       •   Subtitle Workshop (Custom Format Template|Mirror)

Download and install MKVtoolnix to the default location (“C:\Program Files\MKVtoolnix”.) Then, extract
the contents of MKVExtractGUI to the same folder location. If you have not downloaded and installed
MediaInfo, now would be a great time to.

Begin by opening MediaInfo. Then, open your MKV file. Take note of the different Text streams. These
will be the subtitles. Note the stream number (in the case of English, it’s Text #3 in the image below)
that corrisponds to the Language you want.




Image 43. Using MediaInfo to locate subtitles




9
    This version resolves subtitle playback issues.
                                                                                              Page | 31
Next, we will need to open the source MKV with MKVExtractGUI. Launch the application, and open your
source MKV.




Image 44. Extract subtitles from MKV source with MKVExtract GUI

Once open, you will notice the different streams we saw in MediaInfo (minus the General stream.)
Track ID 6 is the stream/track we want to extract. It is the 4th text stream/track in the list. Leave the
output as default, which should be Source. Press the Extract button, and the tool will extract the
subtitles for you.




Image 45. Extract subtitles from MKV source with MKVExtract GUI, continued
                                                                                                   Page | 32
Now that we have the subtitles (.SRT) extracted, we need to convert them to a format TMPGEnc can
import. TMPGEnc does not import properly formatted SRT subtitles. We will use Subtitle Workshop to
convert them. Begin by launching Subtitle Workshop. In the main window, load the extracted subtitles
file, as show in Image 46.




Image 46. Subtitle Workshop loaded SRT source.

Next, click on File -> Save As, then click the Custom format button. This will bring up the Custom
Formats window, as show in Image 47. Select the Load Project button, and browse to the TMPGEnc
Subtitles.cfp file. Select the Save! button, and specify the file name to save as.




Image 47. Subtitle Workshop save as custom format

Now, go back into the TMPGEnc editor. Go to the “Source” tab, and select “Edit.”




                                                                                             Page | 33
Image 48. TMPGEnc Edit Source

This will launch the Clip editing window. From here, click on the Filters button. We need to add the
Subtitles filter to the list, as it is not a default filter. Click the Edit filter list button, locate the Subtitles
filter, and click the Add button. Once the filter is added, click OK to save the list.




Image 49. TMPGEnc Add Subtitles Filter




                                                                                                             Page | 34
Next, enable the Subtitles filter, select the Edit Menu button, and select Import subtitles. Browse for the
subtitles file.




Image 50. TPMGEnc enable subtitles filter and import subtitles

Once you have imported the subtitles, I would suggest pressing the Play button to verify the subtitles
are in sync with the source.




Image 51. TMPGEnc imported subtitles




                                                                                                 Page | 35
Appendix C To CBR or VBR: That is the question
So, the question everyone asks: “Which should I use: CBR or VBR?”

The answer is: That all depends on how much time you have in relation to how good of an encode you
want. As you can see in Table 4, there are different methods to use for encoding, each with their pros
and cons.

Encode Method                 Description                Pro                           Con
Single Pass CBR               Constant size for each     Good final size prediction;   Highest variability for
                              frame                      Quick encodes; better for     quality
                                                         high latency wireless
                                                         networks
Single Pass ABR               Constant size for each     Good final size; Quick        High variability for quality
                              group of                   encodes
                              frames/pictures
Single Pass VBR               Constant quality for       High overall quality          Bad final size prediction
(Unconstrained VBR)           each frame
Quality-based VBR             Each frame gets the        Best overall quality          Worst final size prediction
                              “right” amount of bits.
N Pass VBR/Peak VBR           Constant quality for       Best overall quality and      Slowest encoding duration
(Constrained VBR)/ABR         each frame and             best final size prediction
                              constant size for global
                              size or frame group
Table 4. Encoding type summarization

Constant Bit Rate
Constant bit rate (CBR) encoding is required for real-time streaming. It produces a file that has an
average bit rate that does not exceed the buffer duration. So, with a 1000 kilobits per second (Kbps) file
with a five-second buffer, any arbitrary five seconds from the file will have a bit rate of 1000 Kbps or
less. Not only is CBR required for streaming, it is also the best choice when the decode speed, rather
than the file size, is the limiting factor.

CBR supports both one-pass and two-pass encoding. For Web data rates, if at all possible, use two-pass
encoding. This lets the codec have a complete measurement of all the frames in the file, enabling it to
provide optimal distribution of bits.

For the purposes of HD, however, use one-pass CBR. A one-pass CBR encode estimates how the video
will change in the future, and sometimes that estimate is wrong. With the high data rates of HD, the
estimate that one-pass CBR gives is actually better than two-pass CBR with today's Windows Media
Video 9 codec. However, future Microsoft codec’s will support other modes as well.

While CBR is a necessity for real-time streaming, real-time streaming is in its early days for HD. Most HD
content is still being distributed and played as downloaded files. These files play back fine using CBR, but
CBR is less compression-efficient than other methods for file-based playback, because the data rate for
the easy portions of the video “sections with very little movement or change in the picture” ends up
being a higher data rate than necessary. However, since CBR doesn't have peaks of higher data rates,
like variable bit rate (VBR) does, it is still more efficient for playback. For example, a computer can play


                                                                                                         Page | 36
back a CBR file with a higher average data rate more efficiently than it can playback a VBR file at the
same data rate.

Peak Limited VBR
There are three different variable bit rate (VBR) modes in the Windows Media Encoder, but
theoretically, only peak bit rate-based VBR is appropriate for HD encoding. However, the current
implementation has some limitations for HD.

The basic VBR mode is the "unconstrained" mode called bit rate-based VBR. With this mode, only an
average bit rate is specified. The number of bits of each frame will be proportional to how difficult it is
to encode. If the complexity is very constant, the bit rate will also be very constant. If the content is
highly variable, the bit rate will be more variable. This is a drawback to unconstrained VBR because it
can produce very high peak bit rates that can overwhelm the decoding process, leading to dropped
frames.

For HD content, where playback performance is the paramount concern, the optimum file-based
encoding scheme is CBR. However, in cases where both playback performance and file size are both of
concern, Constrained VBR is an option. This is like unconstrained VBR, but with the buffer limitation
options of CBR. Thus, an average bit rate is specified as well as a peak bit rate, defined as a maximum bit
rate and duration. For example, a file can be encoded with an average bit rate of 5000Kbps, with a peak
bit rate of 5 seconds of 9000Kbps. That file would play wherever a CBR file at 9000Kbps and a 5 second
buffer would play, but the file would be as large as a CBR file at 5000Kbps.

The other VBR mode is quality-based VBR. Unlike the other modes, a quality value is specified instead of
a bit rate. The encoder gives each frame as many or as few bits as it needs to meet the quality target.
Because quality-based VBR does not have any peak constraints, it is not appropriate for HD delivery
because it generally isn't capable of real-time playback.

So which do I choose again?
You will have to play around with the different encode types, and judge a small encode sample to
determine which is best for you and your setup. I cannot tell you which you should choose. I can only
recommend 2-Pass Peak VBR. The Peak value will be arbitrary. However, I would add 5000Kbps to the
Average bitrate you choose (either based on the file size calculator or taking the source bitrate) for no
more than 10000 milliseconds (the Maximum Buffer Duration setting on the Format section in
TMPGEnc.)

Keep in mind that for those that have a wireless network that is not 802.11n, Single Pass CBR would be
the best selection for you. The potential bitrate variation with Peak VBR will simply be too demanding
for anything slower than wired Ethernet or 802.11n networks.




                                                                                                   Page | 37
Appendix D Table of Figures

Tables
Table 1.    Supported Codec's and Containers ............................................................................................ 4
Table 2.    Location where the source can be played from .......................................................................... 5
Table 3.    Connectivity options .................................................................................................................. 5
Table 4.    Encoding type summarization .................................................................................................. 36

Images
Image 1. CoreAVC Settings ...................................................................................................................... 7
Image 2. AC3filter Main Tab settings ....................................................................................................... 7
Image 3. AC3filter System Tab settings.................................................................................................... 8
Image 4. Setting Prefetch Video and Audio Cache ................................................................................... 9
Image 5. Disable TMPGEnc MPEG decoding ............................................................................................ 9
Image 6. MediaInfo application............................................................................................................. 10
Image 7. Haali Media Splitter Properties, setting language ID................................................................ 11
Image 8. MKVExtractGUI to extract video stream.................................................................................. 12
Image 9. YAMB Select Task ................................................................................................................... 12
Image 10. YAMB MP4 File Creation ....................................................................................................... 13
Image 11. YAMB Change Track Properties ............................................................................................. 13
Image 12. TMPGEnc begin new project ................................................................................................. 14
Image 13. TMPGEnc setting source ....................................................................................................... 14
Image 14. TMPGEnc change files of type view ....................................................................................... 15
Image 15. TMPGEnc change source FPS ................................................................................................ 15
Image 16. TMPGEnc create small clip .................................................................................................... 16
Image 17. TMPGEnc disable thumbnail view ......................................................................................... 16
Image 18. TMPGEnc note source resolution .......................................................................................... 17
Image 19. TMPGEnc specify format template ........................................................................................ 17
Image 20. TMPGEnc set output format ................................................................................................. 18
Image 21. TMPGEnc set output audio ................................................................................................... 18
Image 22. TMPGEnc save as a project ................................................................................................... 19
Image 23. TMPGEnc remove cut-edit markers....................................................................................... 19
Image 24. Blu-ray disk file system structure .......................................................................................... 20
Image 25. Locating Blu-ray source in file system ................................................................................... 21
Image 26. Using TsRemux ..................................................................................................................... 21
Image 27. Using MediaInfo to view audio and video streams ................................................................ 22
Image 28. ffdshow welcome screen ...................................................................................................... 23
Image 29. ffdshow installation directory. .............................................................................................. 23
Image 30. ffdshow component installation. .......................................................................................... 24
Image 31. ffdshow Start Menu location ................................................................................................ 24
Image 32. ffdshow codec support ......................................................................................................... 25
Image 33. ffdshow codec support, continued. ....................................................................................... 25
Image 34. ffdshow codec support, continued. ....................................................................................... 26
Image 35. ffdshow codec support, continued. Disable AC3 and DTS support. ....................................... 26
                                                                                                                                   Page | 38
Image 36.   ffdshow codec support, continued. ....................................................................................... 27
Image 37.   ffdshow codec support, continued. ....................................................................................... 27
Image 38.   ffdshow video compatibility management. ........................................................................... 28
Image 39.   ffdshow audio compatibility management. ........................................................................... 28
Image 40.   ffdshow speaker setup. ......................................................................................................... 29
Image 41.   ffdshow installation summary. .............................................................................................. 29
Image 42.   Importing ffdshow registry configuration. ............................................................................. 30
Image 43.   Using MediaInfo to locate subtitles ....................................................................................... 31
Image 44.   Extract subtitles from MKV source with MKVExtract GUI ...................................................... 32
Image 45.   Extract subtitles from MKV source with MKVExtract GUI, continued ..................................... 32
Image 46.   Subtitle Workshop loaded SRT source. .................................................................................. 33
Image 47.   Subtitle Workshop save as custom format ............................................................................ 33
Image 48.   TMPGEnc Edit Source ........................................................................................................... 34
Image 49.   TMPGEnc Add Subtitles Filter................................................................................................ 34




                                                                                                                                 Page | 39