wmansir
14th May 2003, 00:33
A couple of weeks ago DDogg and myself discussed (http://forum.doom9.org/showthread.php?s=&threadid=51739) adding a post to the FAQ on this issue since the questions come up here often. I started writing this up at the time, but forgot about it. The file caught my attention today so I added a little bit more and decided to throw it up here for additions and editing before adding it to the FAQ. It's far from complete, I just added some info from the top of my head. Since I didn't use CCE 2.62 or 2.64 or the AVS 2.0x series I know help is needed there, but feel free to add info for other sections as well.
So here it is, any comments are welcome. I decided to thow this up just before heading out, so I didn't proof read it entirely. I just wanted it up so I can start the ball rolling.
EDIT 1:
Added Wilbert's info on MakeAVIS
Corrected ConvertToYUY2 and removed speed comment, thanks to DDogg
Added specific note about Mpeg2Dec.dll not compatible with AVS 2.5, DDogg agian
Corrected statment that AddAudio fix works with all versions (need autoloading for macro)
Added some links.
--------------
Getting AviSynth to work with CCE
There are several issues which can arise when trying to use AviSynth (AVS) with various versions of CCE. Since there are several versions of both CCE and AVS that are currently in use this post will try to cover common problems.
The first step is to be sure that your installation of AVS is functioning properly before blaming CCE.Try opening your .avs script in Windows Media Player or Virtual dub. If they can't open the file, CCE probably won't be able to either. Here is AviSynth.org's Troubleshooting guide. (http://www.avisynth.org/index.php?page=Troubleshooting)
Also, CCE isn't the most stable program on the block. Since this post will focus on issues of CCE and AviSynth interoperability it is also assumed that CCE is working correctly. If you are having general issues of CCE crashing with all file types including .avs scripts you should address those issues first (and good luck).
(add something which version of avs to use, recommend latest stable build, currently 2.08)
Versions of CCE
CCE 2.5
Problem: Crashes when adding .avs file.
Solution:
This is a known bug with CCE 2.5. The problem is that Avisynth scripts used with this version need to have an audio track.
The old method to do this was to simply call ResampleAudio(4100), which would add a blank audio track to the output. This actually exploited a bug which has been fixed. So here is an updated method, which should work with all versions of Avisynth 2.01 and higher.
Create a text file in your Avisynth 'Plugin' directory named ' AddAudio.avsi ', then past the following function into the file.
function AddAudio(clip v1) {
v2 = Blankclip()
v1 = AudioDub(v1,v2)
return v1
}
Then add the line ' AddAudio() " to your script. To be sure it worked, open the .avs file in Vdub and on the menu go to ' File->File Information... ' and make sure the Audio stream information is not blank. CCE 2.5 should now accept the script.
CCE 2.62
Problem: CCE won't open my .avs script.
Solution:This version does not accept .avs scripts. As a workaround you can use a second program to convert your .avs script into a pseudo-avi, which CCE can use.
makeAVIS (by Milan) (http://cultact-server.novi.dk/kpo/avisynth/avs_cvs.html), included in his "ffvfw" codec, can do this. It is currently still under development,discussion (http://forum.doom9.org/showthread.php?s=&threadid=49964).
There is also a commercial program called Link2 (http://www.videotools.net/index.php?rub=guides&htm=intro2link2.htm) which is known to work well.
CCE 2.64
CCE 2.66
Problem: CCE is leaking memory FAST!
Solution: This has been observed by several people. It seems to be related to using .avs scripts that don't contain audio. So it is recommended to add audio to your .avs scripts as described in the CCE 2.5 section. However, this solution will not eliminate the memory leak, only reduce it to a more manageable level.
Notes on using AviSynth 2.5
There are now two major branches of the Avisynth development tree.
The 2.0x branch is an improvement to the traditional 1.x series, with bug fixes and some additional functionality. Scripts and plugins are usually compatible between Versions 1.x and 2.0x. Most guides and programs that use AVS are referring to this series.
The major change in the 2.5 branch is the ability to use YV12 colorspace. This means the video is processed in the original format that is on the DVD. When encoding with programs that can accept YV12 input you will see a significant increase in speed. However, the 2.5 series has several limitations. Plugins are not compatible with 2.0x (or vice versa, including Mpeg2Dec.dll) and scripts may need to be adjusted to be compatible with AVS 2.5. Read this FAQ (http://forum.doom9.org/showthread.php?s=&threadid=37276) if you are planing to use AVS 2.5.
If you choose to use AVS 2.5, regardless of what version of CCE you use (up to 2.67.00.10), you will need to convert the colorspace to YUY2 before opening the script in CCE. This is easy, just add the line
ConvertToYUY2()
the the end of your script.
So here it is, any comments are welcome. I decided to thow this up just before heading out, so I didn't proof read it entirely. I just wanted it up so I can start the ball rolling.
EDIT 1:
Added Wilbert's info on MakeAVIS
Corrected ConvertToYUY2 and removed speed comment, thanks to DDogg
Added specific note about Mpeg2Dec.dll not compatible with AVS 2.5, DDogg agian
Corrected statment that AddAudio fix works with all versions (need autoloading for macro)
Added some links.
--------------
Getting AviSynth to work with CCE
There are several issues which can arise when trying to use AviSynth (AVS) with various versions of CCE. Since there are several versions of both CCE and AVS that are currently in use this post will try to cover common problems.
The first step is to be sure that your installation of AVS is functioning properly before blaming CCE.Try opening your .avs script in Windows Media Player or Virtual dub. If they can't open the file, CCE probably won't be able to either. Here is AviSynth.org's Troubleshooting guide. (http://www.avisynth.org/index.php?page=Troubleshooting)
Also, CCE isn't the most stable program on the block. Since this post will focus on issues of CCE and AviSynth interoperability it is also assumed that CCE is working correctly. If you are having general issues of CCE crashing with all file types including .avs scripts you should address those issues first (and good luck).
(add something which version of avs to use, recommend latest stable build, currently 2.08)
Versions of CCE
CCE 2.5
Problem: Crashes when adding .avs file.
Solution:
This is a known bug with CCE 2.5. The problem is that Avisynth scripts used with this version need to have an audio track.
The old method to do this was to simply call ResampleAudio(4100), which would add a blank audio track to the output. This actually exploited a bug which has been fixed. So here is an updated method, which should work with all versions of Avisynth 2.01 and higher.
Create a text file in your Avisynth 'Plugin' directory named ' AddAudio.avsi ', then past the following function into the file.
function AddAudio(clip v1) {
v2 = Blankclip()
v1 = AudioDub(v1,v2)
return v1
}
Then add the line ' AddAudio() " to your script. To be sure it worked, open the .avs file in Vdub and on the menu go to ' File->File Information... ' and make sure the Audio stream information is not blank. CCE 2.5 should now accept the script.
CCE 2.62
Problem: CCE won't open my .avs script.
Solution:This version does not accept .avs scripts. As a workaround you can use a second program to convert your .avs script into a pseudo-avi, which CCE can use.
makeAVIS (by Milan) (http://cultact-server.novi.dk/kpo/avisynth/avs_cvs.html), included in his "ffvfw" codec, can do this. It is currently still under development,discussion (http://forum.doom9.org/showthread.php?s=&threadid=49964).
There is also a commercial program called Link2 (http://www.videotools.net/index.php?rub=guides&htm=intro2link2.htm) which is known to work well.
CCE 2.64
CCE 2.66
Problem: CCE is leaking memory FAST!
Solution: This has been observed by several people. It seems to be related to using .avs scripts that don't contain audio. So it is recommended to add audio to your .avs scripts as described in the CCE 2.5 section. However, this solution will not eliminate the memory leak, only reduce it to a more manageable level.
Notes on using AviSynth 2.5
There are now two major branches of the Avisynth development tree.
The 2.0x branch is an improvement to the traditional 1.x series, with bug fixes and some additional functionality. Scripts and plugins are usually compatible between Versions 1.x and 2.0x. Most guides and programs that use AVS are referring to this series.
The major change in the 2.5 branch is the ability to use YV12 colorspace. This means the video is processed in the original format that is on the DVD. When encoding with programs that can accept YV12 input you will see a significant increase in speed. However, the 2.5 series has several limitations. Plugins are not compatible with 2.0x (or vice versa, including Mpeg2Dec.dll) and scripts may need to be adjusted to be compatible with AVS 2.5. Read this FAQ (http://forum.doom9.org/showthread.php?s=&threadid=37276) if you are planing to use AVS 2.5.
If you choose to use AVS 2.5, regardless of what version of CCE you use (up to 2.67.00.10), you will need to convert the colorspace to YUY2 before opening the script in CCE. This is easy, just add the line
ConvertToYUY2()
the the end of your script.