Log in

View Full Version : Progressive source with (combing/interlacing?)


osgZach
18th January 2010, 22:30
(I'm assuming its combing, but am labeling it combing/interlacing)

I have a 29.97 VOB source (Anime DVD) that for the large part is progressive.

However there are random scattered bits (most of them interestingly enough, are shots that involve panning. either full scene pans, or foreground objects against a static or near static background) that are combed/interlaced.

I am looking for a good method to selectively deinterlace/decomb those particular frames without introducing playback stutter and thus far I've been unsuccessful. Mostly fooling around with Tdeint and a few other things.

If it doesn't look bad on playback, I am open to some examples of blending methods I could use on those select sections. As if I recall blending is supposed to allow to maintain framerate, without stuttering (I hope).


Any pieces of code advice I can try, that won't touch the progressive parts (adaptive deinterlacing?) would be great.
Not sure a sample is really warranted, but I'll provide one if needed. I'm thinking its a matter of me not discovering the right settings to experiment with.


Random additional info:

It's a very strange situation. If I choose to produce a VFR file w/timecodes it will playback fine on the PC when muxed together etc. But try to play the MKV on my WDTV Live and it stutters on what appear to be the exact same areas that have the combing/interlace issues.

If I try to even dump it to an intermediate AVI file @ 30fps, I will get stutter, but if I encode it from VOB -> H.264 it will playback fine at 30FPS, however the combing/interlace artifacts are of course present (or reduced but also showing jaggies IIRC). Doing it through TMPGEnc Xpress into an H.264 MP4 yields slightly better results w/rt: artifacts but I have no idea how/what it would be doing and it still produces weird files that will always stutter at one particular spot though the rest of the video is flawless.

A WMV output from TMPGenc Xpress is practically flawless that I can tell, but quality / file size is way too big for my taste from my early experiments.

Guest
18th January 2010, 22:59
Post a link to a VOB fragment that *can be used to duplicate the issue*.

osgZach
18th January 2010, 23:33
VTS_03_1.m2v (http://www.oldskoolgames.com/videos/VTS_03_1.m2v)
(should be no link problems...)

I started the cut a little early, but after to white fade out there is a part where it will show interlacing as it moves along the CG satellite model.

I believe stuttering can be spotted in this part when converted to an AVI (huffyuv-yv12) even if you do no processing on it. Another part is when an attack craft "slides" into the scene from the upper-middle part of the screen on the right side, moving down and to the left. That definitely stutters unless you directly encode it to H.264 although no interlacing/combing that I can see there.

Most of the combing that I have a big problem with is the CG satellite model's camera run. I'm sure it's probably interspersed in other parts of the entire clip too, but these should suffice. Fix these and anything else would likely be fixed.

If anyone happens to know what decombing filter Handbrake uses, and if it has an equivalent in Avisynth (along w/code) that might be enough to fix this. As for now I'm just experimenting with some decombing attemps direct to H.264 in a MeGUI w/ a fast mode to see if skipping AVI will alleviate the issue entirely.

Edit:
I can confirm that the test I just did with FieldDeinterlace (since I hadn't tried it yet anyway) directly to H.264 @ 29.970 FPS seems to have worked. No stutter issues are present. The most aggresious artifacts are gone, however obviously I now need a way to try and minimize the jaggies on the line edges, from the interpolation. I'd still like to avoid motion blur if possible.

Gonna try and reduce the interpolation jaggies now I guess.. input is still welcome of course. You guys know way more than I do.

osgZach
19th January 2010, 00:28
Well that's definitely very involved!, hehe...

I'm not sure that's all entirely necesarry tbh.. As its mostly VERY sporadic parts that are really showing the combing issues.

i.e


edi=nnedi2(field=-1)
TDeint(mode=0, full=false, clip2=edi)


Will play through at pretty much the normal rate, only beginning to stutter on all the problem pieces, of which there aren't many of.

If I can get some decent deinterlacing setup to reduce the jaggies it will not be an issue to run the script that way.

Although reading your post, just gave another idea.. Which was running it through a 2-pass TFM/TDecimate VFR script (or using AnimeIVTC, newer version seems very nice) and just doing it through MeGUI directly into a H.264 instead on the second pass, instead of using Vdub for the 2nd pass into a lossless AVI.

May increase encoding time, but if test output confirms it to work well, could be worth it also.. I can just use Vdub to collect the 1st pass data only.

The only reason I suspect this may work, is that the component introducing stuttering on in previous VFR attempts, appears to be the step including an AVI file.. So far straight encodes into H.264 play fine on my WDTV Live, so maybe a VFR generated this way would come out fine too? I don't think those past VFR's had the image quality problems either in the sections being discussed here.

Guess I won't know until I try... But at least I know I can still do selective deinterlacing and maybe have to live with some jaggies as a trade off. It's in very few scenes as it is and most of them are high motion.

osgZach
19th January 2010, 01:17
Yes, your example definitely plays smooth and looks great both on my PC and my WDTV Live. That's is awesome.
Unfortunately even with your explanation the code is still greek to me, and I probably don't understand the exact steps to do (in a repeatable fashion) to do it that way... Also concerning that - do I need to make a timecodes file manually or... ?

Re: your comments on deinterlacing. I've no intention to deinterlace every frame, only the troublesome ones that Tdeint (for example) seems to pickup without a problem.. I've done so much testing I can't recall if it plays back smooth on my WDTV - but I know it does on the PC at the least.. And is only deinterlacing those trouble spots.

I did just do a test.. 2 pass TFM -> VFR based on its example files, straight from VOB to H.264 and while it did improve the stuttering, it is still ever so slightly there in tiny spots. But there is no question your #1 method would work great if I could actually understand what I was reading enough to use it. (sorry)

Otherwise it's gonna end up being the "spot" deinterlacing method for me at a CFR 30fps.. And hope it all pans out. I would be very greatful for a small tutorial, even if its a linked to a web site somewhere with the steps in sequence.. (how to count, once you get your 5 frames boundary what do you do? exactly how do you handle the decimation glitches you mentioned, etc). For instance, watching the Progressive/Interlaced indicator in Telecide, I would have no clue on how to decide to "break up" the sections (because they seem so randomly interspersed for the most part, except for a few longer pieces) and what to do with them after that.

I'm trying hard not to ask for you to do the work for me of course.. A lot of this is just often over my head.

osgZach
19th January 2010, 01:43
Ah so..

It might look like this then?


d2vpath="blah.d2v"
mpeg2source(d2vpath)

film = Telecide().Decimate().AssumeFPS(last.framerate)
######EXAMPLE###########
#frames 0 - 66 = OK
#frames 67 - 150 = COMB
#frames 151 - 1000 = OK
#frames 1001 - 1021 = COMB
#frames 1022 - 9000 = OK

Trim(last,0,66)+Trim(film,67,150)+Trim(last,151,1000)+Trim(film,1001,1021)+Trim(last,1022,9000)

#and this is my brand new VFR clip which I can stick in an AVI or H264 ?

#
#
# My Timecodes?
#
#

# timecode format v1 - artifically spaced for readability
Assume 29.970030

67, 150, 23.976024
1001, 1021, 23.976024



### Is that correct?


I hope to hell this is what you mean.. THIS I might be able to handle, heh...

Also, as an aside. Looking at a TFM/Tdec generated timecodes file. There are often sections (I have noticed this in more than one case) where it is specifying frames to run at 17FPS (usually some kind of fraction). Is this is any major consequence and what might it mean? They are usually sporadic entires of less than a handful per timecodes file.

osgZach
19th January 2010, 10:33
That's really helpful, thanks a lot. I actually found a Yatta archive the other day but no idea if its the newest there was or not.. I've been wanting to look at it but its reputation scares me I guess :p Be helpful if anyone has some old guides archived for sure.

Won't have time to try all this until I get home from work, but appreciate it immensely

osgZach
19th January 2010, 18:18
Could someone assemble a practical example, of how my workflow should look?

i.e if I try just the snippet of code (film = blahblah) even as a variable (and without using it directly), I get an error thrown.. i.e Is this something that can be done in one Vdub instance? Or is it easier to do it across two, with slightly different scripts, so things can be previewed, etc.. I want to make sure I'm doing it right.

In general I would ideally like to have an entire preview of both the film clip, and the video clip. Switching between commented Trim commands to preview my work, within the video clip.

Fussed with yatta some.. ymc is easy enough but the actual program is gonna take a manual/tutorial of some sort explaining everything about it, and how to use it.. etc
Unfortunately it seems any semblance of a web site has dropped off the face of the earth, and even the one "support forum" I found is devoid of traffic or any kind of FAQ/Tutorial stickies /active posting.

Sucks, I think I would probably be able to do this easily if I could learn the darn program :( I'll get by fine w/Vdub though. Just need to understand the flor of the process

osgZach
19th January 2010, 21:37
Thank you so much for that brief lesson. The community sorely needs these kinds of things from experienced YATTA users. (it seems the project is hiding or dead which sucks). I can tell just from reading, that I understand a lot more about how to use the interface now. So hopefully something will come of this in the long term.

In the short term, I was frustrated. So because it only took me 10 minutes to find out, I did a quick H.264 with the method I was talking about up top.

d2vpath="VTS_03_1.d2v"
mpeg2source(d2vpath)

edi=nnedi2(field=-1, qual=3)
tfm(d2v=d2vpath,mode=0, pp=6, slow=2, clip2=edi)

I have to say, even though the deinterlaced frames are half resolution, they stay came out very nice, and the video seems to play fine after muxed into an MKV. Ultimately I'll need to test it on the WDTV Live when the TV set is free.. I really don't understand why a typically produced VFR is so choppy on the unit anyway, but not the PC..(whereas your example played fine). I have other VFR MKV's that seem to play fine from what I can recall.

I guess they have some bugs to work out? Or they have not completely implemented the matroska specs.. who knows.

However I am still going to do my best to learn Yatta and only keep the method I've mentioned, as a last resort backup. I really appreciate your help on this, you've been a great teacher these past few posts. I would highly encourage you or other experienced YATTA users to write a full YATTA tutorial if you ever find the time. I'm sure it would make things a lot easier on those of us who, while lacking the technical expertise, can still learn how to use it with the right teaching material.

Hopefully I won't have too many (if at all) more annoying questions :p

osgZach
19th January 2010, 23:54
Also.. the only plugin available on ivtc.org (and yatta 7-130 beta 6) is fieldhint (which I would have no idea how to use).. Is SCXvid / Telecidehints absolutely necesarry (not only in this case, but in general) ? If anyone has them and can provide them, that would be great.


edit:

I'm a little confused by the pattern indicator (its actually top left)

There are more than one set of underscores. They also MOVE from right to left, as the pattern (cccccccccpcccpcppcccp etc) line also moves. It is confusing me as to which direction I need to follow (left to right?) and which boundary is actually being marked / is the one to actually pay attention to.. Is it like... the 5 right-most frames, starting on an underscore, paying attention to the last underscore that starts a full 5 frame block? I hope you understand what I'm asking.

osgZach
20th January 2010, 15:24
Cool, I've grabbed those files. Thanks for the further explanation:thanks:.

osgZach
21st January 2010, 22:03
Steven, I didn't get a chance to save your helpful information.. If you could be so kind as to repost the Yatta usage guide so I can save it... I would really appreciate it.

osgZach
23rd January 2010, 00:28
Yatta!

Guess I remembered enough of what was posted before.. I spent most of the day working in YATTA and it came out pretty OK in the end. Just tested and plays fine on both the PC and WDTV Live. This is great. Hopefully I will be able to duplicate the success with other files.

Thanks again for the help, Steven. Wherever you are.

Guest
23rd January 2010, 04:04
Steven, I didn't get a chance to save your helpful information.. If you could be so kind as to repost the Yatta usage guide so I can save it... I would really appreciate it. Did you mean this:

I haven't the time to explain everything that is in YATTA, but here's Stephen R. Savage's "fix this problem quick with YATTA."

0) Download YATTA. I recommend the latest 7-130b6 release. You also want SCXvid, TelecideHints, FieldHint, Decomb, TIVTC, and probably NNEDI2. Place the filters in a plugin directory (not the AVS autoload directory). YMC and Yatta will ask you for it.

1) Get the source into something that YATTA can handle. d2v is probably your safest option for MPEG-2.

2) [Optional] Load the source into YMC. Crop and SCXvid are probably good ideas. Choosing to use TFM or Telecide is at your discretion. Decimate is unnecessary here. Set Mpeg2Dec to DGDecode.

3) Either load the YAP from YMC or the source into YATTA.

