VideoHelp Forum




+ Reply to Thread
Results 1 to 27 of 27
  1. Member
    Join Date
    May 2007
    Location
    Israel
    Search Comp PM
    Hello,

    I have captured an analogue VHS cassette to my PC. The capture was done with a 720*576 aspect ratio using VirtualDub. The resulted video file aspect ratio have been distorted and is now 720*568. I read in the Doom9 guide that this effect is normal and that I should resize. So I used the command BilinearResize(720, 576) and now the picture is correct. My destination is a DVD so I don't deinterlace the video - I let the DVD player do it. The question is if the resizing does not mess the fields? I resized it height-wise so the fields got thicker. Will the DVD be able to accept the altered fields and produce a deinterlaced picture?

    Please help.
    Quote Quote  
  2. Member Alex_ander's Avatar
    Join Date
    Oct 2006
    Location
    Russian Federation
    Search Comp PM
    If your target is PAL DVD, then 720x576 (that you already have) is the right size for sending to encoder. Resizing any interlaced video vertically is not safe without deinterlacing or bobbing (and this is not desirable in most cases). You better hide bottom lines using Letterbox command instead of cropping or add a bottom border if already cropped it.
    Quote Quote  
  3. Member
    Join Date
    May 2007
    Location
    Israel
    Search Comp PM
    Originally Posted by Alex_ander
    If your target is PAL DVD, then 720x576 (that you already have) is the right size for sending to encoder. Resizing any interlaced video vertically is not safe without deinterlacing or bobbing (and this is not desirable in most cases).
    So if it is not recommended to resize vertically - what should I do?

    Originally Posted by Alex_ander
    You better hide bottom lines using Letterbox command instead of cropping or add a bottom border if already cropped it.
    My video after capture is 720*568 instead of 720*576. That means I don't have excessive area - I have shortage in area. I don't need to hide or crop. I need to extend it vertically in 8 pixels.

    What is the solution?
    Quote Quote  
  4. Member Alex_ander's Avatar
    Join Date
    Oct 2006
    Location
    Russian Federation
    Search Comp PM
    You need to add 8 blank lines (if I remember right, you use AviSynth) complementing video size to 576. If you haven't resized+saved it yet, this will keep line structure and prevent from getting artifacts from resizing.

    AddBorders(0,0,0,8)

    If you feel you really need to correct AR by resizing, the right way to do it is using smart bob function (e.g. in LeakKernelDeint filter for AviSynth). It builds a frame for each field with doubling framerate. This provides missing pixel data needed for proper resizing (or other filtering) each separated field; after resizing you build new frames from fields taken from each of those temporary frames. Do you want the details of such a script or decide to add border?
    Quote Quote  
  5. Member
    Join Date
    Aug 2004
    Location
    United States
    Search Comp PM
    @ 1ignition

    For interlace, in avisynth you can try separating the fields, resizing(to half of 576), then weaving

    Code:
    separatefields()
    BilinearResize(720,288)
    weave()
    This will leave your final resolution as 720x576
    Quote Quote  
  6. Member gadgetguy's Avatar
    Join Date
    Feb 2002
    Location
    West Mitten, USA
    Search Comp PM
    Originally Posted by Pinstripes23
    @ 1ignition

    For interlace, in avisynth you can try separating the fields, resizing(to half of 576), then weaving

    Code:
    separatefields()
    BilinearResize(720,288)
    weave()
    This will leave your final resolution as 720x576
    That's my preferred method, although I use Lanczos4Resize() instead of BilinearResize().
    "Shut up Wesley!" -- Captain Jean-Luc Picard
    Buy My Books
    Quote Quote  
  7. Member
    Join Date
    Aug 2004
    Location
    United States
    Search Comp PM
    Originally Posted by gadgetguy
    That's my preferred method, although I use Lanczos4Resize() instead of BilinearResize().
    I would too, but 1gnition initially used bilinear in his 1st post, so thought I'd throw that in the script instead.
    Quote Quote  
  8. Adding 8 lines will work better than resizing. Since you're already using VirtualDub you can use it's resize filter. In the top half resize to the same size as the source 720x568. Then enable the Exand Frame And Letterbox Image option set the size to 720x576. That will add 4 lines to the top and 4 lines to the bottom.

    AVISynth's AddBorders() would work better if your video is not in RGB format.

    Your best solution is to simply capture at the right size to start with, 720x576.

    This:

    Code:
    LeakKernelBob(Order=1)#if TFF 
    LanczosResize(720,576)
    SeparateFields() 
    SelectEvery(4,0,3)#if TFF 
    Weave()
    will work better than

    Code:
    SeparateFields()
    LanczosResize(720,576)
    Weave()
    If you're going resize in AVISynth.
    Quote Quote  
  9. Member
    Join Date
    Aug 2004
    Location
    United States
    Search Comp PM
    Originally Posted by jagabo
    Code:
    SeparateFields()
    LanczosResize(720,576)
    Weave()
    If you're going resize in AVISynth.
    576 resize after separating fields? It will produce a vert resolution of 1152 after weaving.
    Quote Quote  
  10. Originally Posted by Pinstripes23
    Originally Posted by jagabo
    Code:
    SeparateFields()
    LanczosResize(720,576)
    Weave()
    If you're going resize in AVISynth.
    576 resize after separating fields? It will produce a vert resolution of 1152 after weaving.
    Sorry, typo. Obviously it should be 720,288.
    Quote Quote  
  11. Member
    Join Date
    May 2007
    Location
    Israel
    Search Comp PM
    Thank you all for the replies

    Originally Posted by Alex_ander
    Do you want the details of such a script or decide to add border?
    I would prefer the Smartbob way. BTW - isn't that the method "jagabo" suggested?

    Originally Posted by Pinstripes23
    @ 1ignition

    For interlace, in avisynth you can try separating the fields, resizing(to half of 576), then weaving

    Code:
    separatefields()
    BilinearResize(720,288)
    weave()
    This will leave your final resolution as 720x576
    Is that true that this:

    Code:
    LeakKernelBob(Order=1)#if TFF
    LanczosResize(720,576)
    SeparateFields()
    SelectEvery(4,0,3)#if TFF
    Weave()
    Is better?
    Quote Quote  
  12. Member Alex_ander's Avatar
    Join Date
    Oct 2006
    Location
    Russian Federation
    Search Comp PM
    1.yes (be sure to get and load LeakKernelDeint filter)
    2.yes
    Quote Quote  
  13. Member
    Join Date
    Aug 2004
    Location
    United States
    Search Comp PM
    Originally Posted by 1gnition
    Originally Posted by Pinstripes23
    @ 1ignition

    For interlace, in avisynth you can try separating the fields, resizing(to half of 576), then weaving

    Code:
    separatefields()
    BilinearResize(720,288)
    weave()
    This will leave your final resolution as 720x576
    Is that true that this:

    Code:
    LeakKernelBob(Order=1)#if TFF
    LanczosResize(720,576)
    SeparateFields()
    SelectEvery(4,0,3)#if TFF
    Weave()
    Is better?
    Personally I didn't notice a difference from a quick test just now on a 2 min dvd clip. The LeakKernelBob way converts slower obviously but test both out and see what you think.
    Quote Quote  
  14. Originally Posted by Pinstripes23
    Personally I didn't notice a difference from a quick test just now on a 2 min dvd clip. The LeakKernelBob way converts slower obviously but test both out and see what you think.
    Try a resolution test pattern. Or a video with sharp horizontal edges.

    Here are some sample crops, the top was done with SeparateFields(), the bottom with LeakKernelDeint():



    These samples were enlarged from 720x480 to 720x576. The larger resize makes the problem more obvious.
    Quote Quote  
  15. Member
    Join Date
    Aug 2004
    Location
    United States
    Search Comp PM
    K thanks for the visual confirmation jagabo. I don't resize interlaced video too much but next time I come across one where I need to, I'll keep this script in mind.

    Now would this script be useful if you need to apply a denoiser without resizing? I assume it would be applied right after the BOB since that's where progressive frames are created.
    Quote Quote  
  16. Member
    Join Date
    May 2007
    Location
    Israel
    Search Comp PM
    Thanks for the replies. I will encode and burn and see the results.
    Quote Quote  
  17. Member
    Join Date
    May 2007
    Location
    Israel
    Search Comp PM
    Guys, I encoded and burned and there is a problem - the video seems to be on a low FPS or something. The movement is not smooth! The problem does not exists while running the .mpv file on the computer but only when playing in the DVD player with a TV.

    I downloaded the plugin and used this script:

    Code:
    LeakKernelBob(Order=1)#if TFF
    LanczosResize(720,576)
    SeparateFields()
    SelectEvery(4,0,3)#if TFF
    Weave()
    at the the end of my AVS script. My full AVS script is as follows:

    Code:
    ConvertToYV12(interlaced=true)
    DeSpot(interlaced=true, pwidth=730, pheight=4, p1=76, mthres=35, p2=12)
    ConvertToYUY2(interlaced=true)
    Cnr2("xxx",4,5,255)
    ChromaShift(C=-6)
    GuavaComb(Mode = "PAL", Recall = 75, MaxVariation = 25, Activation = 40)
    BilinearResize(720, 576)
    
    # Only Spatial:
    
    SeparateFields()
    VagueDenoiser(threshold=4, method=1, nsteps=6, chromat=0)
    Weave()
    FadeIO2(80)
    
    # Resizing:
    
    LeakKernelBob(Order=1)#if TFF
    LanczosResize(720,576)
    SeparateFields()
    SelectEvery(4,0,3)#if TFF
    Weave()
    
    # Color Adjusting:
    
    tweak(+3, 1.2, +20, 1.2)
    Before that there is the whole chapters division and transition which was generated using AVSCutter and doesn't seem relevant. I can post that too if you want.

    Please tell me if you detect any error in my script which may cause the problem I mentioned. You were really helpful until now, don't leave me on the final step!

    Thanks!!

    Edit: OMG! I noticed that I left the bilinear command. I should have erased that. Any chance that this is what caused the problem?
    Quote Quote  
  18. Any chance that this is what caused the problem?

    Well, it's a major screwup, that's for sure, and completely ruined the video. The idea of that whole resizing-while-progressive thing is that you also do all of your filtering while it's progressive (except for any filtering you do that's interlace aware, as Despot evidently is). That didn't do your video any good, either. Your script is a complete mess.
    Quote Quote  
  19. Note that LeakKernelBob(Order=1) is for top field first video. Bottom field first should use LeakKernelBob(Order=0). You may also have to change SelectEvery(4,0,3) to SelectEvery(4,1,2). I don't remember for sure and I don't feel like thinking too hard right now! Maybe manono remembers.

    The wrong field order would cause jerky playback where the jerks are very fast, almost a strobing effect. It doesn't sound like that is what you're seeing.
    Quote Quote  
  20. Member
    Join Date
    May 2007
    Location
    Israel
    Search Comp PM
    Originally Posted by manono
    Your script is a complete mess.
    Besides the Bilinear? If it is, then I would like to know what is out of order.

    Thank you.
    Quote Quote  
  21. Member Alex_ander's Avatar
    Join Date
    Oct 2006
    Location
    Russian Federation
    Search Comp PM
    Originally Posted by 1gnition
    If it is, then I would like to know what is out of order.
    1.A good rule is to add necessary filters between LeakKernelBob() and SeparateFields() at which point the video is progressive (double framerate). Use the field order value (0 or 1) matching your source (as Jagabo mentioned). If in doubt, test both versions after LeakKernelBob() line (disable the lines below) in VDub: the motion should progress with each frame. Most likely, the video from capture is BFF. Before SeparateFields you can either add AssumeTFF() to get TFF in the end or change (4,0,3) to (4,1,2) otherwise by Avs's default you'll get BFF. You should know exactly which one you have (TFF or BFF) for encoding any interlaced video in CCE. In advanced CCE settings you adjust it for field order of your video. E.g. if your video is BFF and you want to encode it to TFF, you check 'TFF' and use 'offset line' 1 instead of 0 (0 is used if you set output field order matching your source). It's the only way to prevent from jerkyness.

    2.Begin with a simple script (disable less important filters) and put everything in proper order. After adding a filter always test the script in VDub to be sure you move in the right direction.

    3.Colour space conversion for CCE should be in the very end. Conversions inside the script are only done in case your video is different from what a particular filter needs, e.g. if a VDub plugin is used, you should convert to RGB. Most filters for AviSynth support (YV12+YUY2).
    Quote Quote  
  22. Member
    Join Date
    May 2007
    Location
    Israel
    Search Comp PM
    All right. I followed your guidelines and corrected things.

    1. I used VagueDenoiser between LeakKernelBob() and SeparateFields().
    2. I checked what kind of scan I have and it is TFF.
    3. I added AssumeTFF() before SeparateFields().
    4. All the color conversions are necessary for filters. YV12 for Despot, then YUY2 for Guavacomb, then again YUY2 because this is the color type I based the Tweak on and I don't want to start again Tweak with YV12.

    Code:
    SegmentedAVISource("d:\vhs\capture.avi")
    ConvertToRGB(interlaced=true) # For AVSCutter script
    
    # Removal of scratches:
    
    ConvertToYV12(interlaced=true)
    DeSpot(interlaced=true, pwidth=730, pheight=4, p1=76, mthres=35, p2=12, show=2)
    
    # Removal of chroma artefacts:
    
    Cnr2("xxx",4,5,255)
    ChromaShift(C=-6)
    ConvertToYUY2(interlaced=true)
    GuavaComb(Mode = "PAL", Recall = 75, MaxVariation = 25, Activation = 40)
    
    LeakKernelBob(Order=1)
    VagueDenoiser(threshold=4, method=1, nsteps=6, chromat=0) # Spatial Denoiser
    LanczosResize(720,576) # Resize 
    AssumeTFF()
    SeparateFields()
    SelectEvery(4,0,3)
    Weave()
    
    # Color Adjusting:
    
    ConvertToYUY2(interlaced=true)
    Tweak(+3, 1.2, +20, 1.2)
    
    FadeIO2(80)
    Well, I hope this is better.
    Quote Quote  
  23. Member Alex_ander's Avatar
    Join Date
    Oct 2006
    Location
    Russian Federation
    Search Comp PM
    Looks better but you still use ConvertToYV12() twice for filters working one after the other. What does VDub read for colour space of the input video in properties (load a script with just open video line), maybe it's already YV12? Where is RGB used?
    You use some filters with interlace-aimed option, but maybe they would still better work in progressive mode (by putting after LeakKernelBob). Many of such filters internally just separate fields, process, then weave back and you already have a better alternative to this (smart bob) in the script that is applied just once. It takes more time to process at double framerate but can be better. I'd group colour/level adjustment operations in one place and test if all filters are necessary for this, before or after denoiser they work better, etc.
    When you feel ready to encode, look at the default CCE settings for field order+offset line and correct if necessary. Do a short encoding test first.
    Quote Quote  
  24. I agree, why all the colorspace conversions? Particularly, why the RGB conversion right off the bat?

    Add Info() right after the AviSource line at the top to find the colorspace of the source video. As Alex_ander says, it's perhaps (probably?) already YV12. I don't see why you need to convert to RGB at all, especially since you convert to YV12 in the very next line. Can GuavaComb be used while the video is interlaced? I'm just asking as I've never used it. I didn't understand your Tweak reasoning, either. The idea is to do as few colorspace conversions as possible. The idea is also not to overfilter. I don't know the shape your VHS source is in, but there's an awful lot of filtering going on in that script.
    Quote Quote  
  25. Member
    Join Date
    May 2007
    Location
    Israel
    Search Comp PM
    Originally Posted by Alex_ander
    Looks better but you still use ConvertToYV12() twice for filters working one after the other. What does VDub read for colour space of the input video in properties (load a script with just open video line), maybe it's already YV12? Where is RGB used?
    Been taken care of.

    Originally Posted by manono
    I agree, why all the colorspace conversions? Particularly, why the RGB conversion right off the bat?
    As I wrote in the comment - the RGB colorspace is meant for the AVSCutter script which I didn't post because it is not relevant.

    Originally Posted by manono
    Can GuavaComb be used while the video is interlaced? I'm just asking as I've never used it
    According to Doom9 guide it can.

    Originally Posted by manono
    but there's an awful lot of filtering going on in that script.
    I just followed Doom9 guide step by step and this is what I came up with. Apparently your approach is different. I really don't know which is better because I obviously know less then you. Moreover, I felt "guilty" because I thought I didn't use enough filters because Doom9 guide recommends to use spatial denoiser and temporal denoiser and I use only one of them. Nevertheless, it seems that every filter there is essential:

    Despot - for horizontal scratches in the source video.
    CNR2 - for chroma noise.
    Chromashift - for color bleeding.
    Guavacomb - for rainbow effect and dots crawl.
    Vaguedenoiser - for noise.
    Tweak - to improve colors in the video.

    Besides that I have another question. Now, I feel a bit bothersome, so if you fed up with me - just say. As you know, I resized the video back to 720*576. I burned a DVD, played it on my TV and noticed that the picture is a bit wide and that the sides are a bit cut. Is it possible or my mind is just playing tricks on me?
    Quote Quote  
  26. Is it possible or my mind is just playing tricks on me?

    Maybe. I would guess it's the effect of the Overscan:

    https://www.videohelp.com/glossary?O#Overscan

    You usually get less on a TV than you do on a computer as a computer monitor doesn't have any overscan.
    Quote Quote  
  27. Member
    Join Date
    May 2007
    Location
    Israel
    Search Comp PM
    Alrighty, then...
    Quote Quote  



Similar Threads

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