VideoHelp Forum

Try DVDFab and copy Ultra HD Blu-rays and DVDs! Or rip iTunes movies and music! Download free trial !
+ Reply to Thread
Page 2 of 2
FirstFirst 1 2
Results 31 to 47 of 47
Thread
  1. Originally Posted by nacho View Post
    I have an entire episode encoded losslessly both with chromamotion on and off, how can I find the frames which are different?
    You can subtract one video from the other then scan visually for differences:

    Code:
    v1 = WhateverSource("filename1.ext")
    v2 = WhateverSource("filename2.ext")
    Subtract(v1, v2)
    Levels(120,1,136,0,255) # amplified to make them very obvious
    Of course, that means you have to visually scan through the entire video to find the differences.

    Or you can subtract one image from the other then use AviSynth's conditional filters to detect the frames that differ and print out a list of frame numbers.

    Code:
    v1 = AviSource("file1.avi") # YV12 source
    v2 = AviSource("file2.avi") # YV12 source
    v1 = StackHorizontal(v1, StackVertical(v1.UtoY(), v1.VtoY())) # add U and V channels as luma
    v2 = StackHorizontal(v2, StackVertical(v2.UtoY(), v2.VtoY())) # add U and V channels as luma
    Subtract(v1, v2)
    WriteFileIf(last, "differences.txt", "(YPlaneMax(last) > 126) || (YPlaneMin(last) < 126)", "current_frame", append = false)
    When images are exactly the same all Y values will be 126 after Subtract(). Any differences will show up as less or more than that. You may need to adjust the two thresholds depending on how much the output of QTGMC varies.
    Quote Quote  
  2. Here's a script that uses one of the clips from the first post in this thread. I don't know if you'll find it to be of any use:

    Code:
    Mpeg2Source("VTS_05_1_clip.demuxed.d2v")
    
    v1 = QTGMC(chromamotion=false)
    v2 = QTGMC(chromamotion=true)
    
    s1 = StackHorizontal(v1, StackVertical(v1.UtoY(), v1.VtoY())) # add U and V channels as luma
    s2 = StackHorizontal(v2, StackVertical(v2.UtoY(), v2.VtoY())) # add U and V channels as luma
    Subtract(s1,s2)
    
    threshold = 50
    WriteFileIf(last, "VTS_05_differences.txt", "(YPlaneMax(last) > (126+threshold)) || (YPlaneMin(last) < (126-threshold))", "current_frame", append = false)
    
    StackHorizontal(last, v1, v2) # show diff, and both original videos
    Open it in VirtualDub and use File -> Run Video Analysis Pass to play through the entire video as fast as possible. VTS_05_differences.txt will be the list of different frames. Change threshold to a smaller value to get more frames, a bigger value to get fewer. Another possiblity is to use the absolute value of the differences and AverageLuma() instead. Or to only look at the luma or chroma channels.
    Quote Quote  
  3. Hi, sorry I use vapoursynth not avisynth. I ended up discovering that vdecimate in dryrun mode will create an absolute difference metric (between current frame and last frame) so I'm using that for comparisons.
    Quote Quote  
  4. I've just discovered that the episodes on youtube have none of blends or artifacts on the DVD...however every 4th frame is duplicate, the bitrate is very low, and it seems to be 720p - who knows what was done to make it that resolution. But it gives me hope there's a better source out there somewhere...
    Quote Quote  
  5. I downloaded one episode. It was badly inverse telecined to 23.976 fps. But each group of 4 frames included one duplicate and was missing one of the original frames. Ie, one original frame was replaced by a duplicate of another. So instead of a sequence like 1,2,3,4 it has 1,3,4,4. Resolution is better than VHS. My guess is it was made from a hard telecined NTSC DVD.
    Quote Quote  
  6. As far as I know, the only DVDs made were the Australian ones I've been working from (region 4) and the French ones (region 2) which seem harder to come by - idk whether the video would be better on the French.
    Quote Quote  
  7. So I got a french DVD, and while it's different...It's certainly not better - it might in fact be worse (the borders certainly are). I'll put it through QTGMC + srestore and compare it to the AU DVD and see if it's any better in terms of blends.

    Here are samples from similar scenes, let me know what you think...
    https://drive.google.com/file/d/1j-YO8eRGOl0qLNfBLJhpRq2obkj57xPe/view?usp=sharing
    https://drive.google.com/file/d/1jFUb4uJ5Ko4CGkZ3NTSB4MaJLuT-IIsW/view?usp=sharing
    Quote Quote  
  8. I was able to get this smoother motion from the youtube video. I used DoubleFPS2() but some of the other frame rate converters might deliver less distortions in the interpolated frames.
    Image Attached Files
    Quote Quote  
  9. The french clips don't have the chroma blending problems of the clips in the first post. They still some interlace luma ghosting after QTGMC().SRestore() though.
    Quote Quote  
  10. Originally Posted by jagabo View Post
    The french clips don't have the chroma blending problems of the clips in the first post. They still some interlace luma ghosting after QTGMC().SRestore() though.
    That's good to hear at least. I'm torn now on what the 'best' way to watch this show is...

    After doing some comparisons the French DVD looks way better than the AU one. And srestore seems to have a better time picking up scene change blends (or there's a lot less blends). So I'll definitely be using it over the AU disc.
    Last edited by nacho; 11th Jul 2020 at 00:24.
    Quote Quote  
  11. I have a question regarding color: my first script uses dgindex as a source and just does qtgmc+sres and produces a frame like this:
    Image
    [Attachment 54112 - Click to enlarge]


    I tried a lossless encode with both x264 and ffv1 (ffmpeg) and when I use ffms2 as a source filter for further processing, the red color changes:
    Image
    [Attachment 54113 - Click to enlarge]


    What's happening? It doesn't look lighter/oranger like that when just playing the file in mpc-hc.

    If I add: --transfer bt470bg --colormatrix bt470bg --colorprim bt470bg
    to my x264 lossless encode it displays like the first image when I use ffms2 source. I'm not sure how to get the colors to be correct without re-encoding with those flags though.

    With the ffv1 or untagged input if I do: core.resize.Bicubic(src, matrix_in_s="470bg", transfer_in_s="470bg", primaries_in_s="470bg", matrix_s="709")
    It seems to fix it, why does the matrix need to be converted to 709 - is it because that's what my monitor/modern displays use?
    Last edited by nacho; 12th Jul 2020 at 01:54.
    Quote Quote  
  12. It sounds to me like your player is displaying the video as rec.709 when it's not flagged. Just flag it as rec.601 every time you encode.
    Quote Quote  
  13. Yep thanks. I think I've accepted I'll have to live with the luma ghosting/outlines. Here's some of the other cleanup I've done (after qtgmc+srestore)
    https://slow.pics/c/p1nUb4Gx

    What do you think? In 1-4 I've showed 2 good frames, and 2 frames that have that ghosting. The artifacts are actually lessened a bit by MCTemporalDenoise.
    I can see in some scenes like the 5th screenshot there's detail that's been blurred away. But I'm fairly happy with it in other places. Is there anything you think I could do better?

    Deblock_QED is for some frames which pretty much look like a grid

    My VS script:
    Code:
    ###Cleanup###
    deblock = haf.Deblock_QED(clp=src, quant1=35)
    denoise = haf.MCTemporalDenoise(i=deblock, settings="very low", useTTmpSm=True, chroma=True, edgeclean=True, stabilize=True)
    warp = core.warp.AWarpSharp2(clip=denoise, depth=12, blur=1, thresh=56)
    
    ###Borders###
    crop = core.std.Crop(warp, left=10, right=8, top=2, bottom=2)
    border = asf.FixBrightnessProtect2(crop, column=[1,701], adj_column=[12,12])
    fill = asf.FillBorders(border, left=1)
    Quote Quote  
  14. MCTD isn't doing very much. I don't know if it's worth using.

    I've been playing around with one of the clips and found TNLMeans(ax=1, ay=3, az=0, h=20) almost completely removes the ghosting artifacts.

    After QTGMC().SRestore():
    Image
    [Attachment 54135 - Click to enlarge]


    Plus TNLMeans(ax=1, ay=3, az=0, h=20):
    Image
    [Attachment 54136 - Click to enlarge]


    The ghosting is almost completely gone but some other parts of the picture are blurred. It would be great if one could come up with a mask that lets you apply that result to only parts of the frame that have the ghosting. I've been playing with that but so far a solution has eluded me...
    Quote Quote  
  15. The artifacts are edges/lines from either the previous or next frame. Logically, then, it would be good to find edges in the previous/next frames and see if there's a line/edge in an identical place in the current frame, and use that edge as a mask. I have zero experience with masking, and idk if anything like that is possible. What do you think?
    Quote Quote  
  16. There's similar artifacts here: https://forum.doom9.org/showthread.php?t=164009

    But nothing ever really came of the discussion in regards to fixing them.
    Quote Quote  
  17. Member
    Join Date
    May 2020
    Location
    Australia
    Search Comp PM
    I dont know anything about anime videos.
    Do you want it to playback on tv or pc?
    If its tv dont deinterlace and if its pc, players like VLC can deinterlace on playback, or deinterlace for Progressive playback but it will never be better.
    Quote Quote  



Similar Threads