4) Do some basic configuration. Tools -> AVS Generation -> Uncheck "Resize." Select your postprocessor. NNEDI2 is probably the best choice. Optionally, set your decimation to TDecimate. Set your cropping parameters (again) by right clicking on the video and selecting Additional -> Cropping and Resizing. You might also need to set the field order under Settings -> Order if nothing seems to be working right.

5) [YMC not used.] Go through the video section by section (alt+left) until you reach something with combing. Hit "Try Pattern" ("t") and accept the defaults. Now, scroll through the section and see if it's still combed. If it is, try hitting "Switch" ("s") to shift the pattern and see if that resolves it. Once you get the pattern right, scroll to the end of the section and hit "Use Pattern." Repeat this for the entire video. You might notice that some fades or dissolves have scanlines. Ignore these, as they are an artifact from the use of 60i fades. Occasionally, there may be frames that just can't be matched. Toggle the "Postprocess" button to mark them for deinterlacing.

6) [TFM/Telecide & YMC used.] Hit the up/down arrow keys to move through the video. They will direct you to frames that TFM or Telecide think are more combed than their neighbors. If they are combed, move on. If not, hit the "Postprocess" toggle to avoid deinterlacing them. After you finish this, save the project ("Save"). Open the YAP file with Notepad and search for the "[postprocess]" tag. The up/down search will pass over frames if their neighbors are similarly combed. Use the "Goto" button ("g") to jump to the frames listed in the YAP file under "[postprocess]" and verify that they are all combed. If you see a range of continuous or regularly spaced frames, there is probably a telecine anomaly that you should investigate further.

