View Full Version : Avisynth: caused an access violation
ronnylov
24th October 2002, 19:01
Hello!
I have a strange problem. After playing the avisynth script 40819 frames without problems (27 min 13 sec) I get following error message in virtualdub:
Avisynth read error:
Avisynth: caught an access violation at 0x02a65c8b,
attempting to read from 0x08d43000
I am using Avisynth 2.06 on a WinXP system with AthlonXP 1800+ CPU, 512 MB RAM on a EpoX 8KHA+. Not overclocked.
I got problems when encoding to MPEG2 from a letterboxed interlaced huffyuv TV capture, 704x576 25fps PAL, top field first. I'm transfering the BBC series "The Blue Planet" to DVD-R and want to keep the interlacing. So I checked the playback in virtualdub and got this error.
Here's my Avisynth script (sorry about the swedish comments):
SetMemoryMax(40)
#
clip=SegmentedAviSource("capture_1.avi").trim(3903,89833)
#
# Nedanstående motsvarar Virtualdub rmpal filter.
# Halverar färgupplösningen vertikalt
chroma=BilinearResize(clip,704,288)
chroma=LanczosResize(chroma,704,576)
clip=MergeChroma(clip,chroma)
#
clip=clip.AssumeFrameBased.SeparateFields
clip=Crop(clip,8,37,688,213)
clip_top=selecteven(clip)
clip_bottom=selectodd(clip)
#Filtrera här!
clip=Interleave(Convolution3D(clip_top,0,6,10,6,8,2.8,0),Convolution3D(clip_bottom,0,6,10,6,8,2.8,0))
clip=LanczosResize(clip,672,208)
clip=Weave(clip)
clip=AddBorders(clip,16,80,16,80)
return(clip)
How can I fix this?
SansGrip
24th October 2002, 19:34
How can I fix this?
I don't see anything obviously wrong, so I think I'd start by taking out one "section" at a time until the problem went away. Then take away one line at a time from the section you now know is causing the error.
At least this way you'll know which function is causing the error (assuming it's not a core issue).
neuron2
24th October 2002, 20:02
Beware that it is not *always* correct to remove a filter, note that the problem went away, and conclude that it is the removed filter at fault! A filter in the middle of a chain can modify something incorrectly that causes a later filter to fault due to erroneous/corrupted input or environment.
This is a sad but real fact of filter life.
ronnylov
24th October 2002, 20:12
OK, now I have limited the error to following line:
SegmentedAviSource("capture_1.avi").trim(3903,89833)
A script with only the line above causes the error (and the error codes are different from one time to another). The error is always on the same frames (40819 and 40820). The avi can be played directly in virtualdub.
I figured out if I skip those bad frames I might get around the problem. This seems to work:
clip=SegmentedAviSource("capture_1.avi")
clip=clip.trim(3903,40818)+clip.trim(40821,89833)
return(clip)
I'll retry my encoding and see how it turns out...
ronnylov
24th October 2002, 20:29
Hmmm, it did not help in the final script.
Must have been just a luck once when playing it.
Now this script does not work either...
SetMemoryMax(40)
#
clip=SegmentedAviSource("capture_1.avi")
# Det blir error vid avspelning av frames 40819 och 40820, ta bort dom!
clip=clip.trim(3903,40800)+clip.trim(40830,89833)
#
# Nedanstående motsvarar Virtualdub rmpal filter.
# Halverar färgupplösningen vertikalt
chroma=BilinearResize(clip,704,288)
chroma=LanczosResize(chroma,704,576)
clip=MergeChroma(clip,chroma)
#
clip=clip.AssumeFrameBased.SeparateFields
clip=Crop(clip,8,37,688,213)
clip_top=selecteven(clip)
clip_top=Convolution3D(clip_top,0,6,10,6,8,2.8,0)
clip_bottom=selectodd(clip)
clip_bottom=Convolution3D(clip_bottom,0,6,10,6,8,2.8,0)
clip=Interleave(clip_top,clip_bottom)
clip=LanczosResize(clip,672,208)
clip=Weave(clip)
clip=AddBorders(clip,16,80,16,80)
return(clip)
I'll give up for now and will try it again some other day...
WarpEnterprises
24th October 2002, 22:03
Did you delete the last (empty) capture segment?
ronnylov
25th October 2002, 09:02
No, the original captured file segments are untouched.
Later when I have more time I will try some ideas.
Run a disc check, perhaps move the disc to my other PC and try Scandisk in WinMe. Perhaps resaving the files with direct stream copy in virtualdub may fix it? Maybe it is better to do full processing?
JuanC
26th October 2002, 05:47
Originally posted by ronnylov
No, the original captured file segments are untouched.
WarpEnterprises is suggesting to delete the last (empty) segment. Try that! Look at this thread: http://forum.doom9.org/showthread.php?s=&threadid=31924&perpage=20&highlight=empty%20segment&pagenumber=3
ronnylov
26th October 2002, 12:44
Ahaa, I see.
But I capture to huffyuv with AVI_IO and the last file segment is not an empty file. Must be something else.
ronnylov
26th October 2002, 16:10
I have solved the problem, but I don't know why I got the error.
I found that the problem was in the file segment no. 10. There was two ways I got it to work.
Method 1)
Use SegmentedDirectShowSource() instead of SegmentedAviSource()
This method read it as rgb so I also had to use converttoyuy2()
Method 2)
Open the broken file segment capture_1.10.avi in VirtualDub, enable full processing and save it as a new file. I used RGB compression method ->convert to YUY2. Then I replaced the original file segment with this new file. Using "direct stream copy" in virtualdub and save to a new file did not solve the problem.
I decided to use method 2 because the file seeking worked better this way. Strange that virtualdub could open the file directly and play it without problems but avisynth could not do it. It did not matter if I used AviFileSource() or OpenDMLSource() in avisynth. I got the same error. It only worked with directshowsource... It did not help to upgrade to avisynth 2.06+ October 15.
I have uploaded a sample huffyuv avi clip (3 MB) with the error to be evaluated: Error.zip (http://hem.bredband.net/lovron/files/Error.zip)
ronnylov
30th October 2002, 15:52
I'm encoding another capture and I have got the same problem again...
Have any avisynth developer looked at my Error.avi?
Perhaps there is something wrong with my hyffyuv codec?
What version of huffyuv is recommended to use together with avisynth?
I'm using the version that should fix some yuv problem with TMPGEnc and Windows XP. (I'm having several huffyuv codecs with different color format names in my system).
sh0dan
30th October 2002, 18:01
I have the same error here, but it's hard to find the source of it, since I cannot reproduce it, when the programs are run within Visual Studio - so I have no idea where or why i happends. Apparantly there is something strange about frame 5.
If I disable the internal exception catching in AVISynth, Vdub just disappears without a trace (no debug info or anything else). Stupid bug/problem ;)
Edit: It even seems to appear on older versions. :rolleyes:
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.