Log in

View Full Version : MVTools crash


bully`
28th November 2017, 16:55
Hello everyone!

I was wonder if anyone could perhaps help me out by finding a solution to an issue I’m facing with MVTools.
Firstly, my level of understanding of avisynth is basically a little bit more than that of a beginner, so please bear with me!
I’m trying to create motion blur for my gaming footage by using MVTools- and I am quite satisfied with the result, but it unfortunately still shows some artifacts. What seems to work in getting rid of most of these artifacts is upping the value of blksize. However, when I attempt to change the blksize to 32 or higher (a value of 16 or below works fine), virtualdub (or WMP) crashes.
Here’s what it shows:
https://www.dropbox.com/s/xh8h4fp5120jqft/crash-mvtools.jpg?dl=0

This is the script I’m using:

SetMTMode(2)
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\mvtools2.dll")
ImageSource("D:\Movie Making\Return to Castle Wolfenstein - Movie Edition - Old DemoViewer\demoViewer\screenshots\shot%.4d.tga",0,4833,500)
ConvertToYV12()
super = MSuper(pel=2)
backward_vectors = MAnalyse(super, isb = true, blksize=32, truemotion=true)
forward_vectors = MAnalyse(super, isb = false, blksize=32, truemotion=true)
MFlowBlur(super, backward_vectors, forward_vectors, blur=100)
MFlowFPS(super, backward_vectors, forward_vectors, num=500, den=5)

I’ve installed several versions of avisynth and virtualdub, including 64 bit versions- and tried different Setmemorymax() values. I’ve also noticed that if I set the value even higher, like 48, it crashes instantly whilst 32 still allows me to scan trough a few frames before it crashes.
I hope someone might have the solution!

With friendly regards.

Groucho2004
28th November 2017, 17:28
What resolution does the .tga file have? Have you tried without "SetMTMode()"?

pinterf
28th November 2017, 17:32
SeMTMode is not relevant here if Prefetch is not specified.

Could not reproduce, avs+ r2544, mvtools2 2.7.23 here. x86 or x64.
Script is working from avsmeter and vdubmod, set BlkSize to 48.
The difference is that my source is not ImageSource. Tried on a source with fullhd and 4k, no freeze here, even with prefetch(10)

What are the dimensions of your video? And which versions are using (use AvsMeter/AvsMeter64 to tell it)?

bully`
28th November 2017, 17:33
Hello!

The resolution is 1920 x 1080, and unfortunately without SetMTMode it still does the same.

pinterf
28th November 2017, 17:47
Now tried with tga images, it works for me.
Full HD with Prefetch(10) required approx. 1600 MBytes of memory, single thread mode only 285MB.
So it's probably not a memory issue. Check dll versions.

bully`
28th November 2017, 17:52
Thanks for the reply so far everyone.

I will look into the avsmeter, I've not used it before so I need to read some documentation.

bully`
28th November 2017, 18:22
I hope I did it right; right clicked and opened the script with AVSMeter. It then proceeds to scan and closes when it reaches frame 100.

What it shows before it closes:

https://www.dropbox.com/s/beazajr1q58v1zq/avsscan.jpg?dl=0

More detailed information:

Log file created with: AVSMeter 2.6.8 (x86)
Script file: C:\Users\Lorenzo\Desktop\AVSMeter268\mtmode2.avs

[OS/Hardware info]
Operating system: Windows 10 (x64) (Build 14393)
CPU brand string: Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz
CPU features: MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, POPCNT, AES, F16C


[Avisynth info]
VersionString: AviSynth 2.60, build:Feb 20 2015 [03:16:45]
VersionNumber: 2.60
File / Product version: 2.6.0.5 / 2.6.0.5
Interface Version: 6
Multi-threading support: Yes
Avisynth.dll location: C:\WINDOWS\SysWoW64\avisynth.dll
Avisynth.dll time stamp: 2015-02-20, 00:18:42 (UTC)
PluginDir2_5 (HKLM, x86): C:\Program Files (x86)\AviSynth\plugins


