Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st June 2008, 09:25   #1  |  Link
thetoof
Sleepy overworked fellow
 
Join Date: Feb 2008
Location: Maple syrup's homeland
Posts: 933
AnimeIVTC() - All-in-one solution for interlacing and blending - v2.00 [2010-01-07]

Guide and v2 here. http://www.sendspace.com/file/jb3c3k Requirements package prepared by Overdrive80 - http://www.mediafire.com/?nydyyqqyqhq.

This function can also work with any other hard telecined, hybrid or field-blended source.

The thread was originally created after encountering multiple interlacing and blending related issues that were documented here and there, or simply too rare to be documented, but never all in the same place. Its purpose was to gather as many samples as possible and to converge discussions about them to eventually create a function that could deal with all the issues in an optimal and easy to use fashion. Pretentious? Maybe. Useful? Yes imo.

It is not as versatile as doing everything externally, as the goal is to make the ivtc/deinterlacing/deblending/decimation process as simple as possible, while still aiming at the best possible quality. Filter choices and available parameters are therefore arbitrary, but feel free to object and mention what you think is missing or wrong.

So, have fun, filter and post!

I'll leave the following for now, but it's meant to be replaced by a guide I've been promising to write for many many months...
# Particularities of anime:
- While a film is shot at 24 frames per second (fps), anime is animated at 24fps so there is not necessarily motion on every frame.
- When there is not a lot of movement, it can be displayed at lower framerates like 8 or 12 fps with duplicate(s) of every frame to maintain a constant framerate of 24fps.
- To create the illusion of faster movement, different parts of the image can move at different framerates. In this situation, the image is divided into 2 parts and there are many possible combinations of "intra-frame variable framerate". This is not constant throughout the episode/movie since it changes depending on the amount of motion to be displayed.
- CG animation at 30 fps is sometimes used in anime, so you can also have sequences with movement on every frame without any interlacing nor blends.
- The credits can be truly interlaced to make them run faster without being juddery and unreadable, thus leaving more room for the show.
- The credits can also be at the full progressive framerate on top of the telecined background.

# Basic concepts:
Soft telecine - the stream is encoded at 24 fps and the pulldown is applied during playback.
Hard telecine - your source was telecined before being encoded on the DVD (or before airing).
Double hard telecine - your source has at least one of the "intra-frame variable framerate" situations and the telecining was applied separately on each part of the frame, so the pattern is not constant and many frames are interlaced.
Field blended norm-conversion - Instead of going back to 24fps (film rate), the video streams are directly converted from NTSC (29.97fps) to PAL (25fps) or vice versa, creating ugly fieldblending (looks like DHT when inspecting a frame).
Hybrid - mix of 24t (24 fps displayed at 30 through telecining) and 30p (progressive movement on every frame)
Truly interlaced - each frame contains half the information of two frames, which means that you can bob it to 60p and see movement on every single frame, without any interlacing or blending.
Progressive - No interlacing whatsoever at the full framerate.
3:2 pattern - This pattern repeats itself from the very beginning to the very end of your clip: 3 progressive frames followed by 2 interlaced ones.
VFR - Variable Frame Rate - The sections of the clip run at different framerates, thus allowing to have less frames for the same movement. The duplicates are removed and played during the same amount of time as if there was the original amount of frames.
Lossless rendering pass - Save the file as uncompressed YV12 or Lagarith to apply the script only once and make subsequent filtering/encoding faster. It takes a lot of disk space: around 5GB for a 22 minutes clip @ 23.976fps with Lagarith and 20GB with uncompressed YV12.

# Examples:
Double Hard Telecine - At first, your source may look like a typical Hard Telecined one, but after a more thorough inspection, you'll see that it's actually a DHT one: same source, different high motion scene.
Interlaced on top of telecined (can be hard or double hard) - In this case, it was a hard telecined source. Image
Obviously, since there's no pattern in DHT and interlacing on every frame with pure interlaced material, regular IVTC will output blends and jerkiness.

