Log in

View Full Version : Remove gray line in S-Video capture


pumpkinguts
27th August 2015, 22:53
Hello, I am recording Super Nintendo gameplay through Media Player Classic and filtering the video using ffdshow/Avisynth. I am trying to figure out why my capture device is making the bottom pixel of the screen and sprites gray? I am new to using Avisynth so my apologies if this is a common issue and I'm just missing an obvious fix.

What I currently have:

http://i.imgur.com/AffYzmD.png

http://i.imgur.com/bgZlcaU.png

What I'm aiming for:

http://i.imgur.com/4Y9YXdw.png

http://i.imgur.com/wIzsukM.png

So far the only thing I've been able to figure out is how to deinterlace and resize the video but I haven't a clue where to begin with plugins and filters in Avisynth, especially when I'm starting off with such an odd issue with this gray line thing. It's more noticeable in the pictures below if you look at the bottom of the screen and the bottom of the yoshi feet and green area in the text window. It's also really apparent when the Baby Mario timer gets below 10 and you see the gray at the bottom of the red numbers.

http://i.imgur.com/s07ujCV.png

http://i.imgur.com/HOhyDVk.png

This is all I currently have in ffdshow.

http://i.imgur.com/fW0KEF6.png

Any recommendations for plugins and filter settings that I can use to fix and improve my game capture would be greatly appreciated. Thank you.

creaothceann
27th August 2015, 23:45
Just for the record, BizHawk (http://tasvideos.org/BizHawk.html) has a frame-perfect recording function that can record in RGB. It also uses the bsnes core (http://arstechnica.com/gaming/2011/08/accuracy-takes-power-one-mans-3ghz-quest-to-build-a-perfect-snes-emulator/) so the emulation is 99.999% identical to the real hardware.

raffriff42
28th August 2015, 00:50
Why three calls to Resize? (You seem to be trimming black borders?)
Why SeparateFields and then doubling the height? That is the about the worst way to deinterlace.

Start by replacing all that ffdshow code with:Bob()
And see what you get.

EDIT I am guessing as to what your source is, based on that script. I might be way off base. It would help if we could get a sample of your source, or at minimum, a screen shot and a MediaInfo report (http://forums.virtualdub.org/index.php?act=ST&f=4&t=22246&hl=&#entry95729).

pumpkinguts
28th August 2015, 01:28
Why three calls to Resize? (You seem to be trimming black borders?)
Why SeparateFields and then doubling the height? That is the about the worst way to deinterlace.

Start by replacing all that ffdshow code with:Bob()
And see what you get.

EDIT I am guessing as to what your source is, based on that script. I might be way off base. It would help if we could get a sample of your source, or at minimum, a screen shot and a MediaInfo report (http://forums.virtualdub.org/index.php?act=ST&f=4&t=22246&hl=&#entry95729).

MediaInfo Report:

General
Format : AVI
Format/Info : Audio Video Interleave
File size : 141 MiB
Duration : 7s 40ms
Overall bit rate : 167 Mbps

Video
ID : 0
Format : YUV
Codec ID : YUY2
Codec ID/Info : YUV 4:2:2 as for UYVY but with different component ordering within the u_int32 macropixel
Duration : 7s 40ms
Bit rate : 166 Mbps
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 3:2
Frame rate : 29.970 fps
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:2:2
Compression mode : Lossless
Bits/(Pixel*Frame) : 16.001
Stream size : 139 MiB (99%)

Audio #1
ID : 1
Format : PCM
Format settings, Endianness : Little
Format settings, Sign : Signed
Codec ID : 1
Duration : 7s 0ms
Bit rate mode : Constant
Bit rate : 1 536 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Delay relative to video : 69ms
Stream size : 1.28 MiB (1%)
Alignment : Aligned on interleaves
Interleave, duration : 50 ms (1.51 video frames)

Audio #2
ID : 2
Format : PCM
Format settings, Endianness : Little
Format settings, Sign : Signed
Codec ID : 1
Duration : 7s 40ms
Bit rate mode : Constant
Bit rate : 1 536 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Delay relative to video : 7ms
Stream size : 1.29 MiB (1%)
Alignment : Aligned on interleaves

Sample Video (http://puu.sh/jR1Xu/8113a5f0c3.mp4) — both no settings and Bob() looked pretty much the same except Bob() made everything wobble?

raffriff42
28th August 2015, 02:57
Not sure why Bob() is misbehaving. I suggested it because it doesn't require any external plugins, and it seemed to work OK on a sample I had on hand.

EDIT the sample you have uploaded has been (poorly) scaled and (badly) compressed, making it impossible to say what needs to be done. The comments below apply to the sample as given.

Deinterlacing is needed here. I don't do deinterlacing often, but QTGMC() works well for me. It can difficult to install (http://forum.doom9.org/showthread.php?t=172506)(although I didn't have too much trouble - maybe someone can suggest a method better/easier way..?)

Crop(40, 14, 640, 440)

# http://avisynth.nl/index.php/QTGMC
# http://forum.doom9.org/showthread.php?t=172506 (install help)
Import("p:\path\QTGMC\QTGMC-3.32.avsi")
ComplementParity
QTGMC()
SelectEven

_ChromaOffset(0, 1)

## only needed if source is badly compressed
# http://forum.doom9.org/showthread.php?p=793930#post793930
#Import("p:\path\deringing\HDQDering.avsi")
#HQDering(255, 64)

return Last

##################################
function _ChromaOffset(clip C, int "ux", int "uy", int "vx", int "vy")
{
Assert(C.IsYUV, "_ChromaOffset: source must be YUV")
ux = Default(ux, 0)
uy = Default(uy, 0)
vx = Default(vx, ux)
vy = Default(vy, uy)

U = C.UToY8()
V = C.VToY8()

return YToUV(
\ U.Overlay(U, x=ux, y=uy),
\ V.Overlay(V, x=vx, y=vy),
\ C.ConvertToY8())
}

TheSkiller
28th August 2015, 10:16
Why SeparateFields and then doubling the height? That is the about the worst way to deinterlace.Not with old video game consoles; they output a slightly off-standard signal with altered sync pulses that could be described as 240p/288p which is captured as two fields in one frame (because capture devices know no better), and thus it looks interlaced while it isn't. What you actually have is 50 or 60 fields per second where there are not half the lines missing like with regular interlaced video (so they are essentially frames not fields). So a SeparateFields() is really all that is needed. Doubling the height with PointResize helps keep the original pixelated look.


Your sample is re-encoded, it is not your raw capture. This is bad because the color subsampling has changed from 4:2:2 to 4:2:0 making it quite impossible to tell what happened to the chroma. The chroma in that sample is seriously messed up.

raffriff42
28th August 2015, 11:01
Not with old video game consoles...Ah, I see, thank you. OK pumpkinguts, try this...Crop(40, 14, 640, 440)
SeparateFields
SelectEven
PointResize(640, 440)
_ChromaOffset(0, 1) ## (see my previous post)

creaothceann
28th August 2015, 16:14
SelectEven

That would halve the framerate...

raffriff42
28th August 2015, 21:17
That would halve the framerate...There seemed to be some strange motion artifacts at 59.94, and SelectEven was a quick fix; in hindsight I should have tried ComplementParity first, to see if it was a simple field-order problem...

EDIT After trying it, ComplementParity did not help. I'm not sure what the problem is here (and what processing has been applied to this video), but SelectOdd or SelectEven helps stabilize the video somewhat.