[Clip info]
Number of frames: 967
Length (hh:mm:ss.ms): 00:00:09.670
Frame width: 1920
Frame height: 1080
Framerate: 100.000 (100/1)
Colorspace: YV12
Active MT Mode: 0
Audio channels: n/a
Audio bits/sample: n/a
Audio sample rate: n/a
Audio samples: n/a


[Script]
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\mvtools2.dll")
ImageSource("D:\Movie Making\Return to Castle Wolfenstein - Movie Edition - Old DemoViewer\demoViewer\screenshots\shot%.4d.tga",0,4833,500)
ConvertToYV12()
super = MSuper(pel=2)
backward_vectors = MAnalyse(super, isb = true, blksize=32, truemotion=true)
forward_vectors = MAnalyse(super, isb = false, blksize=32, truemotion=true)
MFlowBlur(super, backward_vectors, forward_vectors, blur=100)
MFlowFPS(super, backward_vectors, forward_vectors, num=500, den=5)


[Performance data]
Frame Frames/sec Time/frame(ms) CPU(%) Threads PhysMEM(MiB) VirtMEM(MiB)
1 10.092 99.091692 25 4 61 145
2 4.870 205.354397 25 4 142 206
3 4.707 212.452437 25 4 234 298
4 4.603 217.238765 25 4 325 390
5 4.611 216.863094 25 4 417 482
6 4.640 215.519374 25 4 509 574
7 4.769 209.671588 25 4 543 607
8 5.022 199.104692 25 4 543 607
9 4.975 200.993682 25 4 543 607
10 4.985 200.609668 23 4 543 607
11 5.018 199.297009 25 4 543 607
12 5.063 197.500505 25 4 543 607
13 5.058 197.712975 25 4 543 607
14 5.015 199.415414 25 4 543 607
15 5.041 198.376364 25 4 543 607
16 4.994 200.245185 25 4 543 607
17 4.818 207.574916 25 4 543 607
18 4.824 207.297162 25 4 543 607
19 4.857 205.872487 25 4 543 607
20 4.842 206.507376 25 4 543 607
21 4.801 208.298458 25 4 543 607
22 5.096 196.248950 25 4 543 607
23 5.106 195.866553 26 4 543 607
24 5.058 197.713944 24 4 543 607
25 5.108 195.757111 25 4 543 607
26 5.040 198.402282 25 4 543 607
27 3.872 258.260950 24 4 543 607
28 3.986 250.906899 23 4 543 607
29 3.970 251.900513 25 4 543 607
30 3.942 253.662785 24 4 543 607
31 3.979 251.335701 25 4 543 607
32 3.188 313.659072 24 4 543 607
33 3.275 305.318742 25 4 543 607
34 3.235 309.098336 25 4 543 607
35 3.297 303.276786 25 4 543 607
36 3.036 329.368451 24 4 543 607
37 3.200 312.488797 25 4 543 607
38 2.881 347.088454 24 4 543 607
39 2.908 343.879125 24 4 543 607
40 2.850 350.879259 25 4 543 607
41 2.855 350.232511 23 4 543 607
42 3.143 318.189066 25 4 543 607
43 3.158 316.700393 25 4 543 607
44 3.052 327.625711 25 4 543 607
45 3.163 316.166620 24 4 543 607
46 3.128 319.670701 25 4 543 607
47 3.761 265.860767 24 4 543 607
48 3.717 269.017308 25 4 543 607
49 3.713 269.341149 22 4 543 607
50 3.697 270.490927 25 4 543 607
51 3.720 268.851544 24 4 543 607
52 5.203 192.204082 25 4 543 607
53 5.254 190.340377 26 4 543 607
54 5.155 193.975952 24 4 543 607
55 5.258 190.181005 25 4 543 607
56 5.183 192.931136 25 4 543 607
57 4.715 212.107154 25 4 543 607
58 4.651 215.005452 25 4 543 607
59 4.755 210.294330 25 4 543 607
60 4.691 213.191977 25 4 543 607
61 4.728 211.525392 25 4 543 607
62 4.347 230.019807 25 4 543 607
63 4.382 228.218816 25 4 543 607
64 4.348 230.001871 24 4 543 607
65 4.191 238.582841 24 4 543 607
66 4.361 229.322177 25 4 543 607
67 4.051 246.869069 25 4 543 607
68 4.017 248.967991 24 4 543 607
69 4.054 246.641851 25 4 543 607
70 4.009 249.441592 24 4 543 607
71 4.050 246.916418 25 4 543 607
72 4.501 222.150873 24 4 543 607
73 4.592 217.750136 25 4 543 607
74 4.534 220.555642 24 4 543 607
75 4.578 218.418637 25 4 543 607
76 4.567 218.955928 25 4 543 607
77 5.285 189.226749 24 4 543 607
78 5.262 190.024845 25 4 543 607
79 5.331 187.598248 26 4 543 607
80 5.264 189.954121 25 4 543 607
81 5.313 188.208485 24 4 543 607
82 4.971 201.162013 25 4 543 607
83 5.026 198.967078 25 4 543 607
84 4.974 201.057040 24 4 543 607
85 5.019 199.228849 25 4 543 607
86 4.962 201.525854 25 4 543 607
87 4.935 202.649070 25 4 543 607
88 4.858 205.830560 25 4 543 607
89 4.644 215.312662 25 4 543 607
90 4.804 208.168219 23 4 543 607
91 4.777 209.317351 25 4 543 607
92 4.724 211.697557 25 4 543 607
93 4.438 225.303232 25 4 543 607
94 4.579 218.368397 25 4 543 607
95 4.644 215.317768 25 4 543 607
96 4.605 217.134130 25 4 543 607
97 4.759 210.145199 26 4 543 607
98 4.752 210.456259 24 4 543 607
99 4.760 210.098483 24 4 543 607
100 4.726 211.616596 25 4 543 607
101 4.947 202.155631 26 4 543 607


