Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
![]() |
#1 | Link |
Christopher Hanson
Join Date: Aug 2010
Location: Berlin
Posts: 3
|
Avisynth processing mode question
Hello everyone,
first post, first question. I'm trying to optimize the performance of my Avisynth scripts but I have only minor knowledge of the way Avisynth (or any software for that matter) process commands and how the memory management works. The question is basically if Avisynth works significantly 'better'/faster with external (i.e. already masked, resized sources, etc.) or internally calculated solutions.*1 For example, does it pay to, e.g. resize, crop, edit images (sic) with external applications in advance or let all the things aforementioned be done by Avisynth alone? My guess is, the difference is most of the time a mere seconds for a single frame, but if Avisynth completely re-processes the same command line for, let's say, 500 frames - even if there is no change in the settings - the amount of additional processing time would rise dramatically. So, does Avisynth ... a) ... fully process all operations like specified for every one of the 500 frames in the example again and again OR ... b) ... does it process the commands of a line once and then - saving the intermediary result - uses this for the final 499 times, just until specified otherwise? I would imagine that for a video editing software a) is more likely but I simply don't know. And if a) is indeed the standard mode, is there possibly a way to force Avisynth into processing like mentioned in b) (see last lines)? Any info on the matter is appreciated. thanks, Christopher *1: Here sources are meant to be images, NOT film. --------------edit P.S. scripting examples a) A1=ImageSource("HQ.JPG", start=0, end=500).Crop(500,45,-250,-100).BilinearResize(400,300).AddBorders(200, 150, 200, 150) A1 Another question. Will the following make a difference in processing time to the example a) just above? a) A1=ImageSource("HQ.JPG", start=0, end=1).Crop(500,45,-250,-100).BilinearResize(400,300).AddBorders(200, 150, 200, 150) A2=A1.Loop(500) A2 Last edited by ccitydesign; 31st March 2011 at 15:11. Reason: example added |
![]() |
![]() |
![]() |
#2 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,437
|
Your second example (using Loop) will be faster, as the preceding filters will each only be asked to provide a frame once and the end result will be used 500 times.
In the first example, the image file is still read and processed only once, but the subsequent filters process the frame 500 times each as they have no way of knowing that each time it is the same as the previous one. (Actually, the first example as written processes 501 frames and the second one 2x500=1000; instead of end=500 and end=1, they should be using end=499 and end=0.) Last edited by Gavino; 31st March 2011 at 16:54. |
![]() |
![]() |
![]() |
Tags |
external files, image, processing mode, time |
Thread Tools | Search this Thread |
Display Modes | |
|
|