VideoHelp Forum
+ Reply to Thread
Results 1 to 14 of 14
Thread
  1. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Hello, I'm trying to process an old, poor quality, music video from the sixties .
    It's H.264 video and aac audio in an MKV. The video is 450*360, so I'm cropping by 2 to make
    it divisible by 4, and acceptable to the cnr2 chroma noise reduction.

    The problem is, this script, as is, causes the video to tear severely to the top right, and bottom left.
    If I just have directshowsource and converttoyuy2(), virtualdub doesn't open it, but gives a message saying the
    size must be divisible by 4.

    Here's my simple script:
    directShowSource("J:\media 1\old_video.mkv",fps=29.97)
    ConvertToYUY2()
    Crop(2,0,-0,-0)
    cnr2()

    On a side note, if I drag the MKV to virtualdub (it has the directshow input plugin) it opens just fine.
    I guess I could process it that way, but I would like to find out what is going wrong in Avisynth.
    Quote Quote  
  2. Is it interlaced? If so, I think you have to process it differently when cropping: ConvertToYUY2(interlaced=true) , and cropping has to be done in 4's for interlaced YV12
    Quote Quote  
  3. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Hello, no it's not interlaced. Here's a couple of images showing the
    successful open of the MKV directly in Virtualdub, and the script
    open showing the tearing:



    Quote Quote  
  4. If you take out the crop, does it tear?

    This looks more like it could be a decoder issue, what directshow decoder are you using? ffdshow, coreavc? etc...

    If it's a problem with your directshow decoder, instead of DirectShowSource(), you could try FFMpegSource() or FFVideoSource() ; or try switching decoders e.g. ffdshow or divx 7
    Quote Quote  
  5. Banned
    Join Date
    Jun 2007
    Location
    UNREACHABLE
    Search Comp PM
    Try this (tweak as needed):

    Code:
    DirectShowSource("J:\media 1\old_video.mkv",fps=29.97)
    AddBorders(1,0,1,0)
    Crop(2,0,-2,-0)
    /////////
    Quote Quote  
  6. The Directshow (divx? xvid?) decoder isn't handling the 450 pixel wide (mod2) image correctly (some decoders require mod4, some mod2). Try using AviSource() instead of DirectShowSource(). Or a different DirectShow decoder.
    Quote Quote  
  7. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Thanks for the tips.
    I haven't tried out Midzuki's tip yet, but I booted up a 2nd XP I have on
    the same box. In this 2nd system, ffdshow is active, while in the 1st
    coreavc is handling the H.264.
    The problem does not occur on the 2nd system.

    Regarding poisondeathrays suggestion "If you take out the crop, does it tear? " Virtualdub will not accept the script - It complains about the width not being divisible by 4 -
    Although this may be an Avisynth message being relayed by Virtualdub ?
    Quote Quote  
  8. Originally Posted by davexnet
    Virtualdub will not accept the script - It complains about the width not being divisible by 4 -
    Although this may be an Avisynth message being relayed by Virtualdub ?
    I believe it's cnr2() causing that message. Try getting rid of it too. VirtualDub doesn't mind mod2 YUY2.
    Quote Quote  
  9. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    I reduced it to nothing more than the directshowsource statement and I still get:


    Quote Quote  
  10. directShowSource("J:\media 1\old_video.mkv",fps=29.97).Crop(2,0,-0,-0)
    ConvertToYUY2()
    cnr2()
    Quote Quote  
  11. Wasn't the original problem solved? (i.e. coreavc was causing the problem) ?
    Quote Quote  
  12. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    poisondeathray - yes! The problem is solved,
    but there's an academic discussion going on now.
    I tried out jagabo's suggestion above - it open's fine in Virtualdub,
    but the image is distorted, as described in the first post. I tried avisource instead of directshowsource,
    but it wouldn't open the MKV file.

    As poisondeathray reminds us, using ffdshow instead of coreavc
    resolves the problem.
    Opening the source file in Vdub directly also works fine.

    Is this a bug in Coreavc ?
    Quote Quote  
  13. What version of coreavc are you using? Is it the pro version? If this is a replicable "bug" , consider sending the sample in . When opening the file directly in vdub , it uses the VFW system, not directshow. If you have ffdshow installed or x264vfw, that is probably what is being used to decode in vdub.

    I suggested this earlier, but another avisynth source filter option for h.264 in .mkv is FFMpegSource or FFVideoSource (the latter is the newer version), both are based on libavcodec for decoding and frame accurate (unlike DirectShowSource)

    For the academic discussion, is it vdub/avisynth combo that is causing the issue with mod4, or can you use something like AvsP?

    Also are you sure of the clip frame dimensions? There could be aspect ratio signalling in the h.264 stream if encoded anamorphcially, or display aspect ratio signalling in the mkv container. You could use avinaptic for more information

    EDIT: yes I played around with samples resized and it seems it's an avisynth limitation - I get the same error message for a YV12 source regardless of previewing in vdub, mpc or avsp
    Quote Quote  
  14. Many codecs don't encode or decode properly with mod2 frame sizes. Mod2 should be avoided.
    Quote Quote  



Similar Threads

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