Log in

View Full Version : Avisynth crashes but RAM is fine (Dither Tool)


FranceBB
21st September 2017, 19:27
Hi,
it seems that Avisynth crashes due to Dither Tool. I tried to use SetMemoryMax(128) to reduce the cache, but it didn't help, 'cause RAM was already fine, between 1.2 and 1.4 GB. It crashes before the end in all the five tests I made. At 99.8% and 99.2% in a 6 minutes content and at about 78.9% in a 22 minutes content. Seeking back and forth in AVSPmod is fine and doesn't give any error. It crashes in both Windows XP x86 and Windows Server 2008 R2 (based on Windows 7).

My AVS Script:


FFMpegSource2("ExtraEdition.mov", fpsnum=30000, fpsden=1001, atrack=-1)

ResampleAudio(48000)
Normalize(0.89, show=false)

Dither_convert_8_to_16()

dfttest(sigma=64, tbsize=1, lsb_in=true, lsb=true, Y=true, U=true, V=true, opt=3, dither=0)

LinearResize(3840, 2160, kernel="spline64", mode=0, lsb_in=true, lsb_out=true, TVrange=true, matrix="709", matrix_out="709", cplace_in="mpeg2", cplace_out="mpeg2", NoRing=false, interlaced=false)

f3kdb(range=15, Y=45, Cb=30, Cr=30, grainY=0, grainC=0, sample_mode=2, blur_first=true, dynamic_grain=false, opt=3, mt=true, keep_tv_range=true, input_mode=1, input_depth=16, output_mode=1, output_depth=16)


s16 = last
DitherPost (mode=-1)

TextSub("Extra Edition - Epilogue.ass")

Dither_convert_8_to_16 ()
s16.Dither_limit_dif16 (last, thr=1.0, elast=2.0)

Dither_Out()


and my x265 command line:


@echo off
@avs4x265.exe --input-depth 16 --dither --preset medium --level 5.1 --tune fastdecode --ref 2 --rc-lookahead 3 -b 2 --profile main10 --crf 23 --deblock -1:-1 --overscan show --colormatrix bt709 --range limited --transfer bt709 --colorprim bt709 --videoformat component --no-open-gop --min-keyint 1 --repeat-headers --rd 3 --vbv-maxrate 25000 --vbv-bufsize 32000 --asm=sse4.2 --wpp --csv encodinglog.csv --log-level 2 --csv-log-level 2 -o "raw_video.hevc" "AVS Script.avs"
@echo+
@audio.exe -i "AVS Script.avs" -vn -sn -c:a aac -b:a 320k -ar 48000 "output_file.aac"
pause



I used two different samples and they have two different lengths, but both crashed at different percentages, so I don't think it's related to the source. I'm now trying to encode one more time with the same sample and the same filters, but at 8bit instead of 16bit, just to be sure that it's Dither Tool that is making Avisynth crash.
"encodinglogs.csv" file doesn't contain any info about the crash; it just reports all the frames served by Avisynth to x265 and how they have been encoded.
Any advice? Any suggestion?
Thank you in advance.

poisondeathray
22nd September 2017, 05:58
what kind of "crash ?" (e.g. blue screen, just pauses and takes forever, something else ) , any error message ?

what clues lead you to implicate "dither tool" is causing the crash (and to rule out other causes ?) . What haven't you included in your description ? For example how do you know the crash isn't from x265 or avs4x265 ? or from audio ?



simplify the script and split it out into stages (e.g. using lossless intermediate).

e.g. don't include audio (that can cause crash in some scripts), rule out encoding issue with x265 by using intermediate like ut video. If that still crashes, then split into steps and simplify it more

hello_hello
22nd September 2017, 12:02
This may have something to do with your problem or nothing to do with it, but....

I stopped using DitherTools 1.27.2 and went back to version 1.27.1 because it caused a problem with MeGUI, although as nobody else seems to have any issues I put it down to something peculiar to my PC, or maybe XP.

If I open a script that uses DitherTools (Gradfun3 will do it) in MeGUI's preview, whenever I close the preview it causes MeGUI to crash, although MeGUI doesn't provide any useful information as to why and tends to crash if there's a light shower within a five mile radius anyway.

I can't remember if it caused crashes when encoding but I didn't use it for very long before I went back to version 1.27.1. The same applies to avstp.dll. If either dither.dll or avstp.dll from DitherTools 1.27.2 are in the Avisynth plugins folder, the problem occurs.

Anyway, maybe give version 1.27.1 a spin.

FranceBB
23rd September 2017, 00:25
@poisondeathray...
The error was generic, that's why I didn't post it. Avisynth crashed, so x265 stopped with an error message and I just had to click "ok" to close it. The error was: "the instruction at 0x06baf6c2 referenced memory at 0x00000004. The required data was not placed into memory because of an I/O error status of 0x075b2b11c" in XP, while in Windows Server 2008 R2 it was just a very generic error saying it "stopped working". Anyway, I'm sure it's Avisynth because when I click "ok", x265 keeps encoding a frame or two and then crashes because avsx265 is not able to provide any new frames 'cause Avisynth is no longer frameserving frames.

@hello_hello...
I tried to encode with the same settings, but in 8bit, without Dither Tool and it worked like a charm, so I'll give Dither Tool v1.27.1 a shot.

Groucho2004
23rd September 2017, 02:10
@poisondeathray...
The error was generic, that's why I didn't post it. Avisynth crashed, so x265 stopped with an error message and I just had to click "ok" to close it. The error was: "the instruction at 0x06baf6c2 referenced memory at 0x00000004. The required data was not placed into memory because of an I/O error status of 0x075b2b11c" in XP, while in Windows Server 2008 R2 it was just a very generic error saying it "stopped working". Anyway, I'm sure it's Avisynth because when I click "ok", x265 keeps encoding a frame or two and then crashes because avsx265 is not able to provide any new frames 'cause Avisynth is no longer frameserving frames.Run the script with VirtualDub or AVSMeter, both should (hopefully) report the module in which the crash occurs.