View Full Version : Prefetch crashes AvsPmod/FFMpeg
ENunn
16th May 2020, 04:52
I have some native resolution PSVita captures from my PSTV using a plugin or whatever. I did a crop to 960x544 (which is the Vita's native res, it was in a 1280x720 border hence the cropping) and did 3x point resize. It looks great but I really need multithreading working. Whenever I add a prefetch AvsPmod crashes. Tried running it in FFMpeg, nothing happens. Does anyone have any ideas to fix it?
SetFilterMTMode("DEFAULT_MT_MODE", 2)
SetFilterMTMode("AVISource", 4)
AVISource("F:\amarec\amarec(20200515-2225).avi", atrack=0)
Crop(160, 88, -160, -88)
percent=300
PointResize(2*round(width*percent/200.0),2*round(height*percent/200.0))
ConverttoYV12(interlaced=false)
x = float(width) / float(height)
spline64resize(round(x * 1444),1444)
Prefetch(12)
Groucho2004
16th May 2020, 11:14
Remove this:
"SetFilterMTMode("AVISource", 4)"
I wonder why you chose that filter mode (apart from the fact that you shouldn't set a filter mode for internal filters anyway).
Here's the description for mode 4 from the wiki:
MT_SPECIAL_MT: Experimental. Now use only for MP_Pipeline, the filter is like a source filter (no input clip parameter), internally multithreaded, and suffer heavy performance degradation from any of the three regular mt modes. Really, this is a workaround. Available from AviSynth+ version r2440.
tebasuna51
16th May 2020, 12:32
AviSource can run in mode 4?
All Source filters I know need mode 3 (MT_SERIALIZED)
Do you really need multithreading?
The script used don't have slow filters, resizers are fast and can't be the bottle-neck of the recode process.
Also Prefetch(12) is too much, you can have memory problems, try Prefetch(4) I'm sure than your AviSynth process don't need more.
From 960x544
PointResize(2880, 1632)
spline64resize(2548, 1444)
For what a upsize with a simple resizer and a downsize with a good resizer?
I don't like the upsizes but if you need that strange resolution try replace the Crop and the resizers with:
Spline64Resize(2548,1444, src_top=160, src_height=-160, src_left=88, src_width=-88)
that script don't need multithreading at all.
ENunn
16th May 2020, 20:28
I wonder why you chose that filter mode (apart from the fact that you shouldn't set a filter mode for internal filters anyway).
So there's no change by adding it? Interesting.
AviSource can run in mode 4?
All Source filters I know need mode 3
At least for me, yes. I use it for my VHS captures. Might lower it to three though.
Do you really need multithreading?
Speedups through multithreading would be appreciated. I get around 30fps on my 8700k with libx264 ultrafast at crf 20.
Also Prefetch(12) is too much, you can have memory problems, try Prefetch(4) I'm sure than your AviSynth process don't need more.
Will do.
From 960x544
PointResize(2880, 1632)
spline64resize(2548, 1444)
For what a upsize with a simple resizer and a downsize with a good resizer?
Sharp pixels + a good downsize for editing in premiere. I went with 1444 since at 1440p, the width isn't divisible by 2. I could just not do a color conversion to get around that though.
I did lower SetFilterMTMode("AVISource", #) to 3, seems to be working fine. Thanks for the help y'all.
StainlessS
16th May 2020, 20:44
So there's no change by adding it? Interesting.
No there is a change, you made it crash.
Dont screw with the default MT mode, and dont screw with AVISource MT mode, these will already be set by Avisynth+ with proper default and AviSource setting.
[AviSource is a builtin source filter, Avs+ knows how its MT should be set]
tebasuna51
17th May 2020, 01:01
Speedups through multithreading would be appreciated.
AviSynth multithreading is necesary when uses complex filters with many process, to simple resize you don't need use more than one core.
The encoder x264 are MT already. And use a fast SSD like disk.
BTW you can test the internally multi-threaded resamplers (https://forum.doom9.org/showthread.php?p=1776920#post1776920) by jpsdr to avoid problems with memory used.
Sharp pixels + a good downsize for editing in premiere
Sharp pixels with PointResize upsize?
"PointResize is the simplest resizer possible. It uses a Point Sampler or Nearest Neighbour algorithm, which usually results in a very "blocky" image. So in general this filter should only be used, if you intend to have inferior quality, or you need the clear pixel drawings."
At least use only one good resize directly to the desired resolution.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.