7) By default, the entire video will be decimated. This is not what you want. Start from the beginning and hit "No Decimate." Go to the beginning of the first telecined section (it will show as "cccpp" or "ccccp" or something similar in the top-right corner). Hit the "No Decimate" button again right before the telecined section to close the override. This is where the rule of 5 comes in, as YATTA will only override complete cycles (the underscore in the top-right corner denotes where the cycle boundary is, and the current frame is in uppercase). You probably won't be able to match the scene cut exactly, so you will have to choose whether to slow down part of the video section to 24p or speed up part of the telecined section to 30p. Go to the end of the telecined section and repeat.

8) Save the project ("Save") and then save the overrides (your end results) by right-clicking on the video and selecting "Save All Overrides (Project Path)."

9) [Optional] There will be a new AVS script and a bunch of other text files in the folder where you saved the YAP. Open this in VirtualDub and preview for choppy motion and combing. The 24p parts won't play at the right speed, but this shouldn't stop you from doing this. You can also inspect the autogenerated AVS script and adjust it if you like.

10) Encode the generated AVS with whatever program you like. AVS will pretend that the output clip is 30000/1001 fps, and if you want to use bitrate-based ratecontrol, you will have to calculate the appropriate "wrong" bitrate from the AVS video length.

11) There will be a timecodes file "[project name].vfr.txt" Mux it in with the video using mkvmerge. This is also the right time to put the audio in.

12) Check the final video for issues and modify your YATTA project if necessary. You will have to start over from step 8 if you correct anything.

Edit: Actually, it seems that although much of your source is progressive, large parts of the actual animation was drawn at 24p and then frame duplicated to 30p. Only the pans and possibly some CG are actually 30p. If you want to put more work into this, you could also set those progressive animation-only sections to be decimated as well.

osgZach
23rd January 2010, 20:06
Wow, yes! Thanks a lot for getting that.

There was one more explaining the frame indicator if that one could be fished out too, I think it had may have other info in it too (if not don't worry about it, as I understand that specific part now).

:thanks: