MKV H.264/AVC to VC-1 Conversion Guide



This guide describes how to convert MKV video files with H.264 video stream to VC-1 format. As input files could be ANY media format, not only in MKV container, these files could be in AVI, MP4 containers also.

For our conversion these free tools will be needed to download and install:

1. AVISynth
Download Avisynth

2. WMNicEnc
Download WMNicEnc

3. MediaInfo
Download MediaInfo

4. Windows Media Player 11 Codecs
Download wmfdist11.exe

After downloading and installing please reboot your Operating System (OS) to take effect. After rebooting Windows Media Player 11 Codecs will be set by system to use them in our conversion.

Our test file to convert will be:
FinalClip.720p.H264.mkv

  • Conversion guide
  • 1. Launch MediaInfo and Select from "File" menu - "Open" - "File"

    Launch MediaInfo

    2. Select your media file from hard drive and Open It

    Media File Information

    From this window we must to select for our purpose these values:

    Video Bitrate: 13.2 Mbps (Mega bits per second = 13200000 bits per second)
    Frame rate: 50 fps
    Scan Type: Progressive
    Audio Sampling Rate: 48.0 KHz
    Audio channels: 6 channels
    Audio Format: AC-3

    To view full media info please select from "View" menu - "Text"

    Full Media File Information

    3. Then adjust AC3 Filter to mix to the OS drivers uncompressed audio stream with the SIMILIAR!!! channels count. If there is no AC3 Filter installed in your OS, please install it - it is easier to install  K-Lite Codec Pack, which contains all latest codecs, filters and media splitters. During K-Lite Codec Pack installation,  select "Full of Stuff" profile.

    To adjust AC3 Filter - go to "Start" - "Programs" - "K-Lite Codec Pack" - "Configuration" - "AC3 Filter" and then select for our test MKV file, for 6 channels audio stream, "3/2+SW 5.1 channels", as shown on a next screenshot, then press "OK".

    AC3 Filter Adjust Output Format

    For stereo input audio streams, you can select "2/0 - stereo".

    If you do not use AC3 Filter to decode AC3, DTS audio streams during playback and use "ffdshow audio decoder", please check "Mixer" tab and select "3/2/1 - 6 channels", then press "OK".

    ffdshow Audio Decoder 6 Channels Configuration

    4. AVISynth script editing. Open "Notepad", Save "Untitled.txt" as "AVS_Open.avs" (with avs file extension!!!), then copy this single string to our new AVS file:

    DirectShowSource("c:\D\vc-1\FinalClip.720p.H264.mkv")

    In quotes there is a full path to our MKV test file, DirectShowSource is the AVISynth function to use Direct Show filters. "AVS_Open.avs" is not strict filename, you can use your own, it is just for example.

    5. Launch "WMNicEnc.exe" from your hard drive, initial window will appear.

    WMNicEnc Initial Window

    Now, we must open our AVS file in WMNicEnc - press the right button from blank "Input AVS File:" field, select our "AVS_Open.avs" file.  For our test file, use these settings as shown on the next screenshot:

    Audio options:
    Audio codec: Windows Media Audio 10 Professional
    Audio stream parameters: 440 kbps, 48 kHz, 5.1 channels 16 bit CBR

    For our conversion we selected maximim available bitrate (440 kbps) from the options list and the 16 bit audio encoding for the maximum software/hardware playback compatibility.

    If you do not need audio stream re-encoding, please uncheck "Use Audio"

    Video options:
    Video Codec Profile: Windows Media 9 Advanced Profile
    Bitrate: 9000000 (in bits per second)
    Quality: 100 (in percents - maximum)
    FPS: 50 (as we detected with MediaInfo at 2 guide step)
    Secs/KF: 5 (leave by default)
    Resolution: Check "Use input Size"

    You can use any video bitrate as you like, for example 13200000 bits as in the source H.264 stream, etc.
    If you use as the source file m2ts file from AVCHD camcorder, it could be with 1440x1080 resolution with 16:9 aspect ratio flag, so you must to uncheck "Use input Size" and manually type
    "X:" 1920 "Y:" 1080

    You could adjust VBR video encoding, checking "VBR Options" - VBR mode could decrease your output file size.

    Check "Use MultiPass Encoding" to increase the output quality with VBR encoding mode.

    WMNicEnc Conversion Settings

    Now, our file is ready to be converted. Press "Encode" to start.

    Encoding time depends on your PC's processor.

  • Remux from WMV to MKV
  • Now, if you do not want to use WMV (ASF) container, you can remux your resulting WMV file to MKV container.  In this part we will use the original AC3 audio stream, which we demux from "FinalClip.720p.H264.mkv" source file using  tsMuxeR. Open "FinalClip.720p.H264.mkv" in tsMuxeR and
    1) Uncheck H.264 video stream
    2) Check "Demux"
    3) Press "Start Demuxing" button

    After demuxing tsMuxeR creates audio source file named "FinalClip.track_2.ac3", which we will use later.

    tsMuxer AC3 Demux

    Now, we need extract elementary VC-1 stream from resulting "AVS_Open.wmv". Please download  ASF2VC1 command line tool. Unpack this tool to your working directory and use this  extract_VC-1.bat file to launch extraction (demux). Your "ASF2VC1.exe" and "AVS_Open.wmv" must be placed in the same folder!
    Double click the "extract_VC-1.bat" to get "AVS_Open.vc1" elementary stream, then press any button in a command window to close it.

    Now, we have 2 stream files:
    "AVS_Open.vc1" elementary video stream and "FinalClip.track_2.ac3" audio stream. Firstly, mux "AVS_Open.vc1" to MKV using  eac3to command line tool. Use simple  eac3to_VC-1_mux_to_MKV.bat file, which look like:

    c:\D\vc-1\eac3to\eac3to c:\D\vc-1\AVS_Open.vc1 c:\D\vc-1\AVS_Open_Video.mkv

    where:
    "c:\D\vc-1\eac3to\eac3to" - folder with all files extracted from eac3to ZIP archive
    "c:\D\vc-1\AVS_Open.vc1" - full path to elementary VC-1 video stream
    "c:\D\vc-1\AVS_Open_Video.mkv" - full path to the MKV resulting file (with video stream only!)

    And now, install  MKVtoolnix  and run "mkvmerge GUI".

    Please:
    1) Add our "AVS_Open_Video.mkv" file using "add" button
    2) Change "Output filename" to "FinalClip.Result.mkv" using "Browse" button

    MKVtoolnix Open MKV File Change Output Filename

    3) Add "FinalClip.track_2.ac3" audio stream using "add" button
    4) Start muxing

    MKVtoolnix Add AC3 Stream Start Muxing

    The resulting file "FinalClip.Result.mkv" after muxing finishing will contains 2 streams.

  • Known limitation
  • During testing of the settings author did not yet found settings to convert interlaced source files as VC-1 interlaced, which must be used for encoding AVCHD files from camcorders that shot video as interlaced material. if the decision will be found, author will update this guide.
    For those users, who want to change output mode to interlaced manually - please press "Advanced Options" button and select in the "Video Type" listbox "Auto" mode, then press OK. This operation will change registry settings for "Advanced Profile" how to encode frames: "as either interlaced frames or interlaced fields".
    Added: decision was found using  WMCmd.vbs WME9 script.  It allows to the user to convert interlaced material with ALL advanced settings working with command-line interface, *.bat files, etc.




  • Links
  • VideoHelp.com



    To contact to the author of this guide, please send e-mail:
    Aleksandr Ignatov
    Contact to the author


    Bookmark and Share



    eXTReMe Tracker