[Errors]
Exception 0xC0000005 [STATUS_ACCESS_VIOLATION]
Module: C:\Program Files (x86)\AviSynth\plugins\mvtools2.dll
Address: 0x5FAAB2CA

Groucho2004
28th November 2017, 18:47
Run "AVSMeter -avsinfo -log" and post the log file ("avsinfo_x86.log").

bully`
28th November 2017, 20:34
Run "AVSMeter -avsinfo -log" and post the log file ("avsinfo_x86.log").

Sorry, whatever I seem to try, it doesn't generate a log file.
I ran cmd.exe and did the following:

C:\AVSMeter\avsmeter.exe -avsinfo -log

It definitely does its thing but it doesn't seem to produce a log.
Perhaps a screenshot will be useful for you as well:

https://www.dropbox.com/s/ff186af7ofu81yz/avsscan2.jpg?dl=0

bully`
28th November 2017, 20:38
SeMTMode is not relevant here if Prefetch is not specified.

Could not reproduce, avs+ r2544, mvtools2 2.7.23 here. x86 or x64.
Script is working from avsmeter and vdubmod, set BlkSize to 48.
The difference is that my source is not ImageSource. Tried on a source with fullhd and 4k, no freeze here, even with prefetch(10)

What are the dimensions of your video? And which versions are using (use AvsMeter/AvsMeter64 to tell it)?

I'll try to install the same setup as yours and see if that helps, thank you!

pinterf
28th November 2017, 20:48
Anyway I'll check it with classic avisynth, there is no crash without reason.

