QTInput / QTOutput

Plugin for AviSynth 2.5
Version 0.1.4 - May 28, 2011
by Josh Harris

About

This filter can read and write quicktime files, using an existing installation of Quicktime. If you have Quicktime 6 installed, the filter only supports video. If you have Quicktime 7, video and audio are supported for input. The filter currently only supports creating movs with video. Audio support is planned for a future version.

It should be able to open almost any file that you can open with the quicktime player: movs, mp4 (h264 with b-frames skips the first frame or two and is extremely slow), raw dv, reference movs, etc.

Requirements:

Quicktime 6 for video only
Quicktime 7 for audio and video

Usage - Read

QTInput("FileName.mov", color = 2, quality = 100, audio = 0, mode = 0, raw = "yuyv", info = 0, dither = 0, vfw = "", gamma = -1, vfrFPS = 0)
QTInput("FileName.mov")

Parameters:

file - input filename
color - output colorspace (default = 2)
    0 = RGB24
    1 = RGB32
    2 = YUY2
quality - decompression quality (default = 100)
    There are really only two values for this setting:
      0 = normal
      > 0 = High quality
    This parameter does not have an effect on all codecs but there is a noticeable drop in quality for some of them (dvc) if it is set to 0. It is recommended that you leave this value at it's default value of > 0.
audio - audio input (default = 0)
    0 = audio disabled.
    1 = audio enabled - all channels/tracks down mixed either to 1 stereo or 1 mono channel.
    2 = audio enabled - all channels/tracks output as separate AviSynth channels (be carefull with this one...a lot of programs cannot play back multi channel audio).
    This is only valid if you have Quicktime 7. Audio is completely disabled for Quicktime 6.
mode - Decode mode (default = 0)
    0 = Uses Quicktime SDK function MoviesTask to decode video.
    1 = If source file is one of several YUV formats (listed below), this mode returns raw data.
    2 = Uses Quicktime SDK function DecompressSequence to decode video.
      Should probably not be used for mpeg4 (h263, h264, etc.), try mode=0 or mode=3 instead
    3 = Uses Quicktime SDK function ICMDecompress to decode video.
    4 = Uses Video for windows codec.
raw - raw input colorspace (default = "yuyv")
    If mode = 1, this sets the input file colorspace method. Choices are:
    uyvy (2vuy), yuyv (yuy2), yvyu, vyuy, yuv2 or v210 (10bit uyvy), rgb, argb.
info - Overlays codec info on the video (default = 0)
    0 = info feature is turned off.
    1 = info feature is turned on.
dither - raw 10bit to 8bit dither mode (default = 0)
    0 = off
    1 = Uses the 2 least significant bits as a fraction for rounding the 10bit value to the nearest 8bit value.
    Currently this really isn't a dither mode, but is in place for a future dither mode option.
    This only has an effect when mode=1, raw="v210."
vfw - If mode = 4, force QTInput to use this VFW codec (FOURRCC code)
    This can be left blank and QTInput will attempt to find the correct codec based on the FOURCC embedded in the movie
gamma - EXPERIMENTAL: it is recomended not to use this...(default = -1, off) If mode = 0, 2 or 3 adjust the decoded gamma to this value
    Values less than or equal to zero do not apply any gamma correction
    Does not seem to work with all codecs
vfrFPS - EXPERIMENTAL: it is recomended not to use this...(default = -, off)
    If the video is variable frame rate, this tries to force it to use the desired fps by duplicating frames
    The math for this is wrong:
      My test movie is 29.97 (captured in VFR mode).
      It opens in Quicktime player with a duration of 24:22.76 and fps of 14.14.
      It opens in QTInput with vfrFPS = 0 (turned off) with a duration of 24:22.73 and fps of 20.538, 30041 frames
        but the VFR frames are not duplicated and the movie plays incorrectly.
      It opens in QTInput with vfrFPS = 29.97 with a duration of 24:22.73 and fps of 33.368, 48808 frames
        the VFR frames are duplicated but they are not 100%.
      By experimentation, I was able to find that setting vfrFPS = 33.675, QTInput opens it with a duration of 24:22.74 and fps of 29.97, 43839 frames
        the VFR frames are duplicated and seem mostly correct.

Usage - Write

QTOutput("FileName.mov", format = "", quality = 100, datarate = 1000, keyframe = 1, raw = "", settings="settings_filename", audio = 0)
QTOutput("FileName.mov")

Parameters:

file - output filename
format - quicktime FourCC codec (default = "")
    If you leave this value blank, a dialog box will open allowing you to choose which codec to use.
    h264 compression is a little buggy. It doesn't work if "keyframe every" is checked. This means you have to use the dialog box for h264 and uncheck it.
    Other options for this depend on what codecs you have installed, some examples:
    "dvc" = DV25 NTSC
    "dvcp" = DV25 PAL
    "rle" = Animation
    "SVQ3" = Sorenson Video 3
    "cvid" = Cinepak
    "IV41" = Intel Indeo¨ Video 4.4
    "cvid" = Cinepak
quality - compression quality (default = 100)
    This value is divided by 20 and truncated to an integer, so a value of 25 is identical to a value of 20.
    0 = Least
    20 = Low
    40 = Medium
    60 = High
    80 = Best
    100 = Lossless (this is listed as lossless in the SDK, but is probably not always lossless, but rather just the highest setting for a given codec.
    333 = This is a special mode that will create a file called "Quicktime_CodecList.txt" in the same directory as the avs script. This file will contain a list of the FourCC codes installed on your system.
datarate - datarate in KBytes/sec (default = 1000)
keyframe - keyframe every n frames (default = 1)
raw - raw output colorspace (default = "")
    This is a raw output mode. Instead of using a quicktime codec to encode data, this mode copies the data directly from YUY2 to the requested output mode.
    You must set format to a valid quicktime FourCC.
    Currently only format="2Vuy", raw="uyvy" is supported.
    And you must have a codec installed that handles 2Vuy, such as the Blackmagic codec.
settings - This is a filename to save/read output codec settings to/from
audio - Disable audio (default = 0) or enable audio (1)
   
   

Version changes:

Plans:

License:

This program is freeware, but WITHOUT ANY WARRANTY.