Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th August 2015, 22:53   #1  |  Link
pumpkinguts
Registered User
 
Join Date: Aug 2015
Posts: 2
Remove gray line in S-Video capture

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:





What I'm aiming for:





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.





This is all I currently have in ffdshow.



Any recommendations for plugins and filter settings that I can use to fix and improve my game capture would be greatly appreciated. Thank you.
pumpkinguts is offline   Reply With Quote
Old 27th August 2015, 23:45   #2  |  Link
creaothceann
Registered User
 
Join Date: Jul 2010
Location: Germany
Posts: 360
Just for the record, BizHawk has a frame-perfect recording function that can record in RGB. It also uses the bsnes core so the emulation is 99.999% identical to the real hardware.
creaothceann is offline   Reply With Quote
Old 28th August 2015, 00:50   #3  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,377
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:
Code:
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.

Last edited by raffriff42; 28th August 2015 at 01:04.
raffriff42 is offline   Reply With Quote
Old 28th August 2015, 01:28   #4  |  Link
pumpkinguts
Registered User
 
Join Date: Aug 2015
Posts: 2
Quote:
Originally Posted by raffriff42 View Post
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:
Code:
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.
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 — both no settings and Bob() looked pretty much the same except Bob() made everything wobble?

Last edited by pumpkinguts; 28th August 2015 at 01:37.
pumpkinguts is offline   Reply With Quote
Old 28th August 2015, 02:57   #5  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,377
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 (although I didn't have too much trouble - maybe someone can suggest a method better/easier way..?)

Code:
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())
}

Last edited by raffriff42; 28th August 2015 at 10:52.
raffriff42 is offline   Reply With Quote
Old 28th August 2015, 10:16   #6  |  Link
TheSkiller
Registered User
 
Join Date: Dec 2007
Location: Germany
Posts: 637
Quote:
Originally Posted by raffriff42 View Post
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.

Last edited by TheSkiller; 28th August 2015 at 10:28.
TheSkiller is offline   Reply With Quote
Old 28th August 2015, 11:01   #7  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,377
Quote:
Originally Posted by TheSkiller View Post
Not with old video game consoles...
Ah, I see, thank you. OK pumpkinguts, try this...
Code:
Crop(40, 14, 640, 440)
SeparateFields
SelectEven
PointResize(640, 440)
_ChromaOffset(0, 1) ## (see my previous post)
raffriff42 is offline   Reply With Quote
Old 28th August 2015, 16:14   #8  |  Link
creaothceann
Registered User
 
Join Date: Jul 2010
Location: Germany
Posts: 360
Quote:
Originally Posted by raffriff42 View Post
SelectEven
That would halve the framerate...
creaothceann is offline   Reply With Quote
Old 28th August 2015, 21:17   #9  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,377
Quote:
Originally Posted by creaothceann View Post
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.

Last edited by raffriff42; 29th August 2015 at 02:20.
raffriff42 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:55.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.