bully`
28th November 2017, 21:06
Anyway I'll check it with classic avisynth, there is no crash without reason.

I'm using your setup now, but it still crashes :(.
Here's the log from AVSMeter.

Log file created with: AVSMeter 2.6.8 (x64)
Script file: D:\mtmode2.avs

[OS/Hardware info]
Operating system: Windows 10 (x64) (Build 14393)
CPU brand string: Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz
CPU features: MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, POPCNT, AES, F16C


[Avisynth info]
VersionString: AviSynth+ 0.1 (r2544, MT, x86_64)
VersionNumber: 2.60
File / Product version: 0.1.0.0 / 0.1.0.0
Interface Version: 6
Multi-threading support: Yes
Avisynth.dll location: C:\WINDOWS\SYSTEM32\avisynth.dll
Avisynth.dll time stamp: 2017-11-15, 16:16:03 (UTC)
PluginDir2_5 (HKLM, x64): C:\Program Files\AviSynth+\plugins64
PluginDir+ (HKLM, x64): C:\Program Files\AviSynth+\plugins64+


[Clip info]
Number of frames: 967
Length (hh:mm:ss.ms): 00:00:09.670
Frame width: 1920
Frame height: 1080
Framerate: 100.000 (100/1)
Colorspace: YV12
Audio channels: n/a
Audio bits/sample: n/a
Audio sample rate: n/a
Audio samples: n/a


[Script]
ImageSource("D:\Movie Making\Return to Castle Wolfenstein - Movie Edition - Old DemoViewer\demoViewer\screenshots\shot%.4d.tga",0,4833,500)
ConvertToYV12()
super = MSuper(pel=2)
backward_vectors = MAnalyse(super, isb = true, blksize=32, truemotion=true)
forward_vectors = MAnalyse(super, isb = false, blksize=32, truemotion=true)
MFlowBlur(super, backward_vectors, forward_vectors, blur=100)
MFlowFPS(super, backward_vectors, forward_vectors, num=500, den=5)


[Performance data]
Frame Frames/sec Time/frame(ms) CPU(%) Threads PhysMEM(MiB) VirtMEM(MiB)
1 5.658 176.749091 31 11 90 176
2 5.295 188.849468 25 11 153 220
3 5.648 177.041247 25 11 153 220
4 5.673 176.280915 25 11 153 220
5 5.620 177.936309 25 11 153 220
6 5.664 176.539478 31 11 153 220
7 5.540 180.495722 25 11 153 220
8 5.585 179.046091 24 11 153 220
9 5.549 180.213153 31 11 153 220
10 5.567 179.616334 27 11 153 220
11 5.426 184.285222 27 11 153 220
12 5.517 181.258613 25 11 153 220
13 5.426 184.312415 31 11 153 220
14 5.506 181.617659 28 11 153 220
15 5.414 184.690033 30 11 153 220
16 5.430 184.161066 25 11 153 220
17 5.206 192.073516 25 11 153 220
18 5.283 189.279864 30 11 153 220
19 5.206 192.073516 31 11 153 220
20 5.322 187.888494 31 11 153 220
21 5.204 192.161532 31 11 153 220
22 5.530 180.831399 31 11 153 220
23 5.414 184.719478 31 11 153 220
24 5.474 182.673351 24 11 153 220
25 5.575 179.361296 31 11 153 220
26 5.608 178.321594 25 11 153 220
27 4.537 220.398187 30 11 153 220
28 4.539 220.336429 29 11 153 220
29 4.298 232.663680 30 11 153 220
30 4.494 222.518869 30 11 153 220
31 4.308 232.133749 30 11 153 220
32 3.502 285.578870 28 11 153 220
33 3.438 290.845850 25 11 153 220
34 3.476 287.667556 24 11 153 220
35 3.403 293.859338 29 11 153 220
36 3.407 293.539663 25 11 153 220
37 3.238 308.877857 28 11 153 220
38 3.253 307.452868 26 11 153 220
39 3.211 311.470862 28 11 153 220
40 3.226 309.961075 23 11 153 220
41 3.191 313.378085 24 11 153 220
42 3.590 278.534280 26 11 153 220
43 3.580 279.297808 29 11 153 220
44 3.587 278.788677 29 11 153 220
45 3.560 280.898467 29 11 153 220
46 3.578 279.469651 25 11 153 220
47 4.046 247.169222 25 11 153 220
48 4.254 235.064062 25 11 153 220
49 4.212 237.443603 34 11 153 220
50 4.206 237.747617 29 11 153 220
51 4.199 238.155301 30 11 153 220
52 5.747 173.990959 31 11 153 220
53 5.677 176.155484 24 11 153 220
54 5.694 175.608264 31 11 153 220
55 5.597 178.666561 27 11 153 220
56 5.775 173.154137 28 11 153 220
57 5.162 193.709703 24 11 153 220
58 5.196 192.463927 25 11 153 220
59 5.166 193.569867 25 11 153 220
60 5.230 191.208546 31 11 153 220
61 5.195 192.493376 26 11 153 220
62 4.962 201.525215 25 11 153 220
63 4.927 202.964597 31 11 153 220
64 4.979 200.839442 25 11 153 220
65 4.891 204.467979 24 11 153 220
66 4.964 201.455775 25 11 153 220
67 4.533 220.611303 25 11 153 220
68 4.610 216.897657 25 11 153 220
69 4.531 220.689075 25 11 153 220
70 4.598 217.484846 23 11 153 220
71 4.540 220.257078 26 11 153 220
72 4.854 206.008813 26 11 153 220
73 5.063 197.498905 28 11 153 220
74 5.141 194.508451 33 11 153 220
75 5.059 197.657295 21 11 153 220
76 5.146 194.331798 26 11 153 220
77 5.758 173.676710 22 11 153 220
78 5.882 170.010091 25 11 153 220
79 5.724 174.711287 22 11 153 220
80 5.855 170.787377 25 11 153 220
81 5.696 175.570510 31 11 153 220
82 5.509 181.522928 31 11 153 220
83 5.462 183.084562 25 11 153 220
84 5.421 184.484589 31 11 153 220
85 5.407 184.962354 29 11 153 220
86 5.327 187.730730 27 11 153 220
87 5.177 193.147776 31 11 153 220
88 5.258 190.184851 22 11 153 220
89 5.238 190.913504 25 11 153 220
90 5.362 186.496150 25 11 153 220
91 5.306 188.482411 21 11 153 220
92 5.209 191.970801 25 11 153 220
93 5.078 196.924815 38 11 153 220
94 5.150 194.160282 27 11 153 220
95 5.103 195.945594 29 11 153 220
96 5.142 194.484443 30 11 153 220
97 5.173 193.317061 31 11 153 220
98 5.252 190.391889 31 11 153 220
99 4.887 204.628304 30 11 153 220
100 5.234 191.057186 25 11 153 220
101 5.386 185.660291 31 11 153 220
102 5.682 176.006032 25 11 153 220
103 5.558 179.918748 24 11 153 220
104 5.536 180.635877 31 11 153 220
105 5.735 174.369522 25 11 153 220
106 5.828 171.596679 25 11 153 220
107 5.824 171.699083 23 11 153 220
108 5.875 170.212973 25 11 153 220
109 5.861 170.605619 25 11 153 220
110 5.802 172.355733 37 11 153 220
111 5.562 179.775697 29 11 153 220
112 5.378 185.939654 22 11 153 220


[Errors]
Exception 0xC0000005 [STATUS_ACCESS_VIOLATION]
Module: C:\Program Files\AviSynth+\plugins64+\MVTools2_64.dll
Address: 0x00007FFF795ECA3C

pinterf
28th November 2017, 21:28
For this x64 setup, does it crash at the same frame when you run it multiple times?

Groucho2004
28th November 2017, 21:46
Sorry, whatever I seem to try, it doesn't generate a log file.
I ran cmd.exe and did the following:

C:\AVSMeter\avsmeter.exe -avsinfo -log

It definitely does its thing but it doesn't seem to produce a log.
Perhaps a screenshot will be useful for you as well:

https://www.dropbox.com/s/ff186af7ofu81yz/avsscan2.jpg?dl=0
The log file is created in the current directory which in your case is "c:\windows\system32".
Anyway, I can't see anything wrong judging from the screen shot.

bully`
28th November 2017, 22:01
For this x64 setup, does it crash at the same frame when you run it multiple times?

