Log in

View Full Version : How do I use setmemorymax???


Chengbin
21st August 2009, 18:00
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\DGAVCDecode.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\DGDecode.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\DirectShowSource.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\MSharpen.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\mt_masktools-26.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\mvtools.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\mvtools2.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\VSFilter.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\FDecimate.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\sangnom.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\masktools.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\nnedi.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\eedi2.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\tmm.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\tdeint.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\removegrain.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\reduceflicker.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\reduceflickersse2.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\reduceflickersse3.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\repair.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\vinverse.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\toon-v1.0.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\awarpsharp.dll")
LoadPlugin("G:\HDConvertToX_2.1.458.3528\filters\warpsharp.dll")


Import("G:\HDConvertToX_2.1.458.3528\filters\AnimeIVTC - v1.06.avsi")
Import("G:\HDConvertToX_2.1.458.3528\filters\TempGaussMC_beta1mod.avsi")
Import("G:\HDConvertToX_2.1.458.3528\filters\cdeblend_v1.1b.avsi")
Import("G:\HDConvertToX_2.1.458.3528\filters\mrestore_v23e.avsi")
Import("G:\HDConvertToX_2.1.458.3528\filters\mcbob.avsi")
Import("G:\HDConvertToX_2.1.458.3528\filters\limitedsharpenfaster.avsi")

setmemorymax(512)
directshowsource("D:\Encoded Movies\lossless.mkv")
animeivtc(mode=1,aa=4)
trim(0,34760)

I can't encode this because I don't have enough RAM (32 bit OS)

How does setmemorymax work? I'm pretty sure I used it incorrectly in the script above because it made no difference in RAM use.

steptoe
21st August 2009, 18:11
SetMemoryMax is I believe there to increase how much memeory is set aside for avisynth, so if you are low on memory anway then you really need to look at fitting more memory into your system

Anything less than 1GB is considered pretty low spec these days, and windoze doesn't like running nicely in 512MB, it will run but pretty sluggish with plenty of miving files in your pagefile

Try also increasing your page file, I have mine set to 8GB in one block, increasing this can speed things up as windoze sets it too low (for todays requirements) and set it as one size so the pagesize doesn't move up or down leading to eventual fragmentation of files which slows this down even more

Chengbin
21st August 2009, 18:14
I said I'm limited by 32 bit OS's 2GB RAM limit.

I believe setmemorymax is setting the maximum RAM avisynth can use.

jmartinr
21st August 2009, 19:29
Take the non used loadplugin calls and avsi's out and read the manual on setmemorymax. Then come back with a description of your problem that's more specific than: I can't encode this because I don't have enough RAM (32 bit OS)

Chengbin
21st August 2009, 20:00
Take the non used loadplugin calls and avsi's out and read the manual on setmemorymax. Then come back with a description of your problem that's more specific than:

Can't. AnimeIVTC uses ALL those plugins and scripts.

jmartinr
21st August 2009, 23:06
I still don't get why you need 3 versions of reduceflicker. If the problem is that you need a lot of memory for x264 with MBTree, than first encode to lossless.

If you want better answers you need to be more specific.

Chengbin
21st August 2009, 23:45
Using AnimeIVTC with a 1080p video will use more than 2GB RAM.

I've even tried encoding to lossless (preset ultrafast to save RAM when decoding). It still doesn't work because it went over 2GB.

I tried to encode to 720p, and it works. I plan to NOT use AnimeIVTC after because it is encoding at 0.03fps.

I'm VERY open for suggestions for other AA filters. I tried sangnom(aa=4), and SAA (antialiasing()), but it doesn't seem to work. Maybe I used it incorrectly. AnimeIVTC is the only AA filter that works right now (for 720p though).

Is it possible to cut an image to, say, like 4 parts, and encode them losslessly, then join them together after?

@jmartinr

AnimeIVTC made me load 3 versions of reduce flicker.

kemuri-_9
21st August 2009, 23:54
Is it possible to cut an image to, say, like 4 parts, and encode them losslessly, then join them together after?

naturally, yes

and as for SetMemoryMax, i recall it being said somewhere on the forums by the avs devs that it only sets the maximum size of the frame cache used by avisynth, it in no way limits the memory used by filters.

