View Single Post
Old 19th May 2003, 23:53   #4  |  Link
RB
Retired
 
Join Date: Nov 2002
Posts: 1,349
Q14.1: Why does CCE-SP 2.50 crash when I try to load or encode an AVISynth script?

This is probably a bug in CCE-SP 2.50 and happens when the AVISynth "stream" does not contain audio. The way to fix this is to add "fake" audio. Depending of your version of AVISynth, you can do this as follows:
  • For AVISynth up to version 2.07, add a simple
    Code:
    ResampleAudio(44100)
    at the end of your script.
  • For AVISynth 2.08 and 2.5.x, create a text file in your AVISynth Plugins directory (usually the 'Plugins' directory in the AVISynth installation directory) named AddAudio.avsi, then paste the following into the file
    Code:
    function AddAudio(clip v1) {
    v2 = Blankclip()
    v1 = AudioDub(v1,v2)
    return v1
    }
    Add the line
    Code:
    AddAudio()
    at the end of your script.
Alternatively, make sure that in the currently active CCE-SP 2.50 template (see "Template" menu item), the "Audio File" option is not checked before loading an AVS file into CCE. In that case you don't need the fake audio trick.

Well, now that you did that you can load the Script into CCE-SP 2.50 but it may still crash when you start encoding. This will happen on AMD Athlon "Thunderbird" CPUs because CCE-SP 2.50 uses SSE commands to process audio. SSE is not supported by the Thunderbird line of CPUs, that takes at least an Athlon XP. You'll have to uncheck the "Audio File" option in Encode Settings, process audio in another program and later multiplex it with the CCE encoded video file (which is recommended anyway because CCE's audio encoder is generally not considered to be top of the line).


Q14.2: Why do I get a "Frame size XXXxYYY is not supported. Supported frame size is up to 720x576" error message or only a 10 seconds clip when I try to load an AVISynth script?

This indicates that there is an error in your AVISynth script. In this case AVISynth outputs not actual video but just a short clip displaying an error message. Depending on the length of the error message, the clip may also have a "non-standard" resolution like 852x52 and that's what CCE complains about. Open the script in Windows Media Player to see the error message and fix your script. A good starting point for fixing script errors is the AVISynth Troubleshooting Guide.


Q14.3: CCE-SP 2.66/2.67/CCE-Basic leaks memory when encoding from an AVISynth script. How can I fix this?

Yes, there is a bug in CCE-SP 2.66 throughout 2.67.00.23. When you are monitoring memory usage in task manager during encoding and AVISynth script in these versions, you'll notice that for each file and for each encoding pass (be that one pass VBR, CBR or multipass VBR) the program grabs another large chunk of memory and never releases it until the program is closed. Depending on the number of files and passes, you can eventually run out of memory.

The fix for this again is to add a fake audio track to the AVISynth script as outlined in Q14.1, above. However, another memory leak with AVISynth scripts that cannot be worked around this way occurs every time you open the "File Settings" dialog in CCE (where you specify chapters and encode range etc.).

Both issues are finally fixed in CCE-SP 2.67.00.27, not fake audio tracks necessary anymore


Q14.4 AVISynth 2.5.x and (interlaced) conversion from YV12 to YUY2

An important difference between AVISynth 2.0x and 2.5 is that naturally AVISynth 2.5 operates in the YV12 colorspace whereas AVISynth 2.0x operates in YUY2 (mandatory read: AVISynth YV12 FAQ). YV12 happens to be the native format used on DVD so one can expect a significant increase in speed when frame serving video originating from DVD VOBs because theoretically no color space conversion needs to be performed. Unfortunately for CCE users this is only half the truth because no version of CCE can currently natively read YV12 input, CCE itself can only decode RGB and YUY2. You'll have to add a
Code:
ConvertToYUY2(interlaced=true/false)
at the end of your script which unfortunately destroys most of the speed advantage. At least, even when using simple filters like Resizing, things are going to be faster than with AVISynth 2.0x, just make sure you put them before the color space conversion. The filters can obviously work simply faster in YV12 mode.

Note also that as shown above, ConvertToYUY2 in AVISynth 2.5.x has an optional 'interlaced=true/false' (default false) parameter used to ensure that interlaced coded video is converted correctly. It is important that you set this parameter right especially for interlaced coded video (example of incorrectly using ConvertToYUY2() for interlaced coded video, note the green stripes). I'm stressing the word coded here because that's what counts for ConvertToYUY2(), not what the video looks like in a software player. For instance, many DVDs are encoded interlaced although you can clearly see that the source material is progressive, i.e. no interlacing artifacts visible in DVD2AVI preview. So in case you are frameserving MPEG2 video, open the source MPEG/VOB in DVD2AVI and start the preview (F5). Watch the status window, if it mostly reports "Progressive", use ConvertToYUY2(), else if it's mostly "Interlaced", use ConvertToYUY2(interlaced=true). If in doubt, use ConvertToYUY2(interlaced=true) because it ensures interlaced coded material is handled correctly and the negative impact on progressive coded material is negligible.

However, one possibility to feed YV12 directly into CCE is some external codec that decodes YV12 data for it. This seems to work reliably only with CCE-SP 2.67.00.10 and newer, both DivX and XviD should do the job, as well as the lite version of the ffvfw codec included in the latest AVISynth 2.5 installers. In my tests however (using the ffvfw codec) and others, there seems to be not any difference in speed or even decreased speed compared to a ConvertToYUY2() in AVISynth. Also, the externals codecs may assume progressive video (at least DivX and XviD do) and mess up chroma for interlaced video for reasons outlined above. So for the time being, my advice is to stick to the conversion in AVISynth, eliminating another source for possible problems by minimizing the number of video processors involved.


Q15: Links and essential reading

Last edited by RB; 16th April 2004 at 12:32.
RB is offline