VideoHelp Forum
+ Reply to Thread
Page 1 of 3
1 2 3 LastLast
Results 1 to 30 of 61
Thread
  1. I have a PNG sequence I want to overlay over some VHS-sourced footage. By default it looks way to sharp and clear. So I tried outputting at half-resolution from After Effects, then doing a Scale to Frame Size in Premiere, but that just looks pixelated and digital instead of soft and fuzzy.

    What's the best way to go about this?
    Quote Quote  
  2. You can degrade the sequence using various methods.

    One that creates fairly authentic results is a plugin called Red Giant VHS
    https://www.maxon.net/en/red-giant/universe/vhs
    Quote Quote  
  3. I'm still on CS6 and that's rather expensive.

    It's just motion graphics, it's not actual video content or anything, so I'm really just needing it less sharp rather than anything super fancy.
    Quote Quote  
  4. Less sharp - you can apply a blur .

    I doubt match that well, the VHS look isn't just a "blur" applied
    Quote Quote  
  5. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    Just record it to VCR and then recapture it and take a still from the footage assuming you have a VCR.
    Quote Quote  
  6. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Jagabo, that's great! Should have put an ES15 in there though-it's a bit wobbly.
    Quote Quote  
  7. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    Originally Posted by dellsam34 View Post
    Just record it to VCR and then recapture it and take a still from the footage assuming you have a VCR.
    This is probably easiest and looks most authentic.
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  8. Originally Posted by koberulz View Post
    So I tried outputting at half-resolution from After Effects, then doing a Scale to Frame Size in Premiere, but that just looks pixelated and digital instead of soft and fuzzy.
    Do you have a choice of scaling algorithm? It sounds like you got a point resize (AKA nearest neighbor). You want something like bilinear instead. In fact, VHS has about 320x480 resolution so you want to scale twice, first down to 320x480, then up to 720x480 (assuming an NTSC ITU cap), both with bilinear.
    Quote Quote  
  9. It's an overlay with transparency, so recording it on a VHS won't work.

    It's PAL. I output from AE at half-res, so 360 wide, which is near enough to VHS res, but the Premiere scale-up just looks awful.
    Quote Quote  
  10. Originally Posted by jagabo View Post
    I missed this post somehow.

    So my output is a transparent PNG sequence from AfterEffects, then I'm overlaying that in Premiere at the moment. I don't think I can overlay it in AviSynth, just because of having to sort out cuts and such...so is there a way to just process the PNG sequence with AviSynth? Am I better off outputting in a different format, like AVI, from AE? Can AviSynth output anything that supports transparency?

    How do I actually use that plugin (ie, what are the options)? There's no readme. There's an feq file, no clue what that is.
    Quote Quote  
  11. I've never used it but a quick looks shows it comes with a sample AVS script.
    Quote Quote  
  12. I've managed to write out a cleaner version that only does what I want, but how can I turn it into a plugin? I created an AVS file, defined a function, and then dropped that in the plugins folder but it didn't work. Copying the same function to the top of my AviSynth script did work.

    And my questions about transitioning from AE to AviSynth still stand...the filter seems not to handle transparency at all but I don't know how to fix that.

    Here's what I whittled it down to:
    Code:
    function Retrograde(clip clp)
    { 
    SourceVideo = clp.bilinearresize(392,576)
    loss = imagesource("mask\hsync_%03d.bmp",end=127).assumefps(25,1).loop(1000)
    
    original = converttorgb32(sourcevideo).levels(0,1,255,4,200)
    
    grey1 = greyscale(original).bilinearresize(288,576).blur(-1,1).bicubicresize(400,576)
    grey2 = pointresize(grey1,800,576).crop(0,0,799,576).addborders(1,0,0,0).bilinearresize(400,576)
    
    hsyncloss1 = mergeargb(showgreen(loss),showblue(loss),showblue(loss),showblue(loss)).pointresize(400,576)
    hsyncloss2 = invert(hsyncloss1,"A")
    greysync1 = layer(grey1,hsyncloss1)
    greysync2 = layer(grey2,hsyncloss2)
    grey = overlay(greysync1,greysync2,mode="add",opacity=1).converttoyv12
    
    colorinputu = original.bilinearresize(100,576).blur(1,0).bilinearresize(400,576)
    colorinputv = colorinputu
    
    colorlossu = mergeargb(showred(loss),showblue(loss),showblue(loss),showblue(loss)).pointresize(400,576)
    colorlossv = trim(colorlossu,32,0)
    
    coloru = layer(colorinputu,colorlossu).converttoyv12
    colorv = layer(colorinputv,colorlossv).converttoyv12
    color = mergechroma(coloru,colorv,0.5).coloryuv(gain_y=-256,cont_u=128,cont_v=128)
    
    final = overlay(grey,color,mode="add",opacity=1).levels(40,1,255,0,255).bilinearresize(720,576)
    
    return final
    }
    Needs further tweaking to allow transparency, and if I could get that sorted as a plugin that would be ideal.
    Quote Quote  
  13. Can you provide some typical samples of your png images with alpha channel?

    That script is only blurring the video and adding some halos. Is that all you're looking for?
    Quote Quote  
  14. I used the Nyan_Cat_Sample.avi as a large overlay. I converted the blue background to transparent. I blurred it, added halos and luma/chroma noise, then overlaid it onto a flat grey background. Is this something like you want?

    Image
    [Attachment 67587 - Click to enlarge]
    Image Attached Files
    Quote Quote  
  15. I'd need the output to have a transparent background, so I can overlay it. It's nothing super complicated, just text and a couple of logos.

    Originally Posted by jagabo View Post
    That script is only blurring the video and adding some halos. Is that all you're looking for?
    As opposed to what? It seems decent from what I've tested. Certainly better than the shitty rescale I was doing.

    While it's not graphically complicated, there's a lot of scripting going on, so the PNG sequences I've already generated account for probably a week of constant rendering time. As such I'm pretty keen to use the PNGs rather than outputting all over again to AVI, but I'm not sure how to go about doing that.
    Quote Quote  
  16. Additional point: still not sure why it's not working as a plugin?
    Quote Quote  
  17. Originally Posted by koberulz View Post
    I've managed to write out a cleaner version that only does what I want, but how can I turn it into a plugin? I created an AVS file, defined a function, and then dropped that in the plugins folder but it didn't work. Copying the same function to the top of my AviSynth script did work.
    Originally Posted by koberulz View Post
    Additional point: still not sure why it's not working as a plugin?
    That's not a "plugin" in avisynth lingo . Plugins for avisynth mean things like .dll's

    What you want is an "auto imported script" - when you change the .avs extension to .avsi and put into the plugins folder it will automatically load
    Quote Quote  
  18. Here's simple function that blurs an ARGB image like your Retrograde() but retains (and blurs) the alpha channel:

    Code:
    function VHS_blur(clip v)
    {
        v.LanczosResize(280,v.height).Sharpen(0.2, 0.0).LanczosResize(v.width,v.height)
    }
    If you want it greyscale convert to greyscale before or after calling it. Same for levels adjustments.
    Quote Quote  
  19. Originally Posted by koberulz View Post

    While it's not graphically complicated, there's a lot of scripting going on, so the PNG sequences I've already generated account for probably a week of constant rendering time. As such I'm pretty keen to use the PNGs rather than outputting all over again to AVI, but I'm not sure how to go about doing that.
    When you import PNG's with alpha channel with ImageSource, make sure you use pixel_type="RGB32" to import the alpha channel

    To export the script, you can export a PNG sequence with transparency with ImageWriter(), or with ffmpeg, or with vdub2 . Or use some other format like MOV (e.g. PNG in MOV or QT animation), or AVI (e.g. lagarith and utvideo support RGBA) are common choices for alpha support
    Quote Quote  
  20. Originally Posted by jagabo View Post
    Here's simple function that blurs an ARGB image like your Retrograde() but retains (and blurs) the alpha channel:

    Code:
    function VHS_blur(clip v)
    {
        v.LanczosResize(280,v.height).Sharpen(0.2, 0.0).LanczosResize(v.width,v.height)
    }
    If you want it greyscale convert to greyscale before or after calling it. Same for levels adjustments.
    Are you saying to use this instead, or as well? I'm not sure I follow.


    Originally Posted by poisondeathray View Post
    When you import PNG's with alpha channel with ImageSource, make sure you use pixel_type="RGB32" to import the alpha channel

    To export the script, you can export a PNG sequence with transparency with ImageWriter(), or with ffmpeg, or with vdub2 . Or use some other format like MOV (e.g. PNG in MOV or QT animation), or AVI (e.g. lagarith and utvideo support RGBA) are common choices for alpha support
    I've just never worked with transparency in AviSynth before. So I'm not sure a) how to retain alpha through the filtering process and b) how to output. How does one actually run ImageWriter?

    I'm also not sure how to import the PNG sequence. I can import one PNG, but the syntax for sequencing confuses me.
    Quote Quote  
  21. Import a PNG image sequence with alpha channel:

    Code:
    ImageSource("ovr%03d.png", start=0, end=11, pixel_type="RGB32")
    "ovr%03d" means "ovr" followed by a three digit decimal number with leading zeros, starting with 000 and ending with 011: ovr000.png, ovr001.png, ovr002.png... ovr011.png.

    Code:
    ovr = ImageSource("ovr%03d.png", start=0, end=11, pixel_type="RGB32") 
    ovr = VHS_blur(ovr)
    
    # stop here if you want to export a PNG sequence or video
    # or
    # continue using the image sequence as an overlay, 
    
    background = ColorBars() # or load a video file
    Overlay(background, ovr, mask=ovr.ShowAlpha())
    Quote Quote  
  22. Am I able to just not define the end, so it continues until it runs out of PNGs? How does it handle a change in the number of digits? AE has a minimum of five (so it starts "filename_00000.png", "filename_00001.png", etc) but the sequence is long enough to hit six-digit frame numbers.

    Does that not work with the Retrograde() function? Retrograde() is a bit too dark for my taste, and perhaps a little too blurry, but VHS_blur() looks a bit too nice. A middle ground on blurriness with unaltered luma would be the ideal, although that being said VHS_blur() still looks better (or worse, as it were) than the full-res sequence. I just don't really understand what each line of Retrograde() does, so it's difficult to dig in and tweak. I tried removing all the levels() calls but it blew out way too bright.

    And I'm still not sure how to use ImageWriter(), do I call it and then just play the file in VDub, or...?
    Quote Quote  
  23. I don't think you can automatically continue from five digit names into six digit names. Just do it as two sequences and join them together.

    Code:
    part1 = ImageSource("ovr%05d.png", start=0, end=99999, pixel_type="RGB32") 
    part2 = ImageSource("ovr%06d.png", start=100000, end=whatever, pixel_type="RGB32") 
    part1+part2
    If VHS_blur() doesn't blur enough for you then blur the video more. If you want a black-and-white result add GreyScale(). If you want the video resized to 720x576 then resize it. If you want it darker make it darker. You can add all that inside VHS_blur() or after calling it.

    Code:
    VHS_blur().Blur(0.5).RGBAdjust(r=0.9, g=0.9, b=0.9).BilinearResize(720,576).GreyScale()
    I didn't bother modifying Retrograde() because it was much easier to create a one line function that does approximately the same as its two dozen lines.
    Last edited by jagabo; 15th Nov 2022 at 07:19.
    Quote Quote  
  24. Why do you keep mentioning greyscale?
    Quote Quote  
  25. Retrograde() converts color video to greyscale. So I was guessing that's what you wanted.
    Quote Quote  
  26. No it doesn't?
    Quote Quote  
  27. VHS_blur()
    Click image for larger version

