First; If you think you have any productive input/advice/suggestions, please give me the courtesy of reading everything I've typed - I'm not completely well-versed in a lot of the technical aspects of the editing I've been doing, but I've got at least a moderate degree of familiarity and understanding, and I know that explaining everything I've been doing thus far will help you to understand what I'm trying to accomplish
- I am trying to record sub- nnn x 480 resolution content from classic game consoles
- My primary example is from an NTSC Sega Genesis (MegaDrive) with S-Video output
- I have a Hauppauge PVR-150.
- I am using "Virtual VCR" to record .AVI format videos, per this tutorial:
- The only difference being that I am using "ffdshow video encoder" set to "uncompressed," so that I have no compression before I start editing.
Upon attempting to deinterlace in VirtualDub, I encountered the same problem that this person had here:
If you scroll down a little bit in that thread, you see someone suggesting the AVIsynth string:
This DID solve my color ghosting issue when using the internal "Deinterlace" filter (specifically, I set it to "duplicate fields" and "double frame rate, top field first"), but I still wasn't entirely satisfied with the result. Other assorted deinterlacing filters with assorted settings/adjustments offered better and worse results (higher-resolution content from an Xbox360, for example, was salvageable with no issues other than artifacts in motion areas)Code:DirectShowSource("filename.avi") ConvertToRGB(interlaced=true)
I found another AVIsynth string for deinterlacing here:
It's designed to separate interlaced frames into separate fields... it halves the vertical resolution, and doubles the framerate. (I had to use "ComplimentParity" because field dominance was swapped). I end up with a video that is 720 x 240 @ 59.94fpsCode:clip=DirectShowSource("test.avi") clip.ComplementParity.SeparateFields
When using the "SmartBob" filter in that link, and the "threshold" set to "0" for "dumb bob," I get a reasonably crisp image that bobs up and down one pixel per frame.
From there, I used VirtualDub's internal "Field Bob" filter a combination of two or four times to either adjust both odd/even fields up and down a quarter-scanline each, or one field up/down a quarter-scanline four times to compensate for the jitter.
This worked, for the most part, except that the color seemed to jitter up and down from frame to frame, separate from the physical image... if that makes any sense.
Using VirtualDub's internal "TV" filter, I took a screenshot of two frames' worth of a still image and combined them into an animated .GIF:
The first pane is the whole image, the second pane is the "I" information, and the third is the "Q" information
Due to the nature of the physical output resolution of these old consoles, doubling up the horizontal lines when deinterlacing doesn't technically degrade the final image quality... but for some reason, it's as though the color/chroma information isn't handled as effectively when deinterlacing. Here's another example, you can see how the color information jumps between frames (again, two still frames slowed to .5sec loop/playback):
Using the "filter->de-" plugin found here:
It is possible to independently shift the chroma information, as seen here:
But I can't seem to find any plugins that will make the color (I/Q?) information bob from frame to frame to compensate for the deinterlacing issue.
Is there any sort of solution available?
Is this simply an unexpected side-effect of the way I'm deinterlacing?
Supposedly, the PVR-150 card itself only captures in YUV2 (which is why I needed the AVIsynth string when opening the file in Vdub), is there some way to broaden the color-space information?
I don't know exactly what series of events/filters I should be trying to go through to achieve a stable image, so I don't really know where to go from here. What do you guys think? Am I up a creek? Is there maybe just a simple fix? What should I consider doing from here? :I
(reference images also uploaded as attachments)
+ Reply to Thread
Results 1 to 30 of 31
Lagarith? Much smaller sizes than uncompressed.
I don't exactly understand why you're doing part of this in AviSynth and part in VDub. Just use an AviSynth bobber. Yadif if you want quick with OK quality, QTGMC if you want best and the encoding time isn't a consideration. The bouncing-up-and-down problem should disappear. Don't filter in VDub at all. If it sounds OK with you (I could have easily missed something in your post as I believe it was too long), and can't figure how how to do it yourself in the script, come back and there are plenty of people here to help.
Last edited by sanlyn; 21st Mar 2014 at 21:13.
As far as Virtual VCR is concerned, I couldn't find a more productive capture program which allowed me to record in uncompressed format. It was already a nuisance to get it configured as-is... whether I use HuffYUV/Lagarith versus ffdshow uncompressed is a moot point, as I at least have a usable output format... VirtualVCR likes to crash every time I try to do more than one capture per session, so I have to repeatedly close and re-launch the program whenever I want to capture another video... I've at least found something that "works," so that's my main priority atm. I'm not concerned about filesize, as I have hundreds of gigabytes to work with, and I'm rarely ever working with files larger than 20gb in the first place.
The reason I'm "doing part of this in AviSynth and part in VDub" is because I honestly really don't know the intricacies of AviSynth, nor how to process something solely in AviSynth... as it stands, I'm running these scripts by opening them through VirtualDub, they just point to the video file I currently want to process. The reason I used AviSynth in the first place, is simply because of what I had read in this thread:
Supposedly, it has something to do with how VDub handles RGB or YUV2 interlaced content... all I know is the process works, for the most part. I feel like this chroma bobbing issue I'm having is the result of how the deinterlacing filters handle color information...
These recordings will only ever be re-played on PC... DVD/TV final output is none of my concern. I already know how to get a nice, clean, 29.97/30fps output for YouTube/Facebook/etc, but as far as my own personal archival purposes go, I'll be saving these as 59.94/60fps videos, which is why I'd like to get the chroma jitter figured out.
I'm deinterlacing because the card and capture utilities I'm using only capture in an interlaced format...looks great, btw:
I know VDUB works in RGB, though the AVIsynth string I used,
as far as AVIsynth goes, I don't know how to get an output file from avisynth. I DO know that I've used the "yadif" filter in VDUB and absolutely did not like the results for this particular application, so I don't really know if your suggestion would be more or less productive. If I were going to make a script out of what you said, what would the literal text look like? what does "comment-out to use bob deinterlace, double frame rate below" and "for bob deinterlace, double frame rate" mean? It's all greek to me, at least at the moment (and my buddy's wife and married-family are all greek, piles of WTF), so I don't even know what I can do, or should be doing, with AVIsynth from here...
See attached image, this is what happens when I don't process the file through AVIsynth when I open it in VDub.. Like I've said twice already, the same problem that this person has:
<delete> double post
Well, like I said in the beginning, I don't really know all the ins and outs of the different utilities I'm using here. If nothing else, I know I have not selected or applied any filters/conversion within the ffdshow encoder. But even then, I don't know the implications of YUY2 vs YV12 or anything like that... I just figured "RGB" was the simplest uncompressed format (like working with BMP instead of JPG), and after converting with that AVIsynth script, I could deinterlace other content without issue
What were your settings for ffdshow? There are different kinds of "uncompressed". Check the "generic" heading, and "colorspace" drop down menu - because you might have it set to YV12 instead of YUY2
Regardless, does using yadif internally in vdub fix the up/down chroma issue?
If you've confirmed that you recorded YUY2, and yadif didn't fix the issue, then post a video sample
And yes, post a sample cap. And we'll give you an AviSynth script ready for encoding, or further editing.
Last edited by jagabo; 9th Apr 2012 at 20:41.
Changed colorspace to YUY2, opened in VDUB without the avisynth string, see attached pics for output results. the .gif is two frames looped (mind you, the "Sonic & Knuckles" logo is supposed to bounce, I just wanted to make sure the lagging color information was visible)
Using yadif in vdub doesn't result in anything better than the bob method (remember, I prefer bob BECAUSE the native pixels of the analog video stream are doubled-up to begin with... the Genesis outputs at 320x224(or 240) to begin with, which gets doubled to 640x448(or 480) within a 720x480 pane... yadif results in rounded edges and unnecessary smoothing, whereas bob replicates the video much more accurately)
Last edited by sanlyn; 21st Mar 2014 at 21:14.
Just open the source video in VirtualDub, select Video -> Direct Stream Copy, use the mark-in and mark-out tools to mark a short section of interest, then Video -> Save as AVI. You can disable the audio too (Audio -> No Audio) to make the file a little smaller.
Last edited by jagabo; 9th Apr 2012 at 21:13.
That's an AVC/h264 encoded AVI of video from my Xbox... The xbox outputs 720x480 @60fps for SD (standard-def) content, but since my capture card only does 30fps interlaced, I had to separate fields, interpolate lost lines of resolution, and that was the end result. Looks fine for my purposes.
I want to retain crisp detail with my video from my older consoles, though, so interpolating missed frames/lines is actually less productive than doubling lines per frame/field. Here's a 30 frame snip, acquired via this method:
>opened in VirtualDub
>Direct Stream Copy
>cropped 30 frames with Mark-in and Mark-out tools
>Save as AVI
>WinRar compressed archive
(EDIT: first few frames of that seem to stutter or something... no idea why, disregard)
I appreciate the explanation, but it was easier for me to just crop in vdub the way I just explained. I do understand that vdub recognizes .avs files as video formats, as this is how I've been utilizing avisynth with those two previous strings I posted earlier
Last edited by AG-Wolf; 9th Apr 2012 at 21:20.
The chroma issue is evident in the original fields in your original video sample and it's recorded in YV12 (4:2:0) . So it's not vdub or whatever deinterlacer's fault . Either it's a recording issue, or a problem with the console
Try recording in something else, like huffyuv or ut video codec to rule out recording issue with ffdshow
Yes, bob is just resizing the fields using cubic interpolation. It's the most basic form
Any deinterlacer can output 59.94 fps, just retain both the fields
Better deinterlacers weave sections that have no motion, so you keep the vertical resolution instead of throwing away half like bob does. Better deinterlacers also try to interpolate the missing data between the lines from adjacent fields so you dont get as jaggy aliasing artifacts
Actually I take that back about the video sample. There were problems with the file vdub had some errors but it opened (I couldn't open it with AVISource or FFMS2) and I opened it with directshowsource (unreliable) and it inserts some weird colorspace converter. Perhaps there was a problem with cutting it
I've said it multiple times, the output from the Genesis, and any of these other old consoles (NES, SNES, SMS, Saturn, PSX, etc) are all HALF or less of 480... doubling the lines in a 720x240 field results in an image that doesn't actually lose any of the original picture (outside of whatever this weird chroma issue is). Process that 30 frame clip via splitting the fields into their own frames, and then double the lines with a simple bob algorithm and you'll see what I mean.
I'll try those two tomorrow (it's 10:15pm here and im winding things down for the night), but I don't know how versatile the Virtual VCR program is for recording with different filters... you have to select a specific display filter made by Hauppauge when previewing, and trying to use ffdshow in RGB24 resulted in a completely black video when I open it in anything else. Trial and error joy.
There's nothing weird about the chroma. It's normal interlaced YV12. A double frame rate Conversion with Yadif(mode=1, order=1) is attached (uncompressed YUY2, in a ZIP file). There's no bounce but you can see where Yadif interpolated parts of the picture in motion, but let both fields through where there wasn't motion.
Last edited by jagabo; 9th Apr 2012 at 22:39.
By the way, I was having trouble opening the original AVI file too. I was able to use DirectShowSource() to open it then save in Direct Stream Copy mode in VirtualDub to create a new uncompressed YV12 video. I had no problems opening that new file with AviSource().
You should try capturing as YUY2 instead of YV12. You should get better color resolution. Although I seem to recall there's something odd about the PVR150. Maybe it can't capture as YUY2?
Last edited by jagabo; 9th Apr 2012 at 23:19.
VirtualDub. It treats all YV12 as if it's progressive. That's fine for the luma channel but it screws up the chroma channels.
Remember, the chroma channels in interlaced YV12 are interlaced and they are half height and half width (Y left, U top right, V bottom right):
Be sure to view that image full size.
With interlaced YV12 Line 0 of the chroma channels apply to lines 0 and 2 of the luma channel. Line 1 of the chroma channels apply to lines 1 and 3 of the luma channel. Etc. VirtualDub applies line 0 of the chroma channels to lines 0 and 1 of the luma channel, line 1 of the chroma to lines 3 and 4 of the luma. So the colors from the two fields are commingled.
Last edited by jagabo; 1st Jul 2014 at 07:39.
I meant if you ConvertToYUY2(interlaced=true) an AviSynth and then let VirtualDub convert to RGB you would get the same thing as your ConvertToRGB(interlaced=true). And since VirtualDub is going to do it's filtering in RGB you might as well go straight to RGB in AviSynth.
AG-Wolf, try this script:
AviSource("yv12.avi") AssumeTFF() ConvertToYUY2(interlaced=true) #must use YUY2 to shift chroma down one line SeparateFields() Interleave(SelectEven(),SelectOdd().ChromaShift(l=1)) PointResize(720,480) # or whatever resize you want, or nnedi3(field=1, dh=true)
Last edited by jagabo; 10th Apr 2012 at 11:30.
After reading your 1st post, I wonder why you do not play in emulators that have the option of AVI OUTPUT?
The emulator would give you the correctly resolution of each console.
If the fact of playing on TV you can ride for less than $ 200 a HTPC and have all the emulators up to N64, and was using an adapter control to play like the real hardware.
Last edited by sanlyn; 21st Mar 2014 at 21:17.