VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 31
Thread
  1. Qirex: Brute Force AG-Wolf's Avatar
    Join Date: Apr 2012
    Location: New England
    Search Comp PM
    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:
    http://www.shspvr.com/smf/index.php?topic=6403.0
    - 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:
    http://forum.videohelp.com/threads/315260-Virtualdub-Deinterlace?p=1950529&viewfull=1#post1950529

    If you scroll down a little bit in that thread, you see someone suggesting the AVIsynth string:
    Code:
    DirectShowSource("filename.avi")
    ConvertToRGB(interlaced=true)
    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)

    I found another AVIsynth string for deinterlacing here:
    http://neuron2.net/bob.html
    Code:
    clip=DirectShowSource("test.avi")
    clip.ComplementParity.SeparateFields
    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.94fps

    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:
    http://img28.imageshack.us/img28/7181/bobtest.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):
    http://img837.imageshack.us/img837/6566/ewjbob.gif

    Using the "filter->de-" plugin found here:
    http://www.infognition.com/VirtualDubFilters/color_correction.html
    It is possible to independently shift the chroma information, as seen here:
    http://img705.imageshack.us/img705/9466/ewjcolorshift.jpg
    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)
    Attached Thumbnails Click image for larger version

Name:	bob-test.gif
Views:	86
Size:	384.4 KB
ID:	11877  

    Click image for larger version

Name:	ewj-color-shift.jpg
Views:	72
Size:	222.2 KB
ID:	11879  

    Attached Images  
    Quote Quote  
  2. Originally Posted by AG-Wolf View Post
    - The only difference being that I am using "ffdshow video encoder" set to "uncompressed," so that I have no compression before I start editing.
    Can't you install and then use a lossless codec, ones such as HuffYUV or 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.
    Quote Quote  
  3. Banned
    Join Date: Oct 2004
    Location: New York, US
    Search Comp PM
    -30-
    Last edited by sanlyn; 21st Mar 2014 at 20:13.
    Quote Quote  
  4. Qirex: Brute Force AG-Wolf's Avatar
    Join Date: Apr 2012
    Location: New England
    Search Comp PM
    @manono:
    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:
    http://forum.videohelp.com/threads/315260-Virtualdub-Deinterlace?p=1950529&viewfull=1#post1950529
    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...

    @sanlyn
    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,
    Code:
    DirectShowSource("filename.avi")
    ConvertToRGB(interlaced=true)
    was necessary to make the internal deinterlace filter (and a number of the other ones out there) work "properly"

    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...
    Quote Quote  
  5. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    newer versions of vdub have yadif built in as well

    (although I would spend the time learning avisynth basics if I was in your shoes, at least sometime in the future. It offers much more versatility and deinterlacing options... but maybe that's enough for your purposes for now)


    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?
    If that's true, then you don't need to convert to RGB with avisynth. The interlaced chroma issue only occurs in vdub because it upsamples interlaced YV12 as progressive
    Quote Quote  
  6. Qirex: Brute Force AG-Wolf's Avatar
    Join Date: Apr 2012
    Location: New England
    Search Comp PM
    @poisondeathray
    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:
    http://forum.videohelp.com/threads/315260-Virtualdub-Deinterlace?p=1950529&viewfull=1#post1950529
    Attached Thumbnails Click image for larger version

Name:	without avisynth.png
Views:	131
Size:	393.7 KB
ID:	11880  

    Quote Quote  
  7. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    <delete> double post
    Quote Quote  
  8. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Originally Posted by AG-Wolf View Post
    @poisondeathray
    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:
    http://forum.videohelp.com/threads/315260-Virtualdub-Deinterlace?p=1950529&viewfull=1#post1950529

    Then what you said isn't true about capping in YUY2 with the PVR, or you're converting it to YV12 through ffdshow or somewhere else in your workflow.
    Quote Quote  
  9. Qirex: Brute Force AG-Wolf's Avatar
    Join Date: Apr 2012
    Location: New England
    Search Comp PM
    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
    Quote Quote  
  10. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    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
    Quote Quote  
  11. Originally Posted by AG-Wolf View Post
    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.
    The image is supposed to bounce up and down because the two fields represent different positions in the frame.

    http://forum.videohelp.com/threads/246266-Pulldown-removal-2-3-3-2?p=1462991&viewfull=1#post1462991

    Originally Posted by AG-Wolf View Post
    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.
    That's nonsensical. Just use a smart bob like Yadif() or QTGMC(). The latter is usually the best but very slow.

    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 19:41.
    Quote Quote  
  12. Qirex: Brute Force AG-Wolf's Avatar
    Join Date: Apr 2012
    Location: New England
    Search Comp PM
    @poisondeathray
    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)
    Attached Thumbnails Click image for larger version

