VideoHelp Forum


Try DVDFab Video Downloader and rip Netflix video! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 57
Thread
  1. So I have been doing encodes of power rangers lately and this happens out of nowhere. Usually I use TFM() to deinterlace my 29.97 NTSC power Rangers episodes. But in this case, I didnt do it right. So there is some kind of jittering in those power plants where the rangers' standing. Is there anyway to remove those jitters? Is TIVTC the best for 3:2 Pulldown? Here's the script i use and the source file. Jitter power plant.demuxed.m2v

    TFM()
    TDecimate()
    Vinverse()
    Crop(0, 0,-2, 0)
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.6\plugins\dfttest.dll")
    dfttest(sigma=9, tbsize=3)
    LanczosResize(640,480)
    Quote Quote  
  2. Start by using TFM(pp=0). TFM's post processor sees those thin horizontal elements as comb artifacts and deinterlaces them. pp=0 turns off the post processor. But you may find that some real comb artifacts are occasionally let through.
    Quote Quote  
  3. Can i use QTGMC Preset slow? Whats the difference between QTGMC and TIVTC? also whats the difference between Selectodd and selecteven and which one should i use in this clip?
    Quote Quote  
  4. TFM reconstructs the original film frames by matching adjacent fields. Sometimes the original film frame can't be reconstructed because a field is orphaned (there is no matching field to reconstruct the original film frame), or maybe heavy compression artifacts make it difficult to tell which field completes the frame. So after field matching, TFM's post processor examines the resulting frames for comb artifacts. If it finds them it deinterlaces the frame (with a method similar to Yadif). As I mentioned earlier, sometimes there is a successful field match but some of the picture content looks like comb artifacts. That causes TFM's deinterlacer to kick in, deinterlacing a frame that doesdn't need it. You can play around with TFM's comb detector threshold settings to reduce the number false positives. You can also provide an alternate clip for TFM to use when it decides deinterlacing is needed. Or you can disable the post processor entirely.

    With this particular clip a manual IVTC gives the best result:

    Code:
    SeparateFields().SelectEvery(10, 0,1,2,3,5,6,8,9).Weave()
    But that will probably not work for the entire video as the telecine pattern changes at different shots.

    QTGMC is a more pure deinterlacer though it does perform some field matching as part of its algorithm. With telecined film it's usually less accurate than field matching. It will also generate moire artifacts on those areas where there are alternating thin horizontal lines.

    Sometimes you just have to apply different processing to different parts of a video.
    Quote Quote  
  5. So, I did use TFM(pp=0). It looks really good. But after that i see some interlaced frame in the video. The entire episode is 21min long so I trim it only just to the scene with those electrical plants. Heres two min video with TFM(pp=0)TFM (pp=0).mkv but only that scene [which i have uploaded before] has some problem.
    Image
    [Attachment 56261 - Click to enlarge]
    interlaced around red ranger leg.

    Somehow QTGMC preset slow one did great particularly on that one frame but overall is meh.QTGMC slow SourceMatch=2, Sharpness=0.4, TR2=3.mkv

    Oh my this is really confusing. I Don't wanna lose quality but it somehow loses whatever i do. Here's the actual episode https://mega.nz/file/leo3VIYL#qpQvYC2BDeQwb1rG75ARPCmF16Fd52HLlrG2gPxnWMk overall episode isn't that bad compared to the old ones i had done[ghosting 2 years ago]. Its just those jitters but at the same time i dun want to turn off post processor for entire episode.
    Last edited by Smart Jason; 15th Dec 2020 at 16:07.
    Quote Quote  
  6. pp=5 blurs more than the default de-interlacing, but it doesn't make such a mess of the power thingies, and you could make up for it with some sharpening.
    I think the power thingies are also causing a couple of incorrect matches, so I'd block them from being part of the field matching decision if necessary (TFM isn't using the first 280 scan-lines for field matching the second Trim range below). That's probably what's happening for your screenshot, so maybe try something like y0=0, y1=280 with pp=0 too.

    Or try this with your sample in the opening post. Make sure the Trims are always multiples of 5 frames.

    Code:
    Trim(0,59).TFM().TDecimate().dfttest(sigma=9, tbsize=3) ++ \
    Trim(60,0).TFM(y0=0, y1=280, pp=5).TDecimate().dfttest(sigma=9, tbsize=3).LSFMod()
    
    LanczosResize(640,480)
    or with QTGMC denoising.

    Code:
    Trim(0,59).TFM().TDecimate().QTGMC(InputType=1, EzDenoise=1) ++ \
    Trim(60,0).TFM(y0=0, y1=280, pp=5).TDecimate().QTGMC(InputType=1, EzDenoise=1).LSFMod()
    
    LanczosResize(640,480)
    Image Attached Files
    Last edited by hello_hello; 15th Dec 2020 at 17:28.
    Quote Quote  
  7. You can use a manual IVTC just for that short section:

    Code:
    Mpeg2Source("PR_INSPACE_S6D1_VTS_05_1_1.d2v", CPU2="ooooxx", Info=3) 
    manual = SeparateFields().SelectEvery(10, 0,1,2,3,5,6,8,9).Weave()
    TFM().TDecimate()
    ReplaceFramesSimple(last, manual, Mappings="[27496 27675]")
    In that script the bulk of the video uses TFM().TDecimate() but only frames 27496 through 27675 (frame numbers after decimation) use the manual IVTC. ReplaceFramesSimple() is part of the RemapFrames package.

    I didn't look at the the rest of the video. But you can use the same ReplaceFramesSimple() along with other filtering on any other portions of the video that don't work well with TFM().TDecimate().
    Last edited by jagabo; 15th Dec 2020 at 17:59.
    Quote Quote  
  8. I took a closer look at other parts of the full episode. It's a mix of 24p with pulldown and 30p. For the most part, indoor shots are 30p, outdoor (and outerspace) shots are 24p with pulldown.
    Quote Quote  
  9. which sharpener is good for that kind of video source?
    Quote Quote  
  10. I generally use one of these for any type of source (LSFMod for my sample encode). Whichever looks best.
    Personally I don't like video that "looks" sharpened, so while I generally use LSFMod for standard definition, which is fairly subtle sharpening, I'll often still reduce the effect. The default strength is 100.

    LSFMod(Strength=50)

    And sharpened noise looks terrible, so I wouldn't sharpen a noisy source.

    LSFmod

    CDMod can sometimes be better for HD.
    CSmod

    For light denoising with sharpening:
    MCDegrainSharp
    Last edited by hello_hello; 16th Dec 2020 at 05:44.
    Quote Quote  
  11. Originally Posted by jagabo View Post

    In that script the bulk of the video uses TFM().TDecimate() but only frames 27496 through 27675 (frame numbers after decimation) use the manual IVTC. ReplaceFramesSimple() is part of the RemapFrames package.
    This is just for a scene. How do i apply this manual IVTC to multiple scene wherever i want on episode? I have never used RemapFrames before
    Quote Quote  
  12. Remap frames replaces frames of one video with those taken from another. If you want multiple sections take from the same second clip you just add them to the list. If you need different processing for some other section you can define a new clip with the necessary processing then use ReplaceFramesSimple replace the corresponding frames in the main clip.

    For example, if you had a two other sections that required a different manual IVTC:

    Code:
    Mpeg2Source("PR_INSPACE_S6D1_VTS_05_1_1.d2v", CPU2="ooooxx", Info=3) 
    
    m1 = SeparateFields().SelectEvery(10, 0,1,2,3,5,6,8,9).Weave()
    m2 = SeparateFields().SelectEvery(10, 0,1,3,4,6,7,8,9).Weave()
    TFM().TDecimate()
    
    ReplaceFramesSimple(last, m1, Mappings="[27496 27675]")
    ReplaceFramesSimple(last, m2, Mappings="[12345 14344] [16000 16234]")
    That script gets the source video as the implied "last". It builds 3 modified clips from last, m1 and m2 are manual IVTCs with different patterns, TFM is the automated IVTC (a new "last"). It then replaces frames of "last" with frames take from m1 and m2.
    Quote Quote  
  13. poisondeathray posted a function for manual IVTC at doom9 the other day. I added some defaults, but this is it.
    Changing the number changes the IVTC pattern. I've only played with it for 30 seconds, but it seems to work as expected.

    (Edited both functions to fix my stupid with regard to the frame rate)

    ManualIVTC(1)

    Code:
    function ManualIVTC(clip SourceVideo, int "P", bool "FRate")     {
    
    P = default(P, 1)
    FRate = default(FRate, true)
    
    SourceVideo
    Loop(P, 0, 0)
    SeparateFields()
    SelectEvery(10, 0,1, 2,3, 5,6, 8,9)
    Weave()
    Trim(int(P*3.0/5.0), 0)
    
    return FRate ? Last.AssumeFPS(24000, 1001) : Last     }
    And this one comes from an old idea of Katie's.

    KIVTC() "should" work without having to adjust anything.

    Code:
    function KIVTC(clip SourceVideo, bool "FRate")     {
    
    FRate = default(FRate, true)
    
    SourceVideo
    SeparateFields()
    Interleave(SelectEven().TDecimate(mode=1), SelectOdd().TDecimate(mode=1))
    Weave()
    
    return FRate ? Last.AssumeFPS(24000, 1001) : Last      }
    So with the function(s) loaded, you could do something like this:

    Code:
    Mpeg2Source("PR_INSPACE_S6D1_VTS_05_1_1.d2v", CPU2="ooooxx", Info=3) 
    
    m1 = ManualIVTC(1) # change the number for the correct IVTC as required
    m2 = ManualIVTC(2) # change the number for the correct IVTC as required
    TFM().TDecimate()
    
    ReplaceFramesSimple(last, m1, Mappings="[27496 27675]")
    ReplaceFramesSimple(last, m2, Mappings="[12345 14344] [16000 16234]")
    Last edited by hello_hello; 16th Dec 2020 at 10:50.
    Quote Quote  
  14. These space frking rangers giving me more headache than oversharpening ghosts @_@.m2v A problem after problem [Man i wish these guys do a proper job on these DVDs since they are expensive] Again, this time its different episode in space. the video becomes choppy as hell when the red ranger pick up his saber floating in space.
    Quote Quote  
  15. That particular shot was resized vertically after being telecined. QTGMC().SRestore(frate=23.976) looks about right.
    Quote Quote  
  16. I don't know what avsplusversionnumber means srestore.avsi,line 66 appear when i use srestore
    Quote Quote  
  17. If I remember correctly you need a newer version of Zs_RF_Shared.avsi or AviSynth+.
    Quote Quote  
  18. which shoud done first crop or resize? For an episode having so many black bars in left and right , I still wanna keep it at 640x 480 but after that, i compared and found out that the pictures [the characters] become stretch and make them look like fat.
    Quote Quote  
  19. Resizing with black borders can generate noticeable oversharpening halos at the borders. So cropping first gives slightly better results. But it's usually easier to resize first because you know what the size should be. I sometimes resize, then crop, then note the final frame size. Then I go back to the original, crop, then resize to that final frame size.
    Quote Quote  
  20. Originally Posted by Smart Jason View Post
    which shoud done first crop or resize? For an episode having so many black bars in left and right , I still wanna keep it at 640x 480 but after that, i compared and found out that the pictures [the characters] become stretch and make them look like fat.
    Shameless plug:
    CropResize
    There's quite a few pictures demonstrating how to use it in the second post, but assuming you're working with a 4:3 DVD source:

    CropResize(640,480, 8,4,-10,-6, InDAR=4.0/3.0, Resizer="Spline36Resize", CPreview=1)

    The first two numbers are the resizing, and the next four are whatever cropping you specify. The script will never stretch when it resizes. Instead, it crops extra picture if necessary to prevent aspect error.
    The CPreview argument enables the cropping preview (the video isn't resized while the cropping preview is enabled). The yellow lines show the cropping you specified. Blue lines show any extra cropping the script is applying to prevent aspect error. When you're happy with the cropping, remove the CPreview argument and the script will crop and resize.

    If there's a substantial amount of black each side, use InDAR=15.0/11.0 instead of InDAR=4.0/3.0.
    Most 4:3 DVDs have a slightly wider display aspect ratio than 4:3, but cropping 8 pixels from each side gives you an exact 4:3 display aspect ratio. Try this and you'll see what I mean.

    CropResize(640,480, 8,0,-8,0, InDAR=15.0/11.0, Resizer="Spline36Resize", Info=true)

    The default resizer is Spline36, so you don't need to specify a resizer to use Spline36Resize, but you can use the resizer argument to specify your preferred resizing method.

    For the times you don't need exact output dimensions, you can specify just your desired width and cropping (use zero for the height), and the script will choose the appropriate height for you. ie

    CropResize(640,0, 8,4,-10,-6, InDAR=15.0/11.0)

    Or you can specify just the height and let the script choose the width.

    CropResize(0,540, 8,4,-10,-6, InDAR=15.0/11.0)

    Or you can tell the script it's not allowed to resize the height (only crop) and let it resize the width for you.

    CropResize(0,0, 8,4,-10,-6, InDAR=15.0/11.0, ResizeWO=true)
    Last edited by hello_hello; 18th Dec 2020 at 21:30.
    Quote Quote  
  21. Oh it helps me really well. Thank you everyone who have helped me till this day. By the way here is another jitter scene i got problem with Rangers falling jitter.demuxed.m2v Help this too.https://mega.nz/folder/ECpESKiB#e-3sUgVlDiQxkhMt3Yw8Ag Color Matrix problem. 1 and 3 looks same. 2 is off but tagged as BT.709. which one is true. Any ways to restore real BT.709 for no.2 file without re-encoding?
    Quote Quote  
  22. I had a quick look at the images and this gets number 2 close to the others. I just did it by site. I didn't get carried away with comparing histograms or anything like that.

    ImageSource("D:\BT.709 problem\2.png")
    ConvertToYV12(matrix="Rec709")
    ColorMatrix(mode="Rec.601->Rec.709", clamp=0)
    Levels(8, 1. 0, 255, 0, 250, coring=false)

    All you can do without re-encoding is change the colorimrtry info in the video stream to BT.601, but I think that'd cause the colors to be converted in the wrong direction on playback (it always confuses me) so you'll probably have to re-encode it.

    There's some sort of blending happening in the video sample but ignoring the blending, it IVTC's and plays smoothly for me.
    TFM()
    TDecimate()
    Quote Quote  
  23. Originally Posted by hello_hello View Post

    All you can do without re-encoding is change the colorimrtry info in the video stream to BT.601, but I think that'd cause the colors to be converted in the wrong direction on playback (it always confuses me) so you'll probably have to re-encode it.
    so no way without re-encoding. why does it state the file as BT.709? No.1 and 3 are the true BT709 right?

    Originally Posted by hello_hello View Post
    There's some sort of blending happening in the video sample but ignoring the blending, it IVTC's and plays smoothly for me.
    the blending is the problem i faced. TFM did really great for the whole episode but that single shot where the rangers falling cant be fixed. Maybe because they are shot in 30p? those choppy frames make me frustrated
    Quote Quote  
  24. My guess is that #1 and #3 are right, and #2 was just flagged incorrectly. But the only way to know for sure is if you know what colors are supposed to be. Maybe the suit is supposed to be more orange than red.

    Regarding the jittery motion in post #21, the original film was slowed to about 12 fps and converted back to 24 fps with frame blending. Then the white balls were added at 24 fps. About the best you'll get is something like:

    Code:
    Mpeg2Source("Rangers falling jitter.demuxed.d2v", CPU2="ooooxx", Info=3) 
    Yadif(mode=1) # or QTGMC
    SRestore(frate=23.976)
    Quote Quote  
  25. Originally Posted by Smart Jason View Post
    Originally Posted by hello_hello View Post

    All you can do without re-encoding is change the colorimrtry info in the video stream to BT.601, but I think that'd cause the colors to be converted in the wrong direction on playback (it always confuses me) so you'll probably have to re-encode it.
    so no way without re-encoding. why does it state the file as BT.709? No.1 and 3 are the true BT709 right?
    All the info in the video file does is tell a player which formula to use for converting the YUV video to RGB for display, and there's no gurantee a player willl pay attention to it. It's possible a player will just assume rec.709 for HD and rec.601 for SD.

    The same thing applies when converting RGB to YUV, in regard to the formula used. Try both of these with your images and you'll see the difference.

    ImageSource("D:\BT.709 problem\2.png")
    ConvertToYV12(matrix="Rec709")

    ImageSource("D:\BT.709 problem\2.png")
    ConvertToYV12(matrix="Rec601")

    As for the problem image, obviously something went wrong along the way and the wrong formula was used for a conversion from/to RGB, assuming it's the incorrect one. If you open the first image like this it'll look more orange, similar to the second one.

    ImageSource("D:\BT.709 problem1.png")
    ConvertToYV12(matrix="Rec601")

    You can try changing the colorimetry in the video stream using this version of ffmpeg for h264, but I'm not sure if it'll fix it or make it worse. https://forum.doom9.org/showthread.php?t=152419
    Or I think the regular ffmpeg can do the same thing now, and for h265 as well.

    "NTSC" and "PAL" are both rec.601, with slightly different color primaries (there's no rec.601 choice as such), but changing the colormatrix to PAL looks like this (5=bt470bg, 2=remove). Setting the colormatrix option is all that matters. Change the frame rate to the video frame rate, if necessary.
    Code:
    ffmpeg -i 1a.mkv -y -vcodec copy -an -sn -vbsf h264_changesps=colormatrix=5/colorprim=2/transfer=2/fps=24000:1001/sar=1:1 D:\1b.mkv
    and for NTSC it'd be this (6=smpte170m, 2=remove):
    Code:
    ffmpeg -i 1a.mkv -y -vcodec copy -an -sn -vbsf h264_changesps=colormatrix=6/colorprim=2/transfer=2/fps=24000:1001/sar=1:1 D:\1b.mkv
    For completeness, this is rec.709 (1=bt709):
    Code:
    ffmpeg -i 1a.mkv -y -vcodec copy -an -sn -vbsf h264_changesps=colormatrix=1/colorprim=1/transfer=1/fps=24000:1001/sar=1:1 D:\1b.mkv
    Originally Posted by Smart Jason View Post
    Originally Posted by hello_hello View Post
    There's some sort of blending happening in the video sample but ignoring the blending, it IVTC's and plays smoothly for me.
    the blending is the problem i faced. TFM did really great for the whole episode but that single shot where the rangers falling cant be fixed. Maybe because they are shot in 30p? those choppy frames make me frustrated
    I'll have another look later and report back if I come up with anything clever, unless someone beats me to it.
    (Edit: I see jagabo already has).
    Last edited by hello_hello; 21st Dec 2020 at 07:51.
    Quote Quote  
  26. Originally Posted by hello_hello View Post
    pp=5 blurs more than the default de-interlacing, but it doesn't make such a mess of the power thingies, and you could make up for it with some sharpening.
    Well, pp=5 works pretty good with all the Power Rangers seasons I have problem with horizontal jitters .What are the pros and cons of using the value 5 [Deault is 6 right]? Also Manual IVTC works like charm. Its hard for me decide which one to use in which kind of situation. Cuz for me, I personally have already watched all of the seasons. Why I do encoding? I just wanna keep them in my External HDD or can share with other people. I don't wanna store the actual DVD iso with all those interlaced and grainy footage. For manual IVTC to work, I have to rewatch every episode and write in notes which scene in which ep has problem. So my question for this is "Is it ok to use pp=5 or Can I use manual IVTC through whole episode?" compare to 24min show, the jitter scenes are very rare (almost 2min; also not in every episode). Can using manual IVTC harm the other scene?

    with my best regards jagabo and hello_hello.
    Quote Quote  
  27. Originally Posted by Smart Jason View Post
    Well, pp=5 works pretty good with all the Power Rangers seasons I have problem with horizontal jitters .What are the pros and cons of using the value 5 [Deault is 6 right]?
    PP=5 doesn't seem as sharp, but in my experience it can also cause less artefacts, at least for "problem" sources. I don't understand how the two methods actually work, but....

    PP=
    0 - nothing (don't even look for combed frames)
    1 - find/hint combed frames but don't deinterlace
    2 - dumb blend deinterlacing
    3 - dumb cubic interpolation deinterlacing
    4 - dumb modified-ela deinterlacing
    5 - motion-adaptive blend deinterlacing
    6 - motion-adaptive cubic interpolation deinterlacing
    7 - motion-adaptive modified-ela deinterlacing

    Originally Posted by Smart Jason View Post
    For manual IVTC to work, I have to rewatch every episode and write in notes which scene in which ep has problem. So my question for this is "Is it ok to use pp=5 or Can I use manual IVTC through whole episode?" compare to 24min show, the jitter scenes are very rare (almost 2min; also not in every episode). Can using manual IVTC harm the other scene?
    I can't really answer the question regarding using pp=5 all the time. It's up to you if you think pp=6 generally looks better.
    In the case of your sample, the power thingies are causing TFM to sometimes make a bad matching decision, and to sometimes think they're combed when they're not, and I couldn't find a combination of settings that prevented it from happening 100% of the time. TFM normally works very well, but occasionally you'll come across a "problem" video.

    ManualIVTC won't fix combing (if there's any to fix), and if the teleccine pattern changes it'll stop working, so whichever method you go with, you're still going to have to check the result.
    Last edited by hello_hello; 21st Dec 2020 at 15:32.
    Quote Quote  
  28. You can supply your own deinterlaced image, the clip2 variable, to TFM it will use pixels from that image to fill the areas where it sees combing.

    Code:
    TFM(clip2=QTGMC(FPSDivisor=2)
    or

    Code:
    TFM(clip2=nnedi3())
    Quote Quote  
  29. Originally Posted by jagabo View Post
    You can supply your own deinterlaced image, the clip2 variable, to TFM it will use pixels from that image to fill the areas where it sees combing.

    Code:
    TFM(clip2=QTGMC(FPSDivisor=2)
    or

    Code:
    TFM(clip2=nnedi3())
    Can you please explain me with a little bit more information ? So you mean I use that code line together with Manual IVTC or something like that?
    Quote Quote  
  30. Anywhere you are using TFM you can try adding the clip2 option.
    Quote Quote  



Similar Threads