Yes it does, it keeps crashing at 112.
Also, as of yet blksize=16 still works fine, even with this new setup.

pinterf
28th November 2017, 22:09
Great. Now I'd like to ask you to prepare those tga's for me. Before the crashing frame and some from after it as well. If they are too large try to figure out tge minimum frames and starting point where the crash is still reproducible. Then I can debug it if it's crashing for me as well. Thanks

bully`
28th November 2017, 22:20
You'd like me to to upload the tga's for you?
AVSMeter also states that the number of frames is 967, but that is probably my scripts doing (dividing by 5). The original source is 500 fps and has 4833 tga's.
So I'm guessing we'll want to have tga's from... let's say frame 520-559 and 561 to 601 (560 = 112x5) then?

bully`
28th November 2017, 22:32
Anyway, here they are:
https://www.dropbox.com/s/nlzjpkw6s02m4fu/screenshots.zip?dl=0

Thanks a lot for the help!

StainlessS
28th November 2017, 22:35
Just out of interest, what happens if you start image list part way through eg @ 50 or 100,

ImageSource("D:\Movie Making\Return to Castle Wolfenstein - Movie Edition - Old DemoViewer\demoViewer\screenshots\shot%.4d.tga",100,4833,500)

bully`
28th November 2017, 22:52
Then it crashes after 101 and 91 frames. :D
I tried several starting points, but it all crashes sooner or later.

StainlessS
28th November 2017, 22:54
Have a look at frames around 112*5 [EDIT: @560], any corruption apparent ?

EDIT: 112 - (100/5) == 92, quite near to 91

EDIT: Maybe try start at 450 [450/5=90]. Maybe fault within first few frames.

EDIT: Oops, I mean start at 550 [550/5=110]. (or 540 if that succeeds)

pinterf
28th November 2017, 22:54
No luck with this short sequence, you can delete it :( Could you upload the images from the beginning? I'm getting really curious.

bully`
28th November 2017, 23:04
Have a look at frames around 112*5, any corruption apparent ?