Chengbin
22nd August 2009, 00:35
I think I can use the filter now, because it is working in virtualdub.

Anyway, this is getting OT. My original problem is (kind of) solved. I'll move the AA problem to a separate thread.

thewebchat
22nd August 2009, 03:02
Just a note: I don't recommend splitting each frame into parts and encoding those separately, as it might cause visible seams where you split them. Rather, try cutting the whole thing into 4 segments and splicing them at the end.

Edit: Oh, if this has to do with mbtree, then never mind.

Chengbin
22nd August 2009, 03:08
Just a note: I don't recommend splitting each frame into parts and encoding those separately, as it might cause visible seams where you split them. Rather, try cutting the whole thing into 4 segments and splicing them at the end.

Edit: Oh, if this has to do with mbtree, then never mind.

I asked for each image to be separated because each image is only 1/4 of the resolution.

RAM usage in avisynth is resolution, not length.

kemuri-_9
22nd August 2009, 03:21
I asked for each image to be separated because each image is only 1/4 of the resolution.

RAM usage in avisynth is resolution, not length.

yes, however for filters that work on the spatial domain, this will inhibit their functionality somewhat.

jmartinr
22nd August 2009, 07:18
yes, however for filters that work on the spatial domain, this will inhibit their functionality somewhat.

One could use overlapping segments.

But seen the fps reported by Chengbin this whole thing doesn't seem very practical.

I think I can use the filter now, because it is working in virtualdub.

How did you get it to work in Virtualdub, and is it practical (say more than 0.1 fps)?

Chengbin
22nd August 2009, 13:59
How did you get it to work in Virtualdub, and is it practical (say more than 0.1 fps)?

First frame loaded (after waiting for 2 minutes)

Blue_MiSfit
24th August 2009, 02:21
Use Avs2YUV piped to x264's lossless mode. This at least gives avisynth its own process, and full access to 2gb of RAM. x264 then gets its own process.

BTW, you probably don't actually need to use AnimeIVTC :) Post a sample, and maybe we can help you do AA more simply / faster.

~MiSfit

Chengbin
24th August 2009, 13:51
I have no idea of how to use Avs2YUV. The guides make no sense to me.

Sagekilla
24th August 2009, 14:25
I believe the syntax is: avs2yuv source.avs - | x264 options_here

You may also have to add -raw to avs2yuv, but I'm not completely sure.

kemuri-_9
24th August 2009, 15:00
You may also have to add -raw to avs2yuv, but I'm not completely sure.
you do, x264 does not accept y4m input over stdin,
you need the -raw option to have it output raw yuv data which x264 does accept over stdin

Chengbin
25th August 2009, 13:39
After numerous tries, I've finally given up. If this is my x264 command line, how would I use avs2yuv?

"G:\HDConvertToX_2.1.458.3528\applications\x264.exe" --crf 0 --preset ultrafast --sar 1:1 --output "G:\HDConvertToX_2.1.458.3528\job5\hdconverttox_520 1,1000.h264" "G:\HDConvertToX_2.1.458.3528\job5\hdconverttox_520 1,1000.avs"

Also, I noticed something strange.

I used setmemorymax(2,3), which is the limit for 2GB of RAM, I can't run x264 with it, because it hit 2GB. The problem is, RAM usage was from 1450MB to 3150MB, which is not 2GB.

thewebchat
25th August 2009, 15:01
avs2yuv -raw -o - "G:\HDConvertToX_2.1.458.3528\job5\hdconverttox_520 1,1000.avs" | "G:\HDConvertToX_2.1.458.3528\applications\x264.exe" --crf 0 --preset ultrafast --sar 1:1 --output "G:\HDConvertToX_2.1.458.3528\job5\hdconverttox_520 1,1000.h264" - WxH

Note that you have to set WxH to the resolution of your AVS input since x264 cannot detect that automatically in YUV input.

Chengbin
25th August 2009, 15:16
How do I set framerate? It is assuming 25fps, where I want 23.976.

Also, it doesn't seem to be using 3 cores. It loads up 3 ffdshows, but it uses 1 core, somethings using a second core.

kemuri-_9
25th August 2009, 17:32
How do I set framerate? It is assuming 25fps, where I want 23.976.

add --fps 24000/1001 the commandline then