VideoHelp Forum


Try StreamFab All-in-One and rip streaming 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 43
Thread
  1. Hi everyone,

    First off, I want to explain how I got to this point. Maybe it can help other people to make their journey easier. You can skip it by reading after the line.


    I wanted to learn avisynth because I am a fan of classic (and new) cartoons. Got my Digimon DVD's and found out the quality wasn't that great. Asked on the forum what to call the problem I was seeing, and Sharc was nice enough to explain it to me. It can be found here:

    First Topic

    After that, it was a rollercoaster ride of emotions. Saw a few topics about advanced settings and it was pretty scary. Had no idea where to start. I found a video tutorial online that showed me the basics a bit:

    How to Use Avisynth Youtube Video

    This especially helped me with what programs I needed.

    Looked online for filters and plugins that helped with dot crawl and rainbowing. Honestly, it looked like a foreign language to me. Started by reading the avisynth website and learning the commands a bit. Also tried copying examples and using trial and error to get a grip on what it all meant. With the help of this great community, I started to understand it better.

    My first plugin was yadifmod2 to de-interlace and CheckMate as a dot crawl remover. Copying the examples on the avisynth website worked like a charm. The difference was insane. Then I wanted to de-rainbow. No matter what I did, it wouldn't work. I kept getting error after error. A few kindhearted members made me realize that my scripts weren't saving properly from the website. Copied the scripts and put them in a .txt file, afterwards renaming them to .avsi, with the appropriate name. You guessed it, it worked like a charm.

    Jagabo mentioned it would be better to use LSMASH, so I tried that, but I got errors if I added audio. Jagabo was so kind to explain it, and it worked! I was incredibly happy.

    Jagabo also taught me that .avsi and plugins that are in the correct folder load automatically. Only avs need to be loaded manually. That was a great help.

    -----------------------------------------------------------------------------------------------------------------------

    So, I know some basic avisynth. When I look around the forum, I see a lot of settings that boggle my mind. I have no idea what many commands mean. I would love to learn what everything means properly, instead of copy and pasting the settings.


    Achieved - How do you trim the black borders on a video?

    Achieved - Should I de-interlace before using other filters or is it better to do it last?

    - Any tips and tricks are very welcome


    If someone is willing to teach me, I would greatly appreciate it. Thank you ❤️
    Last edited by LighthouseonaCliff; 10th May 2021 at 20:04.
    Quote Quote  
  2. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    These common functions are built in, internal to Avisynth. Others are plugins/scripts you have to download.
    For example, to trim the border you use crop. Here's the internal filters.

    http://avisynth.nl/index.php/Category:Internal_filters

    Some filters are progressive only, while others have a switch, so you would call them with "interlace=true" (or similar).
    You have to read the doc on the particular filter
    Last edited by davexnet; 8th May 2021 at 16:59. Reason: type
    Quote Quote  
  3. Thank you, davexnet.

    I'm testing it right now. Will let you know if it works.


    Edit: I used this:

    Crop

    This code made the black border disappear:

    Code:
    Crop(10, 0, -10, -0) #left, top, right, bottom
    Awesome!

    Thank you so much!
    Last edited by LighthouseonaCliff; 8th May 2021 at 17:02.
    Quote Quote  
  4. Even with filters that have an interlced switch, they often work better with progressive video. So deinterlacing first is often better.

    And if you want really good deinterlacing use QTGMC(). It's slow, and one of the hardest filters to get set up because of all the other filters it uses. But it's worth the effort.
    Quote Quote  
  5. Yes, it seems to have a lot of requirements I'll try it out, thank you
    Quote Quote  
  6. Kawaiiii
    Join Date
    May 2021
    Location
    Italy
    Search Comp PM
    QTGMC is with no doubt very great and powerful (as it is slow, too).

    Anyway.. on telecined material I often got better, sharper, more refined (but not faster ;_; ) result using TIVTC/TMF and a lot of custom stuff applied .. but it really depends on the source material... and there's a TON of customization to do to the scripts to obtain fine results.
    Quote Quote  
  7. @ the OP: And don't just throw deinterlacers at your sources unless you are certain that the video is really interlaced.
    So unless you know it already, familiarize yourself how to analyze the frame structure using avisynth, using separatefields and stepping through the fields of a scene with motion or panning, for example.

    Also, AvsPmod is very handy to test and preview your scripts.
    Last edited by Sharc; 9th May 2021 at 05:50.
    Quote Quote  
  8. Originally Posted by jagabo View Post
    Even with filters that have an interlced switch, they often work better with progressive video. So deinterlacing first is often better.

    And if you want really good deinterlacing use QTGMC(). It's slow, and one of the hardest filters to get set up because of all the other filters it uses. But it's worth the effort.
    Apologies for the late reply. It's been a busy day

    I got QTGMC working. The amount of settings is insane It's going to be a project to learn all settings and what it all does. Looking forward to learning everything

    It's a real shame QTGMC is so much slower

    Originally Posted by Sharc View Post
    @ the OP: And don't just throw deinterlacers at your sources unless you are certain that the video is really interlaced.
    So unless you know it already, familiarize yourself how to analyze the frame structure using avisynth, using separatefields and stepping through the fields of a scene with motion or panning, for example.

    Also, AvsPmod is very handy to test and preview your scripts.
    I first use MediaInfo to see if the video is interlaced or progressive. I've read this can sometimes be false and to rely on your eyes to really know. What I do is looking at fast movements in a video and pausing and going through the frames one at a time. It's often immediately obvious.

    An example:

    Image
    [Attachment 58787 - Click to enlarge]


    Hope I'm doing it correctly?

    ------------------------------------------------------------------------------------------------------

    In the past days, I've learned to use 32bit avisynth instead of 64bit. I've ran into a few plugins that weren't supported in 64bit, notably the DeRainbow requirements.


    This website has helped me to figure out what encoder level to use:

    Advanced Video Coding - Levels

    Maybe someone will find it useful.


    The filters in VirtualDub2 have also been helpful. My Digimon remuxes from the DVD's weren't the correct aspect ratio after encoding. The resize option solved this problem. Do also like the smoother option, but that's personal preference.


    Thank you to everyone who has shared their wisdom. It's truly greatly appreciated.
    Quote Quote  
  9. Kawaiiii
    Join Date
    May 2021
    Location
    Italy
    Search Comp PM
    Originally Posted by LighthouseonaCliff View Post
    I first use MediaInfo to see if the video is interlaced or progressive. I've read this can sometimes be false and to rely on your eyes to really know. What I do is looking at fast movements in a video and pausing and going through the frames one at a time. It's often immediately obvious.
    Animes are usually telecined.. (see if you got a pattern like this in the original video: 3 full fields followed by 2 interlaced fields).
    If that's the case.. the first thing to do is inverse-telecine them, then decimate them.. and finally remove residual combing artifacts..
    Last edited by krykmoon; 10th May 2021 at 08:10.
    Quote Quote  
  10. Yes, that video is almost certainly telecined film. You should use TFM() and TDecimate(). Also, you resized the video vertically, screwing up the two fields. You need to IVTC/deinterlace before a vertical resize.
    Quote Quote  
  11. I first use MediaInfo to see if the video is interlaced or progressive. I've read this can sometimes be false and to rely on your eyes to really know. What I do is looking at fast movements in a video and pausing and going through the frames one at a time. It's often immediately obvious.

    An example:

    Image
    [Attachment 58787 - Click to enlarge]


    Hope I'm doing it correctly?
    As others have mentioned, interlaced video and telecined films are not the same and have to be processed differently.
    My preferred analysis method is inspecting the fields by stepping through the fields of a scene with motion.

    Code:
    assumeTFF()
    separatefields()
    Now step through the sequence of the pictures (=fields). If you see a sequence like
    (1) a a b b c c d d e e f f .... the video is progressive and should not be deinterlaced (even though some tools may report it as interlaced, e.g. for PAL DVD movies).
    (2) a b c d e f ... with smooth motion progress between the pictures the video is interlaced with Top Field first; if the picture sequence is jumping backward/formward the field order is Bottom Field first.
    (3) a a a b b c c c d d e e e f f ..... the video is 2:3 (aka 3:2) telecined film which is standard practice for 24 -> 30fps film to NTSC conversion. It should be inverse telecined (IVTC) rather than deinterlaced.

    Anime are sometimes a bit more tricky to assess.

    Telecined footage uses interlacing technology and contains combed frames but it is fundamentally different from interlaced video. You can find more about it here:
    https://en.wikipedia.org/wiki/Telecine
    https://www.animemusicvideos.org/guides/avtech31/theory-videointerlace.html

    For Avisynth filters you may also find this tutorial useful:
    https://www.animemusicvideos.org/guides/avtech31/post-qual.html
    Last edited by Sharc; 10th May 2021 at 03:12.
    Quote Quote  
  12. Originally Posted by krykmoon View Post
    Animes are usually telecined.. (see if you got a pattern like this in the original video: 3 full fields followed by 2 interlaced fields).
    If that's the case.. the first thing to do is inverse-telecine them, then decimate them.. and finally remove residual combing artifacts..
    Thank you. I will research this tonight

    Originally Posted by jagabo View Post
    Yes, that video is almost certainly telecined film. You should use TFM() and TDecimate(). Also, you resized the video vertically, screwing up the two fields. You need to IVTC/deinterlace before a vertical resize.
    That's good to know, thank you

    Originally Posted by Sharc View Post
    As others have mentioned, interlaced video and telecined films are not the same and have to be processed differently.
    My preferred analysis method is inspecting the fields by stepping through the fields of a scene with motion.

    Code:
    assumeTFF()
    separatefields()
    Now step through the sequence of the pictures (=fields). If you see a sequence like
    (1) a a b b c c d d e e f f .... the video is progressive and should not be deinterlaced (even though some tools may report it as interlaced, e.g. for PAL DVD movies).
    (2) a b c d e f ... with smooth motion progress between the pictures the video is interlaced with Top Field first; if the picture sequence is jumping backward/formward the field order is Bottom Field first.
    (3) a a a b b c c c d d e e e f f ..... the video is 2:3 (aka 3:2) telecined film which is standard practice for 24 -> 30fps film to NTSC conversion. It should be inverse telecined (IVTC) rather than deinterlaced.

    Anime are sometimes a bit more tricky to assess.

    Telecined footage uses interlacing technology and contains combed frames but it is fundamentally different from interlaced video. You can find more about it here:
    https://en.wikipedia.org/wiki/Telecine
    https://www.animemusicvideos.org/guides/avtech31/theory-videointerlace.html

    For Avisynth filters you may also find this tutorial useful:
    https://www.animemusicvideos.org/guides/avtech31/post-qual.html
    Thank you very much for explaining this to me. To be honest, I didn't really understand what telecine was. Will do some research on it tonight

    -------------------------------------------------------------------------------------------------------------------------------------------------------

    I've used the QTGMC filter for the first time yesterday. The difference compared to yadifmod2 is incredible:

    Here a basic test example:

    yadifmod2
    Image
    [Attachment 58801 - Click to enlarge]


    QTGMC
    Image
    [Attachment 58802 - Click to enlarge]


    Thank you, jagabo, for recommending it to me
    Quote Quote  
  13. Kawaiiii
    Join Date
    May 2021
    Location
    Italy
    Search Comp PM
    Originally Posted by LighthouseonaCliff View Post
    To be honest, I didn't really understand what telecine was.
    Telecine is a pure evil invention created only to make restoring a video to its pristine state an impossible task.
    Quote Quote  
  14. TFM().TDecimate() will look more like the QTGMC() output. And it will be much faster.

    A word of warning though -- anime/cartoons are often a mixture of underlying frame rates. They are basically drawn at 12p (sometimes 8p) with panning shots at 24p -- all on film as 24 fps (12p elements appear for two film frames, 8p elements for 3 film frames). The film is then telecined to 59.94 fields per second (store digitally as 29.97 interlaced frames per second). But they are often edited as telecined video with titles/effects added as 29.97p or 29.97i. And the title sequences (sometimes even parts of the main show) often have shots that were slowed down or sped up to match the music/action. So an inverse telecine to 23.97fp will often lead to jerky playback of those other elements.
    Quote Quote  
  15. Originally Posted by Sharc View Post
    As others have mentioned, interlaced video and telecined films are not the same and have to be processed differently.
    My preferred analysis method is inspecting the fields by stepping through the fields of a scene with motion.

    Code:
    assumeTFF()
    separatefields()
    Now step through the sequence of the pictures (=fields). If you see a sequence like
    (1) a a b b c c d d e e f f .... the video is progressive and should not be deinterlaced (even though some tools may report it as interlaced, e.g. for PAL DVD movies).
    (2) a b c d e f ... with smooth motion progress between the pictures the video is interlaced with Top Field first; if the picture sequence is jumping backward/formward the field order is Bottom Field first.
    (3) a a a b b c c c d d e e e f f ..... the video is 2:3 (aka 3:2) telecined film which is standard practice for 24 -> 30fps film to NTSC conversion. It should be inverse telecined (IVTC) rather than deinterlaced.
    I get abccdeff. 2 normal, then 2 the same and then 2 normal, and so on.

    If I understand correctly, this means it's (3) telecined. Am I correct?

    Originally Posted by jagabo View Post
    TFM().TDecimate() will look more like the QTGMC() output. And it will be much faster.

    A word of warning though -- anime/cartoons are often a mixture of underlying frame rates. They are basically drawn at 12p (sometimes 8p) with panning shots at 24p -- all on film as 24 fps (12p elements appear for two film frames, 8p elements for 3 film frames). The film is then telecined to 59.94 fields per second (store digitally as 29.97 interlaced frames per second). But they are often edited as telecined video with titles/effects added as 29.97p or 29.97i. And the title sequences (sometimes even parts of the main show) often have shots that were slowed down or sped up to match the music/action. So an inverse telecine to 23.97fp will often lead to jerky playback of those other elements.
    Wow! That's quite something. Thank you for sharing this with me. It's fascinating.
    Quote Quote  
  16. Originally Posted by LighthouseonaCliff View Post
    I get abccdeff. 2 normal, then 2 the same and then 2 normal, and so on.
    After SeparateFields? That's highly unusual. What is the frame rate of that video file?
    Quote Quote  
  17. Originally Posted by jagabo View Post
    Originally Posted by LighthouseonaCliff View Post
    I get abccdeff. 2 normal, then 2 the same and then 2 normal, and so on.
    After SeparateFields? That's highly unusual. What is the frame rate of that video file?
    29.97fps.

    I checked again. Think something went wrong the first time. I now get aaabbcccddeeeffggg.

    Originally Posted by jagabo View Post
    TFM().TDecimate() will look more like the QTGMC() output.
    I read about TFM().TDecimate(). It's incredibly daunting and complex. Should I use something like this to start with?:

    Code:
    TDecimate(Mode=2, rate=23.976)
    Thank you.
    Quote Quote  
  18. Originally Posted by LighthouseonaCliff View Post
    I get abccdeff. 2 normal, then 2 the same and then 2 normal, and so on.
    Is this from an anime source or from an old silent movie? If you upload a few seconds sample someone may have a look.

    Edit: Never mind, I just found your rectification. Yes, this is telecined film.
    Quote Quote  
  19. Apologies. The clip had no audio.
    Last edited by LighthouseonaCliff; 10th May 2021 at 18:23.
    Quote Quote  
  20. Originally Posted by LighthouseonaCliff View Post
    I checked again. Think something went wrong the first time. I now get aaabbcccddeeeffggg.
    Yes, that's simple telecined film.

    Originally Posted by LighthouseonaCliff View Post
    I read about TFM().TDecimate(). It's incredibly daunting and complex. Should I use something like this to start with?:

    Code:
    TDecimate(Mode=2, rate=23.976)
    .
    It's quite simple in this case:

    Code:
    TFM()
    TDecimate()
    If you look at the output after just TFM() you'll find a frame pattern like: abcdd efghh. Four film frames have become five video frames (24p to 30p) by duplicating one of them. The default for TDecimate() is to remove one duplicate out of every 5 frames -- exactly what you want here.
    Quote Quote  
  21. Originally Posted by jagabo View Post
    It's quite simple in this case:

    Code:
    TFM()
    TDecimate()
    If you look at the output after just TFM() you'll find a frame pattern like: abcdd efghh. Four film frames have become five video frames (24p to 30p) by duplicating one of them. The default for TDecimate() is to remove one duplicate out of every 5 frames -- exactly what you want here.
    Thank you. I'll try that.

    I finally figured out how to cut a clip, haha
    Image Attached Files
    Quote Quote  
  22. Originally Posted by LighthouseonaCliff View Post
    I finally figured out how to cut a clip, haha
    For your next sample, if it's also from a DVD, learn how to cut it using DGIndex.
    Quote Quote  
  23. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    I took a look at it, used Avidemux to re-wrap it to program stream Mpeg so I can use DGindex.

    There is still some minor combing visible after tfm().tdecimate(), eg. frame 101

    Overall the video quality seems poor, fuzzy and soft
    Quote Quote  
  24. Originally Posted by davexnet View Post
    I took a look at it, used Avidemux to re-wrap it to program stream Mpeg so I can use DGindex.

    There is still some minor combing visible after tfm().tdecimate(), eg. frame 101

    Overall the video quality seems poor, fuzzy and soft
    Thank you for taking a look. Yeah, the quality leaves much to be desired

    Originally Posted by jagabo View Post
    It's quite simple in this case:

    Code:
    TFM()
    TDecimate()
    If you look at the output after just TFM() you'll find a frame pattern like: abcdd efghh. Four film frames have become five video frames (24p to 30p) by duplicating one of them. The default for TDecimate() is to remove one duplicate out of every 5 frames -- exactly what you want here.
    I tried it, and the result is quite good. QTGMC stutters quite a bit when panning, while using your method makes it a lot smoother. QTGMC makes the lines look slightly better, but that's nitpicking and can hardly be seen at a normal viewing distance.

    It took only 6 1/2 minutes, while QTGMC took 32 minutes

    Thank you!
    Quote Quote  
  25. That sample is not all 24p with pulldown. At least some shots have been slowed down. A simple IVTC will leave you with duplicate frames. After trimming the first 11 black frames (there's no way to tell which are dups) examining the video with DeDup() shows 281 unique frames out of 373. That puts the overall frame rate about 22.578 fps. The body of the video is most likely to be 23.976 fps. Assuming so, there are a few ways you can deal with this. You could just IVTC to 23.976 fps and live with a slightly jerky intro. You could QTGMC() (or other 2x deinterlace) to 59.94 fps. The result will look the same as watching the original DVD on a 59.94 fps TV. Or you could use variable frame rate encoding (pretty much a PITA).
    Quote Quote  
  26. It doesn't have to be perfect. The dot crawl and rainbowing did bother me a lot. I'm glad that is almost completely gone.

    Checkmate seems to be the best of the dot crawl filters. I tested the following:

    DeCrawl: Almost no difference at default settings. Upping the setting makes the video look bad.
    DeDot: Almost no difference at default settings. Upping the settings doesn't do that much.

    Checkmate removes almost all the dot crawl except for the really bad ones. Upping the settings makes the video look blended. Read that checkmate is not good with fast moving scenes, but it looks quite good compared to the others I've tried.

    I did try:

    Code:
    a = LWlibavAudioSource("H:\Avisynth\Digimon Digital Monsters S01E01.mkv")
    v = LWlibavVideoSource("H:\Avisynth\Digimon Digital Monsters S01E01.mkv")
    AudioDub(v,a)
    ConverttoYv12()
    TFM()
    TDecimate(Mode=2, rate=23.976)
    QTGMC( Preset="Slow", TR2=2 )
    Crop(10, 0, -10, -0) #Left, top, right, bottom.
    Checkmate(thr=25, max=25, tthr2=10)
    ChubbyRain2(th=2, radius=2, show=false, sft=2, interlaced=false)
    Hope I haven't made any obvious mistakes

    The result looks good, but it took an hour. The previous settings took 6 1/2 minutes. Side-by-side, I see little difference.
    Quote Quote  
  27. Kawaiiii
    Join Date
    May 2021
    Location
    Italy
    Search Comp PM
    There's also DotKill

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

    It's painfully slow (on my poor pc) .. but you can try this too.

    Anyway.. since the source it's pure telecined NTSC material I think tdecimate with mode 1 is exactly the same, it will perfectly inverse telecine and keep the standard framerate (without the need to set the rate parameter)..

    Mode 2 is useful if you want to achieve an arbitrary frame rate.. different from the standard (for telecined material).. but if you only want to return to the original frame rate.. mode 1 (the one I always use on these kind of sources) does the job fine.
    Quote Quote  
  28. Originally Posted by krykmoon View Post
    There's also DotKill

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

    It's painfully slow (on my poor pc) .. but you can try this too.
    Thank you very much for the recommendation. The results are similar to checkmate with this video. It is indeed quite slow

    Originally Posted by krykmoon View Post
    Anyway.. since the source it's pure telecined NTSC material I think tdecimate with mode 1 is exactly the same, it will perfectly inverse telecine and keep the standard framerate (without the need to set the rate parameter)..

    Mode 2 is useful if you want to achieve an arbitrary frame rate.. different from the standard (for telecined material).. but if you only want to return to the original frame rate.. mode 1 (the one I always use on these kind of sources) does the job fine.
    Mode 1 indeed gives a very similar result. Thank you
    Quote Quote  
  29. Kawaiiii
    Join Date
    May 2021
    Location
    Italy
    Search Comp PM
    I really like your enthusiasm .. and exchanging infos and opinions is funny and useful since we always learn new things ..
    Quote Quote  
  30. Originally Posted by LighthouseonaCliff View Post
    I did try:

    Code:
    a = LWlibavAudioSource("H:\Avisynth\Digimon Digital Monsters S01E01.mkv")
    v = LWlibavVideoSource("H:\Avisynth\Digimon Digital Monsters S01E01.mkv")
    AudioDub(v,a)
    ConverttoYv12()
    TFM()
    TDecimate(Mode=2, rate=23.976)
    QTGMC( Preset="Slow", TR2=2 )
    Crop(10, 0, -10, -0) #Left, top, right, bottom.
    Checkmate(thr=25, max=25, tthr2=10)
    ChubbyRain2(th=2, radius=2, show=false, sft=2, interlaced=false)
    Hope I haven't made any obvious mistakes
    A few things...

    ConvertToYV12() should be ConvertToYV12(interlaced=true) -- since the video is interlaced at this point. Without the interlaced argument it will blend the chroma of the two fields together. Fortunately, video is already YV12 so the filter isn't doing anything here.

    Checkmate() works best while the video is still interlaced. So it should be used before TFM().

    The Checkmate() settings are too high. It is causing ghosting of previous/next frames. Weaker settings will reduce that ghosting.

    There's no point in doubling the frame rate with QTGMC() after decimation. If you want to use it for its other cleanup properties use InputType=2, or FPSDivisor=2, or SelectEven() after.

    I modified the script to:

    Code:
    a = LWlibavAudioSource("H:\Avisynth\Digimon Digital Monsters S01E01.mkv")
    v = LWlibavVideoSource("H:\Avisynth\Digimon Digital Monsters S01E01.mkv")
    AudioDub(v,a)
    
    CheckMate(thr=10, max=20, tthr2=0) # tthr2 up to 10 might be ok, might produce more ghosting
    TFM()
    Santiag(strh=2, strv=2) # reduce the residual dot crawl
    TDecimate(mode=2, rate=23.96)
    #QTGMC( Preset="Slow", TR2=2 ).SelectEven()
    aWarpSharp2(depth=5) # resharpen after Santiag()
    Crop(10, 0, -10, -0) #Left, top, right, bottom.
    #ChubbyRain2(th=2, radius=2, show=false, sft=2, interlaced=false)
    Santiag() reduces some more of the residual dot crawl. QTGMC() helps with some problems (aliased lines, minor noise reduction), but messes up others (ghosting, blurring of small details). I decided not to use it. You might decide to keep it in since the things it fixes are more visible than most of the problems it causes. I didn't notice ChubbyRain2() helping much, and it caused some ghosting and chroma blending, so I removed it. Santiag() blurs some edges -- aWarpSharp2() was used to restore the sharpness.
    Image Attached Files
    Quote Quote  



Similar Threads