Name:	ffdshow yuy2.png
Views:	84
Size:	548.3 KB
ID:	11881  

    Click image for larger version

Name:	ffdshow-yuy2-artifacts.gif
Views:	103
Size:	248.9 KB
ID:	11882  

    Quote Quote  
  13. Originally Posted by AG-Wolf View Post
    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
    Then try discarding one field and use nnedi3 to interpolate the other field.

    But you need to solve your chroma problem first. Upload a sample cap.
    Quote Quote  
  14. Banned
    Join Date: Oct 2004
    Location: New York, US
    Search Comp PM
    -30-
    Last edited by sanlyn; 21st Mar 2014 at 20:14.
    Quote Quote  
  15. 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 20:13.
    Quote Quote  
  16. Qirex: Brute Force AG-Wolf's Avatar
    Join Date: Apr 2012
    Location: New England
    Search Comp PM
    Originally Posted by jagabo View Post
    Originally Posted by AG-Wolf View Post
    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
    Then try discarding one field and use nnedi3 to interpolate the other field.
    I don't want to "interpolate the other field," because then I lose the true 60 (59.94)fps output from the console. This is why I want to stick with bob and doubling the number of lines per field... I already know how to utilize interpolation filters for content that actually has 480 discrete lines of resolution:
    http://www.sendspace.com/file/7dcd93
    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
    http://www.sendspace.com/file/t1tkxc
    (EDIT: first few frames of that seem to stutter or something... no idea why, disregard)

    @sanlyn
    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 20:20.
    Quote Quote  
  17. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    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
    Quote Quote  
  18. Originally Posted by AG-Wolf View Post
    I don't want to "interpolate the other field," because then I lose the true 60 (59.94)fps output from the console. This is why I want to stick with bob and doubling the number of lines per field...
    Bob is an interpolation. The dumbest possible interpolation. The missing field is produced by averaging the pixels from the lines above and below.

    Downloading file now..
    Quote Quote  
  19. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    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
    Quote Quote  
  20. Qirex: Brute Force AG-Wolf's Avatar
    Join Date: Apr 2012
    Location: New England
    Search Comp PM
    @jagabo
    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.

    @poisondeathray
    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.
    Quote Quote  
  21. 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.
    Attached Files
    Last edited by jagabo; 9th Apr 2012 at 21:39.
    Quote Quote  
  22. 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 22:19.
    Quote Quote  
  23. Banned
    Join Date: Oct 2004
    Location: New York, US
    Search Comp PM
    -30-
    Last edited by sanlyn; 21st Mar 2014 at 20:15.
    Quote Quote  
  24. Originally Posted by sanlyn View Post
    Something wrong with the capture; opening the sample directly into VDub or with DIrectSHowSource shows none of VDub's bob or deinterlace functions working correctly.
    It's the usual interlaced YV12 problem with 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):

    Click image for larger version

Name:	all3.png
Views:	50
Size:	358.4 KB
ID:	11890

    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 06:39.
    Quote Quote  
  25. Banned
    Join Date: Oct 2004
    Location: New York, US
    Search Comp PM
    -30-
    Last edited by sanlyn; 21st Mar 2014 at 20:15.
    Quote Quote  
  26. Originally Posted by sanlyn View Post
    ConvertToRGB24(matrix="Rec601",interlaced=true)
    Or ConvertToYUY2(interlaced=true). But since VirtualDub is going to work in RGB you might as well do the RGB conversion directly in AviSynth.
    Quote Quote  
  27. Banned
    Join Date: Oct 2004
    Location: New York, US
    Search Comp PM
    -30-
    Last edited by sanlyn; 21st Mar 2014 at 20:15.
    Quote Quote  
  28. 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:

    Code:
    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)
    That takes care of most of your bouncing colors. You'll need ChromaShift() if you don't have it. I think capturing in YUY2 (or other 4:2:2 format) will eliminate this problem.
    Last edited by jagabo; 10th Apr 2012 at 10:30.
    Quote Quote  
  29. Lone soldier Cauptain's Avatar
    Join Date: Jan 2006
    Location: Brazil
    Search Comp PM
    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
    .

    Name:  idcGt.png
Views: 329
Size:  9.4 KB



    Claudio
    Quote Quote  
  30. Banned
    Join Date: Oct 2004
    Location: New York, US
    Search Comp PM
    -30-
    Last edited by sanlyn; 21st Mar 2014 at 20:17.
    Quote Quote  



Similar Threads