Section2 AviSynth and frameserving のバックアップ差分(No.3)


  • 追加された行はこの色です。
  • 削除された行はこの色です。
#contents
#br
***Q2.1: What is frameserving and what is it good for ? [#l517d3ad]
***Q2.1: フレームサービング(frameserving)って何ですか?また、どんなメリットがありますか? [#l517d3ad]

A: An excellent description is found on [[[Lukes homepage]:http://neuron2.net/LVG/frameserving.html]]((Donald Graft氏によるミラーサイトです。)):
A: [[[Lukes homepage]:http://neuron2.net/LVG/frameserving.html]]((Donald Graft氏によるミラーサイトです。))に素晴らしい説明があります:

"Frameserving is a process by which you directly transfer video data from one program on your computer to another. No intermediate or temporary files are created. The program that opens the source file(s) and outputs the video data is called the frameserver. The program that receives the data could be any type of video application.
"フレームサービングとは、それによって、あるプログラムから別のプログラムへと、直接、ビデオデータを転送する方法のことです。中間ファイルや一時ファイルは生成されません。ソースファイルを開いて、そのビデオデータを出力するプログラムは、フレームサーバー(frameserver)と呼ばれます。そのデータを受け取るプログラムは、どのようなタイプのビデオ・アプリケーションでも構いません。

There are two main reasons that you would want to frameserve a video:
あなたがビデオをフレームサーブしたいと思うであろう、2つの主な理由があります:

+Save Disk Space: Depending the on the frameserving application, you can usually edit/process your video as it is being frameserved. Because frameserving produces no intermediate files, you can use a frameserver to alter your videos without requiring any additional disk space. For example, if you wanted to join two video files, resize them, and feed them to another video application, frameserving would allow you to do this without creating a large intermediate file.
+ Increased Compatibility: To the video application that's receiving the frameserved video, the input looks like a relatively small, uncompressed video file. However, the source file that the frameserver is transferring could actually be, for example, a highly compressed MPEG-1 video. If your video application doesn't support MPEG-1 files, it's not a problem because the application is just receiving standard uncompressed video from the frameserver. This feature of frameserving enables you to open certain types of files in an application that wouldn't normally support them.
+ ディスクスペースの節約: フレームサービング・アプリケーションによって、あなたは常に、あなたのビデオがフレームサーブされているものとして、それを編集したり処理したりすることができます。フレームサービングは中間ファイルを生成しないので、あなたは追加のディスクスペースを必要とすることなく、あなたのビデオに変更を加えるためにフレームサーバーを使うことができます。たとえば、あなたが2つのビデオファイルを結合し、リサイズして、別のビデオ・アプリケーションにフィードしたいと考えるなら、フレームサービングを利用すれば、巨大な中間ファイルを作成することなく、これを行うことができます。
+ 高められる互換性: フレームサーブされたビデオを受け取るビデオ・アプリケーションにとって、入力ファイルは、比較的小さな、非圧縮のビデオファイルであるように思えます。しかし実際には、フレームサーバーが転送しているソースファイルは、たとえば非常に圧縮されたMPEG-1ビデオということもありえます。もし、あなたのビデオ・アプリケーションがMPEG-1ファイルに対応していないとしても、それは問題ではありません。なぜなら、そのアプリケーションは、フレームサーバーから標準的な非圧縮ビデオを受け取るだけだからです。フレームサービングのこの特徴は、アプリケーションが標準でサポートしていない種類のファイルを開くことを可能にします。

Furthermore, because the video application is being fed the source video one frame at a time, it doesn't know anything about the file size of the source video. Therefore, if your application has 2 GB or 4 GB limit on input file size, it won't have any effect on your frameserved video. You could feed 100 GB of video via a frameserver to an application limited to 2 GB and it wouldn't cause a problem."
さらにビデオ・アプリケーションは、ソースビデオを1フレームずつフィードされるため、そのソースビデオのファイルサイズについては何も知りません。それゆえ、もしあなたのアプリケーションが、入力サイズ関して2GBないし4GBの制限を持っていたとしても、フレームサーブされたビデオには何の影響もありません。2GBの制限があるアプリケーションに、フレームサーバー経由で100GBのビデオをフィードすることもできますし、また、それによって何の問題も起こらないでしょう。"

***Q2.2: How do I use AviSynth as a frameserver ? [#se564caa]

A: Write a script using a text editor. Load your clip (see [[Q2.8>#content_1_7]]) in AviSynth, do the necessary filtering and load the AVS-file in encoder/application X (must be an encoder or application which can read AVI-files, see [[Q2.3>#content_1_2]] and [[Q2.4>#content_1_3]]).

***Q2.3: How do I frameserve my AVS-file to encoder/application X ? [#o8cc88df]

A:

+Frameserving to TMPGEnc, CCE SP, VirtualDub or WMP6.4:
Just open your AVS-file in TMPGEnc, CCE SP, VirtualDub or WMP6.4 (or whatever encoder/application you use) and have a look at [[Q2.4>#content_1_3]].
+Frameserving to VFAPI:
For VFAPI you need to install the [[[ReadAVS]:http://www.videohelp.com/forum/userguides/87270.php]] plugin. Just copy ReadAVS.dll to the VFAPI reader directory and open the reg-file ReadAVS.reg in notepad and change the corresponding path. Save it, and doubleclick on it to merge it with your registry-file.
+Frameserving to Premiere or Ulead:
--For frameserving to Premiere there exists an import plugin "IM-Avisynth.prm". The original version can be downloaded from [[[Bens site]:http://neuron2.net/www.math.berkeley.edu/benrg/avisynth-premiere.html]]((Donald Graft氏によるミラーサイトです。)). A much improved version can be downloaded from the [[[Video Editors Kit sourceforge page]:http://sourceforge.net/projects/videoeditorskit/]]. This works for Premiere 5.x,6.x and Pro at present.
--You can also download a program called [[[makeAVIS (included in the ffvfw codec package]:http://cultact-server.novi.dk/kpo/avisynth/avs_cvs.html]] (this is an AVI Wrapper), [[[discussion]:http://forum.doom9.org/showthread.php?s=&threadid=49964]]. Note that this program is included in the installation of AviSynth v2.52. For Ulead you must use this program.
+ Frameserving to Windows Media 9 Encoder:
Download Nic's Windows Media 9 Encoder and make sure you also installed the Windows Media 9 codec. Both can be found [[[here]:http://nic.dnsalias.com/WM9Enc.html]].

***Q2.4: Problems when Encoder X reads AVS-files ? [#f438da54]

A:

+Why can't I open my AVS-file in TMPGEnc (this happens in old versions of TMPGEnc) ?
--Install VFAPI plugin for TMPGEnc
--Disable the direct show filters within TMPGEnc and turn off the VirtualDub proxy before frameserving.
--Add "ConvertToRGB24" at the end of your AVS-file.
--Install [[[Huffyuv]:http://neuron2.net/www.math.berkeley.edu/benrg/huffyuv.html]]/DivX5 codec so that it can do the decompression for you when loading an AVI in TMPGEnc.
--Install the [[[ReadAVS]:http://www.vcdhelp.com/forum/userguides/87270.php]] plugin.
+CCE SP crashes when reading an AVS-file, what to do ?
--If you're using Win2k then run CCE in WinNT4-SP5 compatibility mode.
--If you're frameserving with AviSynth v1.0x/v2.0x put "ResampleAudio(44100)" in your script, even if you don't have any audio in your AVS-file.
--If you're frameserving with AviSynth v2.5x the ResampleAudio trick doesn't work anymore because it doesn't add a silent audio stream to your video clip. Instead make a script (called "addaudio.avsi") as described [[[here]:http://www.avisynth.org/index.php?page=AddAudio]], and put it in your plugin dir.
+Encoders/players (like CCE SP v2.62/v2.64) will not read AVS-files ?
Many "new" programs do NOT use the Windows functions to read the AVI-files. If they do NOT use those standard Windows functions the AviSynth-script files will not work. Known programs that do NOT use those routines are CCE SP v2.62, Windows Media Encoder vx.x. Furthermore people report problems with Windows Media Player 7.
--Use CCE SP v2.50 and WMP6.4 (under "Program Files" and "Windows Media Player" you will find a file called "mplayer2.exe", this is WMP6.4). In case that you want to use Windows Media Encoder you can use the AVI Wrapper "makeAVIS" instead, see [[Q2.3>#content_1_2]]. For Windows Media Encoder 9 have a look at [[Q2.3>#content_1_2]].
--If you still want to use CCE SP v2.62 you can try the following: Frameserve to CCE SP v2.62 with makeAVIS. Create an AVS script and then make a fake AVI with makeAVIS.
--Cinemacraft says that their CCE SP v2.66 can accept AviSynth scripts. So if you have this version you sould be safe.
+Wrong YUY2 Codec causes colorspace errors on AVISynth scripts feeding TMPGEnc. Some time ago I suddenly found that feeding TMPGEnc with an AVISynth script resulted in what looked like a colorspace conversion error; as if the video had been badly dithered down from 24 bit to 8 bit! (..)
--If you have such problems add "ConvertToRGB24" as the last line of your script or have a look at the thread (and the suggested solutions) [[[colorspace conversion errors]:http://forum.doom9.org/showthread.php?s=&threadid=27932]].

***Q2.5: How do I frameserve from Premiere/Ulead/Vegas to AviSynth ? [#kd3f4c60]

A: You can try the AviSynth compatible frameserver (import) for [[[PluginPace frameserver (by Satish Kumar)]:http://www.debugmode.com/pluginpac/frameserver.php]]: For frameserving from SonicFoundry Vegas (and earlier Vegas Video/VideoFactory? versions), Adobe Premiere or Ulead MediaStudio Pro to AviSynth. [[[discussion]:http://forum.doom9.org/showthread.php?s=&threadid=51242]].

***Q2.6: When frameserving I got the following message: "Script error, there is no function named "xxx (some filter)"" ? [#o7ac3db4]

A: You probably installed/registered a version of AviSynth which doesn't contain the filter. Make sure that there are no other versions floating around on your hard disc (there's a possibility that a version will be registered while it is not in your system directory). Check that the right version is registered, see also [[Q1.19>Section1 About AviSynth#content_1_18]].

***Q2.7: I get an unrecognized exception error trying to load an avs file with VirtualDub, using dvd2avi v1.77.3 ? [#xf0196c8]

A: .d2v created with dvd2avi v1.77.3 is NOT compatible with mpeg2dec.dll! Use v1.76 instead. If you still want to use v1.77.3, make sure that you have AviSynth v2.5 installed and mpeg2dec3.dll v1.07 (or a more recent version).

***Q2.8: How do I load my clip into AviSynth (video) ? [#w4372302]

A: Make a script containing the lines (replace the filename and the path of the filename):

-AVI-files (with uncompressed WAV, or CBR/VBR MP3-audio (v2.04)):~
 AviSource("d:\filename.avi")
disabling the audio:~
 AviSource("d:\filename.avi", false)

-AVI-files that AviSource doesn't support (for example "DV type I AVI-files"):~
 DirectShowSource("d:\filename.avi")  # no audio support yet

-MPEG1-files (extension mpg):~
Have a look at the [[Mpeg decoder plugins for AviSynth v1.0x/v2.0x:http://www.avisynth.org/Section+3%3A+Filters%2C+plugins+and+colorspaces#MpegDecoders]] and the [[Mpeg decoder plugins for AviSynth v2.5x:http://www.avisynth.org/Section+3%3A+Filters%2C+plugins+and+colorspaces#MpegDecoders2]]:~
Using AviSynth v2.0x/AviSynth v2.5x and MPEGdecoder.dll:~
 LoadPlugin("d:\MPEGdecoder.dll")
 mpegsource("d:\filename.mpg")

-MPEG2-files (extension m2p or m2v):~
Have a look at the [[Mpeg decoder plugins for AviSynth v1.0x/v2.0x:http://www.avisynth.org/Section+3%3A+Filters%2C+plugins+and+colorspaces#MpegDecoders]] and the [[Mpeg decoder plugins for AviSynth v2.5x:http://www.avisynth.org/Section+3%3A+Filters%2C+plugins+and+colorspaces#MpegDecoders2]]. Some examples:~
--Using AviSynth v2.0x and mpeg2dec.dll:~
Make a DVD2AVI project file and save it (filename.d2v) and load this clip into AviSynth:~
 LoadPlugin("d:\mpeg2dec.dll")
 mpeg2source("d:\filename.d2v")
--Using AviSynth v2.5x and MPEGdecoder.dll:~
 LoadPlugin("d:\MPEGdecoder.dll")
 mpegsource("d:\filename.m2p")
or (only the video stream)~
 LoadPlugin("d:\MPEGdecoder.dll")
 mpegsource("d:\filename.m2v", -2, "raw")

-VOB-files:~
Have a look at the [[Mpeg decoder plugins for AviSynth v1.0x/v2.0x:http://www.avisynth.org/Section+3%3A+Filters%2C+plugins+and+colorspaces#MpegDecoders]] and the [[Mpeg decoder plugins for AviSynth v2.5x:http://www.avisynth.org/Section+3%3A+Filters%2C+plugins+and+colorspaces#MpegDecoders2]]. Some examples:~
--Using AviSynth v2.0x and mpeg2dec.dll:~
Make a DVD2AVI project file and save it (filename.d2v) and load this clip into AviSynth:~
 LoadPlugin("d:\mpeg2dec.dll")
 mpeg2source("d:\filename.d2v")
--Using AviSynth v2.5x and MPEGdecoder.dll:~
 LoadPlugin("d:\MPEGdecoder.dll")
 mpegsource("d:\filename1.vob+d:\filename2.vob")

-ATSC transport streams (extension *.trp or *.ts):
--Using AviSynth v2.0x:~
Download mpeg2dec2 and a special version of [[[dvd2avi]:http://www.trbarry.com/DVD2AVIT3.zip]]. Don't forget to specify the video and audio pid's in the DVD2AVI.ini file:~
 LoadPlugin("d:\mpeg2dec2.dll")
 mpeg2source("d:\filename.d2v")
--Using AviSynth v2.0x/v2.5x:
Download mpeg2dec3 v1.07 (or a more recent version) or mpegdecoder and a special version of [[[dvd2avi]:http://www.trbarry.com/DVD2AVIT3.zip]]:~
 LoadPlugin("d:\mpeg2dec3.dll")
 mpeg2source("d:\filename.d2v")
or if you want to used mpegdecoder:~
 LoadPlugin("d:\mpegdecoder.dll")
 mpegsource("d:\filename.d2v")
If both methods fail you can try [[[HDTV2MPEG2]:http://www.avsforum.com/avs-vb/attachment.php?s=&postid=1408610]] (produces non dvd compliant mpeg2 files) to create a temporary mpeg2 file and import that in AviSynth with dvd2avi. For demuxing AAC audio: use [[[TSDemux]:http://www.avsforum.com/avs-vb/showthread.php?s=&threadid=222055]].~
The Moonlight [[[Xmuxer]:http://www.moonlight.co.il/download/?dl=xmuxer]] package has also a bunch of DirectShow filters that deal with muxing and demuxing MPEG-1/2 TS and PVA files.

-PVA transport streams:
You are out of luck here. AFAIK the only option is !PVAStrumento.
The Moonlight [[[Xmuxer]:http://www.moonlight.co.il/download/?dl=xmuxer]] package has also a bunch of DirectShow filters that deal with muxing and demuxing MPEG-1/2 TS and PVA files.

-d2v-files (DVD2AVI frameserver files):~
 LoadPlugin("d:\mpeg2dec.dll")
 mpeg2source("d:\filename.d2v")

-vdr-files (VirtualDub's frameserver files):~
 AviSource("d:\filename.vdr")

-ASF-files (the framerate has to be specified, right click on the file in windows explorer):~
 DirectShowSource("d:\filename.asf", fps=15)

-tpr-files (TMPGEnc project files):
First note that the plugin GreedyHMA is proving to be a better IVTC solution (not to mention *MUCH* easier) than TMPGEnc. So if you want to use TMPGEnc for this get the GreedyHMA plugin (this plugin works in YUV-space). If you still want to import a tpr-file into an AVS-file, there are two possibilities:~
--first one: The TMPGEnc plugin is contained in the VFAPI Plugin zip file (ends with -vfp.zip) which can be download from Dooms site. (This method doesn't always work, some encoders like CCE SP can't read them.)~
 LoadVFAPIplugin("d:\TMPGenc.vfp","TMPGsource")
 TMPGsource("d:\filename.tpr")
 FlipVertical
--second one: Import the tpr-file in VFAPI, create a fake avi and then load it into AviSynth (note that VFAPI works in RGB-space). See also [[[1]:http://forum.doom9.org/showthread.php?s=&threadid=10007]].

-aup-files (AviUtl projects):
I don't know if it is possible to load it directly into AviSynth. Import the aup-file in VFAPI, create a fake avi and then load it into AviSynth (note that VFAPI works in RGB). See also [[[2]:http://forum.doom9.org/showthread.php?s=&threadid=10007]].

-QuickTime-files (see [[[3]:http://forum.doom9.org/showthread.php?s=&threadid=23139]]):~
 DirectShowSource("d:\filename.mov")
or if that doesn't work download a plugin (can be found in Dooms download section):~
 LoadVFAPIPlugin("C:\QTReader\QTReader.vfp", "QTReader")
 QTReader("C:\quicktime.mov")

-AVS-files:
Just import it at the beginning of your script:~
 Import("d:\filename.avs")
In v2.05 or a more recent version you can use the autoplugin loading. Just move your AVS-file in the autoloading plugindir, and rename the extension to 'avsi'.

***Q2.9: How do I load my clip into AviSynth (audio) ? [#d35eda2a]

A: This can be done in several ways:

-Using AviSource (with uncompressed WAV, CBR/VBR MP2-audio (starting from v2.04) or CBR/VBR MP3-audio (starting from v2.04)):~
 AviSource("d:\filename.avi")
Starting from v2.05 you can extract audio from a AVI-file in this way:~
 WavSource("d:\filename.avi")
-Use the audio decoder plugin MPASource, see [[Q3.4>Section3 Filters, plugins and colorspaces#content_1_3]] and [[Q3.5>Section3 Filters, plugins and colorspaces#content_1_4]] for importing mp1/mp2/mp3 audio.
-Put a WAV-header on your [[[mp2]:http://www.geocities.com/wilbertdijkhof/mpa2wav.zip]] or mp3 (with Besweet) audio file and use WavSource to import the audio. You also need ACM codecs for [[[mp2]:http://www.geocities.com/wilbertdijkhof/qmpeg_mp2.zip]], and for mp3 (Radium codec, see doom's download section). Use WavSource to load the WAV:~
 WavSource("d:\filename.wav")

Up to v2.07 the audio must be mono or stereo. Starting from v2.5 you can also import uncompressed multichannel audio.

***Q2.10: Can I load an audio file other than a WAV-file? [#b6864c01]

A: Yes:

-Uncompressed audio files (that is uncompressed WAV-files) can be loaded in all versions up to v2.03.
-Starting from v2.04 compressed WAV-files can be loaded (currently only MP2/MP3-files with a WAV-header).
-Starting from v2.5 you can also load uncompressed multichannel audio.
-Using the MPASource and AC3filter plugins you can import mp1/mp2/mp3 and AC3 audio.

See also [[Q2.9>#content_1_8]].

***Q2.11: How do I join video and audio ? [#z3cbd154]

A: Make an avs-file containing the lines (change the filenames and paths):

 video = AviSource("d:\filename1.avi")
 audio = ((AviSource|WavSource))("d:\filename2.wav")
 AudioDub(video, audio)

***Q2.12: I get an unrecognized exception in the line I use DirectShowSource? [#sd538e48]

A: Have you got VobSub installed? Have a look at this [[[thread]:http://forum.doom9.org/showthread.php?s=&threadid=34350]]. Upgrade to VobSub v2.20 or higher. If someone has an explanation, please post it in the thread.