Thread: Avisynth+
View Single Post
Old 7th January 2019, 20:10   #4388  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
Quote:
Originally Posted by Stereodude View Post
This script crashes for me using AVSynth+ when loading it in VD2 x64 once LEN is somewhere between 15900-16000. It will crash loading it in AVSmeter (x64) as well when LEN is a slightly lower frame number. I think there's some sort of internal overflow. I was using r2700, but I've since upgraded to r2772. Both do the same thing. There's no popup or error message. VD2x64 just disappears. AVSmeter (x64) just kicks back to the command prompt after getting to the "prescanning script..." message very briefly.

Using the x86 version of AVIsynth+ allows LEN to be larger than the x64 version, but fails by 19000.
Code:
LEN2=103848
LEN=15900
A=BlankClip(Length=LEN2, height=786, width=1920, Pixel_type="YV12",COLOR=$FF0000).ShowFrameNumber
B=BlankClip(Length=LEN2, height=786, width=1920, Pixel_type="YV12",COLOR=$00FF00).ShowFrameNumber

Z = A.BlankClip(Length=0)
frame=0

while( frame < LEN) {
for(n=2, 958, 2) {
	Z = Z ++ stackhorizontal(stackhorizontal(A.crop(0,0,n,-0),B.crop(n,0,960,-0)),A.crop(960+n,0,-0,-0)).trim(frame,end=frame)
	frame = frame + 1
	if ( frame == LEN) { Return Z }
}

for(n=958, 2, -2) {
	Z = Z ++ stackhorizontal(stackhorizontal(A.crop(0,0,n,-0),B.crop(n,0,960,-0)),A.crop(960+n,0,-0,-0)).trim(frame,end=frame)
	frame = frame + 1
	if ( frame == LEN) { Return Z }
}
}

Return Z
My computer is running Windows 10 Pro and has 32GB of RAM.
Don't try to write procedural code in a functional language.
TheFluff is offline