EDIT: 112 - (100/5) == 92, quite near to 91

EDIT: Maybe try start at 450 [450/5=90]. Maybe fault within first few frames.

Yeah, I noticed that too. but even if I put the starting point beyond that "critical" area it still does the same.

@pinterf And I am compiling a .zip, but it'll be big; like 3.5 gb. It'll take a while to upload, and I'm actually not sure if dropbox can handle it. I'm happy you're curious about fixing the issue though haha :thanks:

pinterf
28th November 2017, 23:15
No rush, I'll look at it nine hours later, we all love solving puzzles don't we. (Or we love having no puzzles at all? Choose one. :)

bully`
28th November 2017, 23:50
No rush, I'll look at it nine hours later, we all love solving puzzles don't we. (Or we love having no puzzles at all? Choose one. :)

I think our love for solving puzzles and problems makes us such efficient predators ...and avisynth coders.

May you feast your eyes upon my tga's.
https://www.dropbox.com/s/ie804kygzuphkgo/screenshots.zip?dl=0

pinterf
29th November 2017, 00:32
Big thanks. Successfully crashed at frame #100, for me it happened only with 32 bit Classic avisynth 2.6.0.5.
Now that's something. But be patient it would take time for me to debug. Until then find a 386dx40 to play the original wold3d on.

bully`
29th November 2017, 12:00
That's great to hear! And of course just take all the time you need, I'll be busy killing this guy:

https://i.ytimg.com/vi/W181HE4VHus/hqdefault.jpg

Something that may be of interest for you as well; I let the game record compressed .png's instead of tga's, which resulted in an output size of about 2.40 - 2.60mb per screenshot.
However, it still does the same; blksize=16 works, 32 doesn't.

greets!

pinterf
29th November 2017, 17:33
Fixed but still testing. Depending on the motion vectors (source clip dependent) MFlowBlur would overaddress the reference clip, accessing memory area beyond the real source frame.
nPel=2, nPel=4 was surely affected.

bully`
29th November 2017, 18:57
Ah I see, so I take it it's an issue within mvtools and not something I can fix by adjusting my script?
Anyway great news that you've discovered the problem!

pinterf
5th December 2017, 19:09
Ah I see, so I take it it's an issue within mvtools and not something I can fix by adjusting my script?
Anyway great news that you've discovered the problem!
Thanks for the report. Fix is released. At least it works for me now.

bully`
6th December 2017, 10:24
Thanks for the report. Fix is released. At least it works for me now.

Tested. Working fine now!
Thank you for the effort, and I'm glad my issue helped to iron out a bug :).