Name:	Untitled-1.jpg
Views:	45
Size:	176.2 KB
ID:	67652

    Retrograde()
    Click image for larger version

Name:	Untitled-2.jpg
Views:	44
Size:	144.6 KB
ID:	67653
    Quote Quote  
  28. Originally Posted by koberulz View Post

    And I'm still not sure how to use ImageWriter(), do I call it and then just play the file in VDub, or...?

    http://avisynth.nl/index.php/ImageWriter

    Code:
    ImageWriter("PATH\output_%05d.png", type="PNG")
    You can "run" the script by running analysis pass in vdub to write the files, or avsr64 script.avs, or ffmpeg -i script.avs -an -f null NUL . avsr64 is probably the fastest by a small amount
    Quote Quote  
  29. RetroGrade() converts to greyscale when I call it:

    Code:
    function Retrograde(clip clp)
    { 
    SourceVideo = clp.bilinearresize(392,576)
    loss = imagesource("mask\hsync_%03d.bmp",end=127).assumefps(25,1).loop(1000)
    
    original = converttorgb32(sourcevideo).levels(0,1,255,4,200)
    
    grey1 = greyscale(original).bilinearresize(288,576).blur(-1,1).bicubicresize(400,576)
    grey2 = pointresize(grey1,800,576).crop(0,0,799,576).addborders(1,0,0,0).bilinearresize(400,576)
    
    hsyncloss1 = mergeargb(showgreen(loss),showblue(loss),showblue(loss),showblue(loss)).pointresize(400,576)
    hsyncloss2 = invert(hsyncloss1,"A")
    greysync1 = layer(grey1,hsyncloss1)
    greysync2 = layer(grey2,hsyncloss2)
    grey = overlay(greysync1,greysync2,mode="add",opacity=1).converttoyv12
    
    colorinputu = original.bilinearresize(100,576).blur(1,0).bilinearresize(400,576)
    colorinputv = colorinputu
    
    colorlossu = mergeargb(showred(loss),showblue(loss),showblue(loss),showblue(loss)).pointresize(400,576)
    colorlossv = trim(colorlossu,32,0)
    
    coloru = layer(colorinputu,colorlossu).converttoyv12
    colorv = layer(colorinputv,colorlossv).converttoyv12
    color = mergechroma(coloru,colorv,0.5).coloryuv(gain_y=-256,cont_u=128,cont_v=128)
    
    final = overlay(grey,color,mode="add",opacity=1).levels(40,1,255,0,255).bilinearresize(720,576)
    
    return final
    }
    
    
    ImageSource("Untitled-1.jpg", start=0, end=23, fps=23.976, pixel_type="RGB32") 
    RetroGrade()
    Image
    [Attachment 67654 - Click to enlarge]


    RetroGrade() copy/pasted from post #13.

    I also have a version of VHS_blur() that blurs the chroma a lot more but I didn't post it because I though you wanted greyscale (there's no point in blurring the chroma if you arn't going to use it).
    Last edited by jagabo; 15th Nov 2022 at 10:21.
    Quote Quote  



Similar Threads

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