- What it does:
- High quality adaptative field matching for hard telecine
- Bob, remove the blends and decimate back to the desired framerate for DHT/field-blended
- Creating a VFR clip for hybrid sources
- Bob the interlaced credits, blend-deinterlacing the background while doing minimal damage on the progressive credits, convert their framerate to match the episode's and splice them with it OR leave them @ 30p to create a VFR clip
- Very good combing removal and anti-aliasing functions (can be called externally as eediaa() daa() maa() or sharpaamcmod())
No AA // AA
__________________
AnimeIVTC() - v2.00
-http://boinc.berkeley.edu/-
Let all geeks use their incredibly powerful comps for the greater good (no, no, it won't slow your filtering/encoding :p)

Last edited by thetoof; 14th January 2010 at 17:47. Reason: v2
thetoof is offline   Reply With Quote
Old 1st June 2008, 09:31   #2  |  Link
thetoof
Sleepy overworked fellow
 
Join Date: Feb 2008
Location: Maple syrup's homeland
Posts: 933
AnimeIVTC() v1.03 is too long to fit in a single post... so for now I'll leave this empty in case I need it someday.
__________________
AnimeIVTC() - v2.00
-http://boinc.berkeley.edu/-
Let all geeks use their incredibly powerful comps for the greater good (no, no, it won't slow your filtering/encoding :p)

Last edited by thetoof; 17th September 2008 at 01:57.
thetoof is offline   Reply With Quote
Old 1st June 2008, 09:57   #3  |  Link
Adub
Fighting spam with a fish
 
Adub's Avatar
 
Join Date: Sep 2005
Posts: 2,698
Ah "IT" is released into the wild!! I will check it out more in the morning, but looks like it will have to be added to the arsenal!!
__________________
FAQs:Bond's AVC/H.264 FAQ
Site:Adubvideo

Last edited by Adub; 17th September 2008 at 07:58.
Adub is offline   Reply With Quote
Old 1st June 2008, 12:54   #4  |  Link
HymnToLife
Ubuntu French Roast
 
HymnToLife's Avatar
 
Join Date: Apr 2006
Location: Bordeaux, France
Posts: 191
Hmm, I have trouble getting my hands on VinverseD, and it's not in your Requirements archive. Care to post it here? (Tritical's Vinverse is not either, btw, but this one is easy to find)

EDIT : Got it. However, is there a reason why both are used? From what I can gather, Tritical's is just a rewrite of Didée's as a plugin.

EDIT 2 : anyway, many many thanks for a great function, it will make my life much easier from now on

Last edited by HymnToLife; 1st June 2008 at 13:47.
HymnToLife is offline   Reply With Quote
Old 1st June 2008, 17:15   #5  |  Link
thetoof
Sleepy overworked fellow
 
Join Date: Feb 2008
Location: Maple syrup's homeland
Posts: 933
Yup, forgot to add vinverse... but as you said it's easy to find the plugin. The vinverse script is actually where vinverse was originally thought, but I recommend getting the actual plugin by tritical instead.
VinverseD is a function included in mcbob, so it is part of requirement package. I made it possible to use both because vinverseD is stronger (and slower), so it might be useful for very tricky sources.
__________________
AnimeIVTC() - v2.00
-http://boinc.berkeley.edu/-
Let all geeks use their incredibly powerful comps for the greater good (no, no, it won't slow your filtering/encoding :p)
thetoof is offline   Reply With Quote
Old 1st June 2008, 17:26   #6  |  Link
Zarxrax
Registered User
 
Join Date: Dec 2001
Posts: 1,219
Interesting. I'll test this out on some various sources when I get a chance.
Zarxrax is offline   Reply With Quote
Old 2nd June 2008, 06:20   #7  |  Link
MADAJ
Registered User
 
Join Date: Nov 2007
Posts: 54


How can I solve this problem?
MADAJ is offline   Reply With Quote
Old 2nd June 2008, 07:48   #8  |  Link
thetoof
Sleepy overworked fellow
 
Join Date: Feb 2008
Location: Maple syrup's homeland
Posts: 933
I guess you used mode=2 or 4 with decimate=5 or check=7 since those settings are the only ones using requestlinear... but could you post your script and tell the version of TIVTC and mrestore you're using? Try replacing them with the ones included in the "requirements.7z" file I uploaded. It may solve your issue.
__________________
AnimeIVTC() - v2.00
-http://boinc.berkeley.edu/-
Let all geeks use their incredibly powerful comps for the greater good (no, no, it won't slow your filtering/encoding :p)
thetoof is offline   Reply With Quote
Old 2nd June 2008, 08:35   #9  |  Link
manono
Moderator
 
Join Date: Oct 2001
Location: Hawaii
Posts: 7,406
Yeah, that error is usually caused when using an old version of TIVTC. Update it and try again.
manono is offline   Reply With Quote
Old 2nd June 2008, 17:49   #10  |  Link
HymnToLife
Ubuntu French Roast
 
HymnToLife's Avatar
 
Join Date: Apr 2006
Location: Bordeaux, France
Posts: 191
Yep, I got the same thing at first, but replaced all my plugins with the ones provided in Requirements.7z and everything's working fine. Really great stuff btw, my Sky Girls DVDs still needed quite a bit of denoisig/sharpening afterwards, but this completely eliminated the combind and edge flickering. Thanks again for a very n00b-friendly script =)

Last edited by HymnToLife; 2nd June 2008 at 17:51.
HymnToLife is offline   Reply With Quote
Old 2nd June 2008, 18:26   #11  |  Link
MADAJ
Registered User
 
Join Date: Nov 2007
Posts: 54
Quote:
Originally Posted by thetoof View Post
Try replacing them with the ones included in the "requirements.7z" file I uploaded. It may solve your issue.
It does.

thanks a lot.
MADAJ is offline   Reply With Quote
Old 2nd June 2008, 18:50   #12  |  Link
elguaxo
Registered User
 
elguaxo's Avatar
 
Join Date: Jun 2006
Posts: 260
thanks
elguaxo is offline   Reply With Quote
Old 2nd June 2008, 23:00   #13  |  Link
Nightshiver
Quality Freak
 
Join Date: Jun 2007
Location: Area 52
Posts: 597
How do you go about splicing in credits to the end/beginning of an anime series?
Nightshiver is offline   Reply With Quote
Old 3rd June 2008, 00:02   #14  |  Link
thetoof
Sleepy overworked fellow
 
Join Date: Feb 2008
Location: Maple syrup's homeland
Posts: 933
If you want to use a creditless version of the op/ed, use
Code:
a=file + processing
b=file + processing
c= ...
...
a+b+c+....
and if you want to process them to have them @ 23.976fps with no interlacing or jerks, use
Code:
animeivtc(mode=3, omode=1 [other settings]) #would have been mode=4 if it was a double hard telecine, but since I know your source, I can assure you it's a hard telecined one
Also, about the other question you asked me by PM, use the guide to identify your source (a few things were not posted to reduce the size of the first post). If you still can't, post a sample.
__________________
AnimeIVTC() - v2.00
-http://boinc.berkeley.edu/-
Let all geeks use their incredibly powerful comps for the greater good (no, no, it won't slow your filtering/encoding :p)
thetoof is offline   Reply With Quote
Old 3rd June 2008, 00:22   #15  |  Link
Nightshiver
Quality Freak
 
Join Date: Jun 2007
Location: Area 52
Posts: 597
Do I add animeivtc(mode=3, omode=1 [other settings]) to my entire script? If so, should I still have/use TFM + Tdecimate at the beginning? I also presume that there is a comma after omode=1 and that the "other settings" means other settings I might choose in animeivtc?

EDIT: After just putting in (mode=3, omode=1), vdubmod gives me the error that I must specify a pureint function from 1 to 7. I looked at it and have no clue as how to work it. For example, the first function is 1 : i1 + e1. Do I make the i=0 all the time? How do I know which number to put in, such as do I use pureint=1 or =2 or =3 etc. More info: the start frame of the credits is 39594 and the end frame is 41539.

Last edited by Nightshiver; 3rd June 2008 at 00:38.
Nightshiver is offline   Reply With Quote
Old 3rd June 2008, 00:45   #16  |  Link
HymnToLife
Ubuntu French Roast
 
HymnToLife's Avatar
 
Join Date: Apr 2006
Location: Bordeaux, France
Posts: 191
So far, I've only been able to get my hands on pure hard telecined stuff (i.e. mode=1) and all I had to do was

Code:
DGDecode_mpeg2source("blah.d2v")
AnimeIVTC(mode=1, aa=2)
And that's that, I got a nice 23.976 clip with all the combing/blends/etc. removed. Also, I think we need you to post your whole script in order to troubleshoot it, not just a part of it
HymnToLife is offline   Reply With Quote
Old 3rd June 2008, 00:54   #17  |  Link
Nightshiver
Quality Freak
 
Join Date: Jun 2007
Location: Area 52
Posts: 597
You don't need my entire script as I"m only asking about splicing in credits, not help on building an entire script.
Nightshiver is offline   Reply With Quote
Old 3rd June 2008, 00:59   #18  |  Link
HymnToLife
Ubuntu French Roast
 
HymnToLife's Avatar
 
Join Date: Apr 2006
Location: Bordeaux, France
Posts: 191
Hmm, then I'm not sure I understand what you mean by "splicing in credits". Do you mean you have a creditless version of the op/end that you want to insert instead of the normal version that is in your episodes?
HymnToLife is offline   Reply With Quote
Old 3rd June 2008, 01:20   #19  |  Link
Nightshiver
Quality Freak
 
Join Date: Jun 2007
Location: Area 52
Posts: 597
No. read up on the thread I made about this: http://forum.doom9.org/showthread.php?t=137538
I want the entire episode AND the credits. If you read in the thread, the problem was that the credits are pure interlaced while the rest of the episode is not.
Nightshiver is offline   Reply With Quote
Old 3rd June 2008, 01:38   #20  |  Link
HymnToLife
Ubuntu French Roast
 
HymnToLife's Avatar
 
Join Date: Apr 2006
Location: Bordeaux, France
Posts: 191
Oh, right, I missed that pureint stuff. Well, the value you have to use for it depends on where the pure interlaced parts are located in your clip. For example, "1 : i1 + e1" means that you must use pureint=1 if you have a pure interlaced section followed by an IVTC section. In your case, you have two pure interlaced sections, so you would use 2, 3, 6 or 7 depending on whether you have IVTC section before the op and/or after the ed. For example, if you have an IVTC section before the op and after the ed, the pattern of the whole clip is

IVTC (before op), interlaced (op), IVTC (main), interlaced (ed), IVTC (after ed)

so you would use pureint=7 (e1 + i1 + e2 + i2 + e3). On the other end, if the op begins right at the start of the episode, and the ed ends right at the end, you would use pureint=2.

EDIT : of course, then you must use [i|e][start|end][1|2|3] to specify the frames where the different sections start/end.

Last edited by HymnToLife; 3rd June 2008 at 01:42.
HymnToLife is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:53.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.