VideoHelp Forum




+ Reply to Thread
Results 1 to 11 of 11
  1. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Location
    Australia
    Search Comp PM
    Hello, I am looking to download a few samples of raw VHS captures eg from an old movie camera etc, preferably some with interlaced content and some without.

    I have a JVC VHS-C to DVD box, where the DVD can be separately ripped into a .mpg, however I hope someone here perhaps has a library of raw captures (or .mpgs like that) which I can use to test ?

    Vapoursynth R76+ new versions will eventually cause older non API-v4 plugins to cease to work, and I used the venerable CNR2 to denoise chroma.

    So ... I am knocking up a roughie script as a CNR2 replacement with "modern" denoising plugins and deinterlacer and perhaps even a deblocker (the JVS introduces terrible blocking) all being done in the right orders. eg bm3dcpu for denoising plane(s), bwdif for optional deinterlacing. It should auto-detect and deal with incoming interlacement and other properties and yield a choice of interlaced or deinterlaced (if the original was interlaced) in the incoming format.

    The CNR2 replacement script may end up being crap, but one never knows until one tries.

    Thank you in advance.
    Quote Quote  
  2. Member
    Join Date
    May 2005
    Location
    PAL User
    Search Comp PM
    What do you want, MPG or AVI?
    Quote Quote  
  3. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Location
    Australia
    Search Comp PM
    Either or both please,
    I will open them with vapoursynth bestsource plugin after checking their content characteristics with mediainfo.
    Quote Quote  
  4. Member
    Join Date
    May 2005
    Location
    PAL User
    Search Comp PM
    PMed.
    Quote Quote  
  5. why not convert CNR2 to API4?
    Quote Quote  
  6. Not what you specifically asked for, but here's an MPEG2 capture of the Snell and Wilcox SW2 test pattern that was made on an MPEG2 capture device (Dell Angel) - it can point out a variety of issues quickly:
    https://drive.google.com/file/d/1OWgKSJLKpsMvxRT6wWmpJB66w1xGOR73/view?usp=sharing


    Here's a laserdisc capture from composite:
    https://drive.google.com/file/d/1qV_ZkDCORTpDvqkU90ifj3FbCcIP32p4/view?usp=sharing


    Here's a random 5 second clip from U-Matic that was done with VHS_Decode:
    https://drive.google.com/file/d/1qLnmblBZETI2Fo24keipsR7dA7HT_trh/view?usp=sharing

    Those are just some short ones I happened to have on my Google Drive, so have at them. Would love to see what you can do with them.
    Quote Quote  
  7. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Location
    Australia
    Search Comp PM
    Thanks Alwyn, the samples confirm my experience with VHS capture files. Nearly anything goes. Conflicting metadata between tools (mediainfo, bestsource), missing metadata (interlace flagged but no first field nominated), etc, lovely !
    It's proceeding. Created a script but it's not near cnr2's goodness. Although the denoising and optional deinterlacing turns out to be almost trivial, wrapping to iteratively check on and guess/recommend proper frame characteristics and deny some (eg pulldown clips) was a more work. BM3D does fix up stuff, can't deny it, but now I'm considering running it after a cnr3 (cnr2 converted to vapoursynth API4 and seeing if AI can suggest something to add). Cheers ! PS if you have more noisy sources you may be willing to share, please PM me. ATM the script is pip installable directly from github but not worth it.

    Originally Posted by Columbo View Post
    why not convert CNR2 to API4?
    Yes am attempting that now. Not being a C person, it's iterative AI driven, with a future query "any things we can do to improve the NHS denoise outcome" ?

    Originally Posted by aramkolt View Post
    Those are just some short ones I happened to have on my Google Drive, so have at them. Would love to see what you can do with them.
    Thanks aramkolt. I'll download them after I finish fiddling with cnr3.
    Last edited by hydra3333; 22nd May 2026 at 23:53.
    Quote Quote  
  8. Any plans to share builds of cnr2 adjusted to API4, maybe even through pip ?
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  9. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Location
    Australia
    Search Comp PM
    sorry, i jumped straight to CNR3. So, no not cnr2. Hopefully if it works, cnr3 will be popped into pypi if I can figure out how or some kind soul adopts it out of my hands.

    I did want to initially but then thought I'm old and bored, so asked an AI ...

    CNR3 declares fmUnordered as its filter mode because i think the old CNR2 may rely on now-out-of-favour fmFrameState mode and its recursive algorithm (a frame computation relies on the previous frame's computed output) is inherently serial making frame-parallel execution impossible. cnr3 will not fix that, only perhaps marginally at a cost of some memory for caches.

    So, I'd like to try to squish in a one-off small cache manager to deal with out of order frame requests (which occur even with vapoursynth filter mode fmUnordered) whilst assuming the main use of CNR3 would be as a simple-convert-to-encode stream filter rather than a jumping around visual inspection filter.

    Yes, it may be a rabbit hole, yes probably there's a better way, ClaudeAI and ChatGPT thought it worth a go.

    No doubt a real a developer would indeed do better in a jiffy, but until one does ...
    Last edited by hydra3333; 24th May 2026 at 00:08.
    Quote Quote  
  10. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Location
    Australia
    Search Comp PM
    A thought.

    The "cnr2 replacement script" I originally tried using the modern BM3D denoiser wasn't really as successful. BM3D is easily callable directly anyway. The script does try to deal with progressive/interlaced and optionally deinterlace though. And it tries to guess missing clip frame characteristics, which can be a common issue on VHS sources.

    If anyone is bored enough, you could try it.
    The vscnr2_bm3d README and script are here. Try the README.
    https://github.com/hydra3333/vapoursynth_scripts/tree/main/vscnr2_bm3d

    It is pip installable directly from github (pip should auto install dependencies) using:
    Code:
    python.exe -m pip uninstall --disable-pip-version-check --no-cache-dir --verbose -y vscnr2_bm3d
    python.exe -m pip install --disable-pip-version-check --no-cache-dir --upgrade --check-build-dependencies --upgrade-strategy eager --verbose --no-warn-script-location --no-build-isolation "vscnr2-bm3d @ git+https://github.com/hydra3333/vapoursynth_scripts.git@main#subdirectory=vscnr2_bm3d"
    and if you are in the vapoursynth root folder and want to see if it compiles without running it,
    Code:
    python.exe -m py_compile "Lib\site-packages\vscnr2_bm3d\vscnr2_bm3d.py"
    There are 2 functions.
    1. If your incoming clip has well defined properties set, then bypass cnr2_bm3d_precheck_video_file() and call cnr2_bm3d() directly.

    2. If not, then perhaps try cnr2_bm3d_precheck_video_file() which uses pymediainfo/bestsource/vstools-heuristics to blend good properties and guess others and fix an odd PAL "_Primaries"; it wont fix missing interlaced TFF/BFF though.

    An example script:
    Code:
    import sys
    import vapoursynth as vs
    core = vs.core
    from vscnr2_bm3d import cnr2_bm3d, cnr2_bm3d_precheck_video_file
    f = r"D:\TEST\some_shocker_of_a_VHS_CAPTURE.avi"
    #----
    # Iterate this. cnr2_bm3d_precheck_video_file(f) will always halt vspipe.
    # Comment-out this call to cnr2_bm3d_precheck_video_file() when finished with it.  
    # Evolving, add "override" parameters to this call, as we iterate:
    cnr2_bm3d_precheck_video_file(f)  # add to this call during iterating to identifiable good clip properties
    #----
    # Open the file using your preferred source filter. I used BestSource here. Reputable.
    clip = core.bs.VideoSource(f)
    #----
    # Set source SetFrameProps HERE either your own, or as suggested by cnr2_bm3d_precheck_video_file()
    # value lists:
    # _FieldBased       0=PROGRESSIVE, 1=BFF, 2=TFF
    # _Range            0=LIMITED, 1=FULL
    # _Matrix           0=RGB, 1=BT709, 2=UNSPECIFIED, 4=FCC, 5=BT470_BG, 6=ST170_M, 7=ST240_M, 8=YCGCO, 9=BT2020_NCL, 10=BT2020_CL, 12=CHROMATICITY_DERIVED_NC, 13=CHROMATICITY_DERIVED_CL, 14=ICTCP
    # _Primaries        1=BT709, 2=UNSPECIFIED, 4=BT470_M, 5=BT470_BG, 6=ST170_M, 7=ST240_M, 8=FILM, 9=BT2020, 10=ST428, 11=ST431_2, 12=ST432_1, 22=EBU3213_E
    # _Transfer         1=BT709, 2=UNSPECIFIED, 4=BT470_M, 5=BT470_BG, 6=BT601, 7=ST240_M, 8=LINEAR, 9=LOG_100, 10=LOG_316, 11=IEC_61966_2_4, 13=IEC_61966_2_1, 14=BT2020_10, 15=BT2020_12, 16=ST2084, 17=ST428, 18=ARIB_B67
    # _ChromaLocation   0=LEFT, 1=CENTER, 2=TOP_LEFT, 3=TOP, 4=BOTTOM_LEFT, 5=BOTTOM
    # _SARNum/_SARDen   positive integers, e.g. 1/1, 16/15, 32/27
    # Rotation          usually 0, 90, 180, 270 if present
    # FlipHorizontal    0=false, 1=true if present
    # FlipVertical      0=false, 1=true if present
    # EXAMPLE SETTINGS ONLY - INSERT YOURS HERE:
    clip = core.std.SetFrameProps(
        clip,
        _FieldBased=1,   # BFF
        _Matrix=5,   # BT470_BG
        _Range=0,   # LIMITED
        _Primaries=5,   # BT470_BG
        _Transfer=5,   # BT470_BG
        _ChromaLocation=0,   # LEFT
        _SARNum=16,   # sample aspect ratio numerator
        _SARDen=15,   # sample aspect ratio denominator
        Rotation=0,   # preserve; this script does not rotate pixels
        FlipHorizontal=0,   # preserve; this script does not flip pixels
        FlipVertical=0,   # preserve; this script does not flip pixels
    )
    #----
    # I only noticed effect on a clackity old VHS sources with wild heavy chroma and luma settings for shockers of VHS captures 
    clip_denoised = cnr2_bm3d(clip, sigma_uv=16.0, sigma_luma=16.0, radius=2, full_quality_denoise=True, deinterlace=True, deinterlace_rate="same", deinterlace_quality="enhanced")
    #----
    clip_denoised.set_output()
    # OR perhaps INSTEAD Side-by-side original and denoised compare (if framerates are the same)
    #stacked_comparison = core.std.StackHorizontal([ clip, clip_denoised,])
    #stacked_comparison.set_output()
    See if it works at all using your script test_precheck.vpy (vspipe.bat is now provided in R76 root folder)
    Code:
    vspipe.bat --progress --filter-time test_precheck.vpy NUL >stdout.txt 2>stderr.txt
    type stderr.txt
    Try an encode of it.
    Code:
    vspipe.bat --progress --filter-time --container y4m "test_precheck.vpy" -  | "C:\SOFTWARE\Vapoursynth-x64\ffmpeg.exe" -hide_banner -v verbose -stats -f yuv4mpegpipe -i pipe: ... [the rest of your ffmpeg settings] ... -y "test_precheck.MP4"
    It'd be interesting to know if you arrive at the same view, not much use for VHS captures.
    Last edited by hydra3333; 24th May 2026 at 01:41.
    Quote Quote  
  11. sorry, i jumped straight to CNR3. So, no not cnr2.
    Okay, thanks so I'll stick with the API3 cnr2 for now.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  



Similar Threads

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