VideoHelp Forum
+ Reply to Thread
Results 1 to 10 of 10
Thread
  1. Member
    Join Date
    Oct 2001
    Location
    United Kingdom
    Search Comp PM
    Hi all

    I have managed to capture a VHS clip that had macrovision, and generally after a bit of filtering in Avisynth and Virtualdub I'm pretty happy with it.
    There is however one issue I am not sure how to deal with.
    For some reason the bottom 50 or so lines seem to be shifted to the left, leaving a black rectangle on the right.
    I've included a screenshot which is before I have applied any filters.

    Image
    [Attachment 52800 - Click to enlarge]


    I know there is the usual VHS noise at the bottom, but this sits above that.
    Not sure if the macrovision was the cause or not.
    What I need to do sounds simple on paper, but I'm guessing is a little more complicated in reality.
    Is there an Avisynth filter or string of commands that will take x number of lines from the bottom, and shift them x number of pixels to the left/right?
    I have a basic grasp of Avisynth, but not an expert by any stretch!

    Any help gratefully accepted.
    Quote Quote  
  2. You can use crop a bottom version, then overlay it back onto the original using x= coordinates to shift it left or right, y=coordinates to shift it up or down
    Code:
    orig=ImageSource("atex.jpg")
    bottom=orig.crop(0,542,0,0,true)
    overlay(orig, bottom, x=4,y=542)
    Image
    [Attachment 52806 - Click to enlarge]


    If video is interlaced VHS YUV as 4:2:0 - because it's 542 vertical pixels (mod2, not mod4), you have to do the crop as 4:2:2 . You would need to use ConvertToYV16(interlaced=true) before cropping if it's not already 4:2:2 . Basically, there are rules to cropping, depending on chroma subsampling, and if it's interlaced or not
    http://avisynth.nl/index.php/Crop#Crop_restrictions
    Last edited by poisondeathray; 20th Apr 2020 at 15:48.
    Quote Quote  
  3. Member
    Join Date
    Oct 2001
    Location
    United Kingdom
    Search Comp PM
    Thanks for the quick reply.
    I pretty much get the jist of the code, only I'm unsure why it would reference the atex.jpg example still I have provided?
    It needs to take the current frame each time and apply the correction, rather than using a static example.
    Sorry if I'm misunderstanding, and I could just drop the code is "as is" and then fine tune the figures!
    Quote Quote  
  4. Member
    Join Date
    Oct 2001
    Location
    United Kingdom
    Search Comp PM
    Don't worry I've worked it out, thanks!

    For the benefit of other novices like me, I removed the removed the 'orig=ImageSource("atex.jpg")' line and added the 'orig=' to the beginning of the avisource line in my script.
    Works perfectly now.
    Quote Quote  
  5. Originally Posted by nick1977 View Post
    Thanks for the quick reply.
    I pretty much get the jist of the code, only I'm unsure why it would reference the atex.jpg example still I have provided?
    It needs to take the current frame each time and apply the correction, rather than using a static example.
    Sorry if I'm misunderstanding, and I could just drop the code is "as is" and then fine tune the figures!
    You would substitute a different source filter referencing your video, instead of the image . If you had "video.avi", you would use something like this

    e.g
    Code:
    orig=AVISource("video.avi")
    bottom=orig.crop(0,542,0,0,true)
    overlay(orig, bottom, x=4,y=542)

    Does the bottom change in terms of how much it moves ? Or is it static in terms of position relative to the top section? Those values in the script are applied on every frame; the overlay is shifted right 4 pixels on every frame . If you needed, say, 6 pixels on some sections, you'd have to divide up the video, or specify sections to apply different settings in the script
    Quote Quote  
  6. Originally Posted by poisondeathray View Post
    Basically, there are rules to cropping, depending on chroma subsampling, and if it's interlaced or not
    http://avisynth.nl/index.php/Crop#Crop_restrictions
    Do the cropped picture size or the cropping values have to fulfill the mod rules?

    Example:
    For YV12 interlaced 720x480i, vertical cropping
    a) crop(0,2,0,-2) => 720x476 cropped picture is mod4 compliant, crop values mod 2
    b) crop(0,0,0,-4) => 720x476 cropped picture and crop value are mod 4 compliant

    Are both ok, or b) only?
    Quote Quote  
  7. Originally Posted by Sharc View Post
    Originally Posted by poisondeathray View Post
    Basically, there are rules to cropping, depending on chroma subsampling, and if it's interlaced or not
    http://avisynth.nl/index.php/Crop#Crop_restrictions
    Do the cropped picture size or the cropping values have to fulfill the mod rules?

    Example:
    For YV12 interlaced 720x480i, vertical cropping
    a) crop(0,2,0,-2) => 720x476 cropped picture is mod4 compliant, crop values mod 2
    b) crop(0,0,0,-4) => 720x476 cropped picture and crop value are mod 4 compliant

    Are both ok, or b) only?

    Only "b" ; It's because of the chroma subsampling in terms of fields

    If you perform "a" , you will get messed up chroma ghosting artifacts
    Quote Quote  
  8. Originally Posted by poisondeathray View Post
    Originally Posted by Sharc View Post
    Originally Posted by poisondeathray View Post
    Basically, there are rules to cropping, depending on chroma subsampling, and if it's interlaced or not
    http://avisynth.nl/index.php/Crop#Crop_restrictions
    Do the cropped picture size or the cropping values have to fulfill the mod rules?

    Example:
    For YV12 interlaced 720x480i, vertical cropping
    a) crop(0,2,0,-2) => 720x476 cropped picture is mod4 compliant, crop values mod 2
    b) crop(0,0,0,-4) => 720x476 cropped picture and crop value are mod 4 compliant

    Are both ok, or b) only?

    Only "b" ; It's because of the chroma subsampling in terms of fields

    If you perform "a" , you will get messed up chroma ghosting artifacts
    Thanks. This confirms my experience. It's just a bit misleading how it is described in the wikis and tutorials, when one simply refers to 'width' and 'height'.
    Quote Quote  
  9. Formerly 'vaporeon800' Brad's Avatar
    Join Date
    Apr 2001
    Location
    Vancouver, Canada
    Search PM
    Weird. At the bottom of your screenshot I see the skewed line (head switch point), then skew-corrected "head-switching noise", then part of the Vertical Sync of the next frame. This means your capture is vertically-delayed; the top of the frame is getting cropped off.

    What was your workflow??
    My YouTube channel with little clips: vhs-decode, comparing TBC, etc.
    Quote Quote  
  10. Member
    Join Date
    Oct 2001
    Location
    United Kingdom
    Search Comp PM
    The work flow was:

    Panasonic HD640 VCR - Scart connect to Panasonic DMR-ES10 DVD Recorder - composite out to Hauppauge HD-PVR2 Gaming edition.

    Three points

    1) I am not sure the DVD recorder was doing anything, but I have heard it stabilises the image even if not recording it.
    2) I didn't record directly to DVD, as the tape I am trying to record displayed a "cannot record" message - presumably macrovision protected.
    3) I wouldn't be surprised if the HD-PVR2 is the culprit, as it does seem somewhat buggy!
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!