4. Handling MKV & MP4 Files

This section will explain how to prepare the video in MKV & MP4 containers and get it ready to use with video editing software. If your software supports the importing of MP4 video files and your video is in a MKV container, you can follow the first set of instructions. If you need to or prefer to convert your source to AVI, you will need to read second set of instructions.

IMPORTANT: Make sure the full path of the directory that you work out of does not contain any unicode characters as it will cause errors when using AviSynth!

Need the software mentioned in this guide? Visit the Setup Guide for more information.

NOTE: It is highly recommended that you convert the source to lossless AVI files to work with as it will improve the efficiency of the footage in the editing software.

Footage Handling Options:

  1. Recontainer MKV to MP4
  2. Convert MKV/MP4 Files to AVI
    1. AMVtool (Basic)
    2. AviSynth (Advanced)(Windows Only)
    3. VapourSynth (Advanced)

I. Recontainer MKV to MP4

NOTE: If the video is Hi10P (10-bit) you will be required to convert it to AVI to use it with your video editing software unless you are working with Adobe CC 2015 or higher!

  1. Rename file to video.mkv to avoid unicode characters in the file name causing problems.
  2. Open the AMVtool software.
  3. In the main window click the “Add” button.
  4. Select the “_t##.mkv” file and click Open.
    (NOTE: If you have more than one file to recontainer, make sure to add them all before proceeding!)
  5. In the main window click the “Configure All” button.
  6. In the Configure dialog box click the “Recontainer” button.
  7. In the “Audio Option” pop-up click “No”.
  8. In the “Settings Changed” pop-up click “OK”.
  9. In the main window click the “START” button.
  10. Once the process finishes you can exit the AMVtool application.

Result:
You will have video.mp4 which will be usable with editing software.

II. Convert MKV/MP4 Files to AVI

A. AMVtool (Basic)

NOTE: If you need to clean up the video footage you will need to use the advanced method.

  1. Open the AMVtool software.
  2. In the main window click the “Add” button.
  3. Select the “_t##.mkv” file and click Open.
    (NOTE: If you have more than one file to convert, make sure to add them all before proceeding!)
  4. In the main window click the “Configure All” button.
  5. In the Configure dialog box change “Container:” to “AVI”.
  6. Click the “Audio” tab and change “Use Stream:” to “None”.
  7. Click the “OK” button to save the settings and return to the main window.
  8. In the main window click the “START” button.
  9. Once the process finishes you can exit the AMVtool application.

Result:
You will have an AVI video file which will be usable with any editing software.

B. AviSynth (Advanced)(Windows Only)

  1. Rename the file to video.mp4 or video.mkv to avoid unicode characters in the file name causing problems.
    (HELPFUL TIP: The default setting for Windows is to hide the file extension, if you do not see .mkv or .mp4 when renaming do not add it.)
  2. Open AvsPmod then go to File > New tab and then go to File > Save script as…
  3. Browse to the directory where the video.mp4 or video.mkv is stored then save the script as Video.avs.
  4. In AvsPmod use the following example:
    Video.avs Example

    LWLibavVideoSource("video.mp4", format="YUV420P8") 

    (HELPFUL TIP: It is recommended that you visit the Using Script Filters section before proceeding to learn more about using additional plugins to clean up the video.)

  5. After the script is finished go to File > Save script, then close AvsPmod.
  6. Open VirtualDub, then go to File > Open.
  7. Set “Files of type:” to “AVIFile Input Driver”
  8. Browse to the directory where video.avs is located and open it.
    (NOTE: When using “LWLibavVideoSource()” VirtualDub may appear to lock up and not respond for a short period of time upon opening the AVS file, this is normal, DO NOT force close the application as the script is creating an index file for itself. This will ONLY happen the first time a particular video is opened!)
  9. Go to Video then select “Fast recompress”
  10. Go to Video > Compression…
  11. In the “Select video compression” box, select either:
    UtVideo YUV420 BT.709 (HLH0) VCM (For footage that was originally HD)
    or
    UtVideo YUV420 BT.601 (HLY0) VCM (For footage that was originally SD)
  12. Click the OK button.
  13. Go to File > Save as AVI…
  14. Browse to the directory where you wish to save your output and save the video as video.avi

Result:
You will have an AVI video file which will be usable with any editing software.

C. VapourSynth (Advanced)

  1. Rename the file to video.mp4 or video.mkv to avoid unicode characters in the file name causing problems.
    (HELPFUL TIP: The default setting for Windows is to hide the file extension, if you do not see .mkv or .mp4 when renaming do not add it.)
  2. Open VapourSynth Editor then go to File > New Script and then go to File > Save script as…
  3. Browse to the directory where the video.mp4 or video.mkv is stored then save the script as Video.vpy.
  4. In VapourSynth Editor use the following example:
    Video.vpy Example

    #Import VapourSynth Core
    import vapoursynth as vs
    core = vs.get_core()
    #Import Video
    video = core.lsmas.LWLibavSource(r'video.mp4', format="YUV420P8")
    #Sets Video Output
    video.set_output()
    

    (HELPFUL TIP: It is recommended that you visit the Using Script Filters section before proceeding to learn more about using additional plugins to clean up the video.)

  5. After the script is finished go to File > Save script, then close VapourSynth Editor.
  6. Open the AMVtool and in the main window click the “Add” button.
  7. Browse to the directory where video.vpy is located and open it.
  8. In the main window click the “Configure All” button.
  9. In the Configure dialog box change “Container” to AVI and click “OK”.
  10. In the main window click the “START” button.
  11. Once the process finishes you can exit the AMVtool application.

Result:
You will have an AVI video file which will be usable with any editing software.