AviSource のバックアップ差分(No.4)


  • 追加された行はこの色です。
  • 削除された行はこの色です。
 AviSource(string filename [, ... ], [bool audio = true], [string pixel_type = YV12], [string fourCC])

 OpenDMLSource(string filename [, ... ], [bool audio = true], [string pixel_type = YV12], [string fourCC])

 AviFileSource(string filename [, ... ], [bool audio = true], [string pixel_type = YV12], [string fourCC])

 WavSource(string filename [, ... ])

AviSourceは、1つ以上の引用符で囲まれたファイル名を引数として取り、Video-for-Windowsの"AVIFile"インターフェイスかAviSynth組み込みの(VirtualDubから取り入れられた)[[OpenDML]]コードを使って、ファイルを読み込ませます。このフィルタは、AVIFileハンドラを持つどんなファイルをも読み込むことができます。これには、AVIファイルだけでなく、WAVファイル、AVS(AviSynthスクリプト)ファイルやVDR(VirtualDubフレームサーバー)ファイルも含まれます。引数に複数のファイル名を指定した場合、それらのクリップは、[[UnalignedSplice>Splice]]を使って継ぎ合わされる(spliced)でしょう。bool型の引数はオプションで、デフォルトは"true"になります。

The AviSource filter examines the file to determine its type and passes it to either the AVIFile handler or the OpenDML handler as appropriate. In case you have trouble with one or the other handler, you can also use the OpenDMLSource and AviFileSource filters, which force the use of one or the other handler. Either handler can read ordinary (< 2GB) AVI files, but only the OpenDML handler can read larger AVI files, and only the AVIFile handler can read other file types like WAV, VDR and AVS.
AVISourceフィルタは、ファイルのタイプを決定するために、そのファイルを調べて、AVIFileハンドラかOpenDMLハンドラの、いずれか適切な方へ渡します。一方、ないし他方のハンドラでトラブルが生じた場合、[[OpenDMLSource>AviSource]]フィルタや[[AviFileSource>AviSource]]フィルタを使用することもできます。これらのフィルタは、いずれか一方のハンドラの使用を強制します。どちらのハンドラも、通常の(2GB未満の)AVIファイルは読み取ることができます。しかし、2GB以上のAVIファイルを読み取ることができるのはOpenDMLハンドラだけですし、WAV、VDRやAVSのような、その他のファイルタイプを読み取ることができるのはAVIFileハンドラだけです。

Up to v2.04, WavSource was an alias to AviFileSource. In later versions, WavSource doesn't try to open the video stream anymore. It can be useful if you want to retrieve the audio stream from an AVI file but the video stream is damaged or its compression method is not supported on your system.

From v2.04 up there is built-in support for ACM (Audio Compression Manager) audio (e.g. mp3-AVIs). AviSource is also no longer able to open WAV-files, which must be accessed by using WavSource

From v2.06 the pixel_type parameter (default YUY2) allows you to choose the output format of the decompressor. Valid values are "YUY2", "RGB32" and "RGB24". If omitted, AviSynth will use the first format supported by the decompressor (in the following order: YUY2, RGB32, RGB24). This parameter has no effect if the video is in an uncompressed format (YUY2, RGB32 or RGB24), because no decompressor will be used in that case. From v2.5 the default pixel_type parameter is changed to YV12. To put it in different words: if you don't specify something it will try to output the AVI as YV12, if that isn't possible it tries YUY2 and if that isn't possible it tries RGB.

Sometimes the colors will be distorted when loading a DivX clip in AviSynth v2.5 (the chroma channels U and V are swapped), due to a bug in [[DivX]] (5.02 and older). You can use [[SwapUV>Swap]] to correct it.

From v2.53 AVISource can also open DV type 1 video input (only video, not audio).

From v2.55, an option fourCC is added. FourCC, is a FOUR Character Code in the beginning of media file, mostly associated with avi, that tells what codec your system should use for decoding the file. You can use this to force AviSource to open the avi file using a different codec. A list of FOURCCs can be found [[[here]:http://www.fourcc.org/index.php?http%3A//www.fourcc.org/codecs.php]]. By default, the fourCC of the avi is used.

Some MJPEG/DV codecs do not give correct CCIR 601 compliant output when using AVISource. The problem could arise if the input and output colorformat of the codec are different. For example if the input colorformat is YUY2, while the output colorformat is RGB, or vice versa. There are two ways to resolve it:

1) Force the same output as the input colorformat. Thus for example (if the input is RGB):

 AVISource("file.avi", pixel_type="RGB32")

2) Correct it with the filter [[ColorYUV]]:

 AVISource("file.avi").ColorYUV(levels="PC->TV")

''関連スレッド:''

[[[MJPEG codecs]:http://forum.doom9.org/showthread.php?s=&postid=330657]]

[[[DV codecs]:http://forum.doom9.org/showthread.php?s=&threadid=58110]]

''例:''

 AviSource("d:\capture.avi")  # Cプログラマーは注意する: バックスラッシュ(日本語環境では\)は二重にしないこと。
 AviSource("c:/capture/00.avi")  # 左下がりのスラッシュも動作する。
 WavSource("f:\soundtrack.wav")  # これは動作する。
 AviSource("cap1.avi", "cap2.avi")  # AviSource("cap1.avi")+AviSource("cap2.avi")と同じ。
 AviSource("cap.avi", false, "RGB32")  # 音声を無効化し、RGB32デコードを要求する。
 AviSource("cap.avi", false, fourCC="CDVC")  # Canopus DVコーデックを使って、DVを開く。
 AviSource("cap.avi", false, fourCC="XVID")  # avi(たとえばDivX3)をXviDコーデックを使って開く。

''更新履歴''
|v2.55|fourCCオプションを追加。|

#hr
註: このページは、http://www.avisynth.org/AviSourceの日本語訳です。