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 19th September 2011, 05:54   #1  |  Link
zinga
Registered User
 
Join Date: Sep 2006
Posts: 31
avs2yuv/Avisynth memory limit?

I've got a SetMemoryMax(128) call at the beginning of my Avisynth script, but it seems avs2yuv.exe is taking around 500MB of memory.
My machine has 4GB of RAM installed - I believe Avisynth defaults the limit to 512MB, which seems oddly close to the avs2yuv memory usage.
The script itself is fairly simple (source -> resize -> trim) so shouldn't need a lot of memory.
Is avs2yuv doing its own buffering or similar?

On a related note, is there a way to set a default memory limit? All of my scripts are fairly simple, so don't need much, and I tend to forget putting a SetMemoryLimit() at the beginning of every small script.
I was thinking that perhaps a .avsi file in the plugins directory should do it, but due to avs2yuv taking more memory, I'm not sure how to correctly test it.

Thanks!
zinga is offline   Reply With Quote
Old 19th September 2011, 15:07   #2  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
SetMemoryMax
SetMemoryMax only sets the size of the frame buffer cache. It is independent of any other memory allocation. Memory usage due to the frame cache should ramp up pretty quickly to the limited value and stay there. Setting a lower SetMemoryMax value will make more memory available for other purposes and provide less cache buffer frames. It is pointless having more buffers available than are needed by the scripts temporal requirements. If each and every frame generated at each and every stage of a script is only ever used once then the cache is entirely useless. By definition a cache is only useful if a generated element is needed a second or subsequent time.

Quote:
Is avs2yuv doing its own buffering or similar?
Sorry, I have no idea.
Quote:
On a related note, is there a way to set a default memory limit? ... I was thinking that perhaps a .avsi file in the plugins directory should do it.
Yes.
IanB is offline   Reply With Quote
Old 20th September 2011, 12:46   #3  |  Link
zinga
Registered User
 
Join Date: Sep 2006
Posts: 31
Thanks for the responses

Quote:
Originally Posted by IanB View Post
SetMemoryMax only sets the size of the frame buffer cache. It is independent of any other memory allocation.
I see, so it's taking up ~384MB RAM for other reasons?
zinga is offline   Reply With Quote
Old 19th September 2011, 22:05   #4  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 595
avs2yuv does not prepare even the buffer for file writing.
The memory usage of avs2yuv itself is very small.

off topic
For this reason, avs2yuv has only 512bytes of writing buffers defined by stdio.h.
As a result, it has caused the loss of speed.
This is my modified version of avs2yuv(based on MasterNobody's C99 version)
***removed***
This mod is a little faster than the others since this prepares 128KiB buffer for each output.
__________________
my repositories

Last edited by Chikuzen; 22nd September 2011 at 17:53.
Chikuzen is offline   Reply With Quote
Old 20th September 2011, 21:29   #5  |  Link
MasterNobody
Registered User
 
Join Date: Jul 2007
Posts: 552
Chikuzen
Hi. I included part of your changes in avs2yuv-0.24bm2.zip. Here is changelog.
MasterNobody is offline   Reply With Quote
Reply

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 03:25.


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