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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 31st March 2011, 14:11   #1  |  Link
ccitydesign
Christopher Hanson
 
ccitydesign's Avatar
 
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
ccitydesign is offline   Reply With Quote
Old 31st March 2011, 16:46   #2  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
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.)
__________________
GScript and GRunT - complex Avisynth scripting made easier

Last edited by Gavino; 31st March 2011 at 16:54.
Gavino is offline   Reply With Quote
Old 31st March 2011, 17:16   #3  |  Link
ccitydesign
Christopher Hanson
 
ccitydesign's Avatar
 
Join Date: Aug 2010
Location: Berlin
Posts: 3
Great. Exactly, what I was hoping for.

Quote:
Originally Posted by Gavino View Post
(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.)
Thanks a lot for pointing that out. That's one of those counter-intuitive details which would take me forever to find out.
ccitydesign is offline   Reply With Quote
Reply

Tags
external files, image, processing mode, time

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:05.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.