PDA

View Full Version : Corrupted frames with avisynth script?


Yobbo
1st February 2005, 04:32
Hi, bit daunting posting here but I hope you can help! :scared:

I notice when viewing my Avisynth script in VDubMod, there appear "corrupted frames" here & there (ie colours askew, green fuzzy streaks etc). These "glitches" do not appear in the original avi capture!

Here is my script (very basic, but I like this combo of filters):

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemoveGrainSSE2.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Convolution3D.dll")
Import("C:\Program Files\Avisynth 2.5\plugins\jdl-util.avsi")
Import("C:\Program Files\AviSynth 2.5\plugins\jdl-interlace.avsi")
AviSource("C:\~\capture.avi")
JDL_UnfoldFieldsVertical(true)
DRemoveGrain(mode=2).Convolution3D(preset="animeLQ")
Lanczos4Resize(352,576)
ConvertToYUY2().Limiter()
JDL_FoldFieldsVertical(true)

Have I got something wrong here? (I am using the latest Avisynth version!)

Thank you kind people!

Mug Funky
1st February 2005, 04:44
yikes, i can't see anything there that would obviously cause a problem. could you post a screenshot or a sample or something?

a wild guess would be that whatever's decoding yuy2 on your machine is a little peculiar. but i can't see how that would be so, because your output is mod16, so there should be no problems.

Boulder
1st February 2005, 07:00
Please post some screenshots, they may help. ImageShack will help you;)

What's the resolution of the source?

Yobbo
1st February 2005, 09:31
Here's a sample frame (hope it works!?) -

http://img193.exs.cx/img193/5997/sampleframe17gx.th.jpg (http://img193.exs.cx/my.php?loc=img193&image=sampleframe17gx.jpg)

It is only one frame affected at a time - adjacent frames are OK.

It occurs sporadically throughout my capture, but only when loaded into Avisynth (ie the source tape, avi capture etc are all OK - I triple-checked!).

Capture was made at 704x576 using huffyuv compression.

Anybody have any idea what is causing these intermittent glitches?

Thanks again!

Boulder
1st February 2005, 09:38
Have you tried commenting out filters from the script one by one?

What HuffYUV version are you using?

Yobbo
1st February 2005, 10:02
EDIT: Sorry, there's no glitches in the avi capture!

However, I realize now it's not my Avisynth script, cos when I load the raw avi into VirtualDub, I get the glitches, at the same frames.

So, it's VirtualDub!?

Well that must mean that I can just go ahead & encode & burn & rest assured it will turn out OK?

(I am using huffyuv 2.1.1, tho' I have used 2.2.1 too with no problems.)

Anyway, sorry if I'm wasting your time.

Boulder
1st February 2005, 10:04
Which HuffYUV version do you use -- one from ffvfw with YV12 support or the regular YUY2 one?

Yobbo
1st February 2005, 10:12
Boulder, I edited my last post (see above).

Thanks for your quick replies.

Boulder
1st February 2005, 10:17
I'd say it's the decoder.

What is being used as the decoder when you load the raw file in VDub? Check File->File information.

Yobbo
1st February 2005, 10:40
Thanks for your patience, Boulder, it's much appreciated.

From what I can work out, it's using "Huffman Lossless Codec YUV and RGB"...whatever that is!

DEFINITELY the glitches aren't there in the avi, because I advanced frame by frame in Media Player Classic & they're not there. It's only in VirtualDub (both the standard & mod versions).

But look, I'm happy now knowing it's not my capture card or something wrong with my script. So I can live with it. Perhaps I should take it up in the VDub forum?

Yobbo
1st February 2005, 23:08
I'm still going nuts with this!

I just encoded my avi, and when viewing the resulting m2v file in Media Player I find even MORE glitches throughout the stream!!!

These glitches are NOT in the raw avi (when viewed in Media Player)!

To summarize:
- Raw capture is OK (no glitches) when viewed in Media Player Classic
- Glitches appear when viewed in VDub (both raw avi & Avisynth script)
- Glitches multiply after encoding!

Something is corrupt, but what? Any suggestions?

Boulder
2nd February 2005, 08:37
Can you put a sample clip for download somewhere? If the glitches always occur at the same places, mayb 25 frames or so would be sufficient.

What does a simple

AviSource("C:\~\capture.avi")
Info()

tell you when you load it in VDub?

Arachnotron
16th February 2005, 01:17
Could this have something to do with the interlaced switch introduced in a recent version of huffyhuf? I vaguely remember there was a problem with it, but I forgot what it looked like. If so, did you switch huffyhyf versions recently?

[edit] or it might be a problem some huffy versions have if you feed it RGB instead of YUY2. see this (http://forum.doom9.org/showthread.php?s=&threadid=67121&highlight=Huffyuv) thread.

Yobbo
16th February 2005, 06:08
Hi, sorry but I have been off-line & also capture card is getting replaced. The tech guy didn't think it was the capture card at fault, but it had a noisy fan which justified a replacement, so...

Anyways I am waiting on this new card, and I will try a fresh install of XP too. (I think Jacz might have the answer - driver corruption? We'll see).

I am capturing YUV, not RGB. Also I have tried the different versions of huffyuv.

But I will definitely post up my results ASAP.

Thanks to all suggestions & advice, esp. to Boulder who has been offering much advice via PM.

Sorry for the confusions with double-post etc. Not making a good first impression, heh?

(Possibly this thread should be moved to "Capture" forum, yes?)

EpheMeroN
16th February 2005, 07:03
I have had this problem before using the Huffyv Codec. It usually occurs with the version you're using as well. From my own experience though it's due to how Huffyuv handles the "Field Threshold" setting within the codec. For instance, if you captured using a Field Threshold of 240, but then changed it to 480, it would return that garbled output. This is the only way I know of for Huffyuv to behave as such.

Jacz
16th February 2005, 09:52
Hello,
I have the same problem. I did a few tests and corrupt frames(CF) are in AVI only when capturing to huffyuv.

-it seems that CFs are independent on : recorder (Fly2000TV, ATV2000, freeVCR or what...), vga/tuner/audio drivers, DirectX version, resolution/FPS/colorspace(yuv or rgb), audio recording, BIOS settings, HDD, overclocked y/n

-problem exists in all recent versions of huffyuv (2.1.1., 2.1.1 patched, 2.2.0 tested) and only when capturing, not recoding from another AVI (in Vdub)

-I think that MPC (media player classic) is skipping these CFs, that's why you can't see them - you may only notice a short "stutter" in movie. (i apologize for my bad english)

SOLUTION: I installed second instance of Win2003 and WinXPpro with same vga/audio/directx/tuner/huffyuv versions,and Fly2000tv with exactly same settings and suddenly everything was OK.

I think we both installed some software or drivers, which in some way dis-ballanced our systems. I'm just letting it be and capture uncompressed.


Here's my configuration:
motherboard ECS M848ALU (using onboard LAN and audio)
CPU Athlon XP 1800+@2100+ (FSB 150Mhz)
RAM 128MB 133@150MHz + 256MB 166@150 MHz = 384MB
VGA S3 Savage4, 32MB, AGP 4x
Tuner ASUS TV/FM SAA7134/5
HDD Seagate Barracude IV 40GB (ATA 100) and Maxtor 200GB (ATA133)
ZIP, CDRW, USB2.0
-
Win2003server, all updates, DirectX 9.0c, tons of software installed and uninstalled, many codecs...