PDA

View Full Version : AVS wizards please: How to handle poorly encoded DVDs?


Mentar
12th March 2002, 13:31
There have been several instances lately in which clean source material (the famous original "Region 2 anime DVDs" from Japan) has been screwed up while they were reencoded for region 1 US releases. A typical mistake seems to be to apply cheap deinterlacer filters on a clean interlaced source, and screwing things up this way. Here's an example:

http://trough.maeh.org/~gross/example-bad.jpg

This one frame shows massive aliasing, obviously from a poor deinterlacer filter. However, the next frame is identical and basically clean:

http://trough.maeh.org/~gross/example-good.jpg

Once again: Those are normal unprocessed original source frames, no interlacer had been applied.

So the one-million-dollar question is: Is there any way to remove the "crap" frames and replace them with copies of their "clean neighbours" somehow?

I've been playing around with decomb and managed to get a fairly nice-looking 29.97fps progressive stream with Decimate(mode=1,threshold=25). Now is there any filter who could either remove the crap frames and replace them with the clean ones, or (alternatively) identifies the crap frames and tries to cut _them_ out when doing a Decimate down to 23.97fps?

Brutally said, I would really prefer to have slightly choppy but clean output to those crap frames who are extremely irritating during playback, because they make the picture look extremely yucky.

Any ideas? I could imagine that it should at least be possible to come up with a filter who checks for clean1-crap-clean1 and turns it into clean1-clean1-clean1. All that would be necessary is to identify "crap" frames - but with the typical heavy aliasing all over the frame it should be possible.

Any ideas? It would REALLY help alot!

Guest
12th March 2002, 15:22
@Mentar

I am in touch with you via email and you are providing a clip for me to analyse. I just want to say that your assumptions may be unwarranted. The effect in example-bad.jpg *may* be caused by incorrect field matches. That is why I want to inspect your clip before going off into an exploration of new Decimate features. I have tools to force the matching and I will quickly be able to determine if there is a good match for the frame that is coming out bad.

Guest
13th March 2002, 00:47
Analysis has revealed that the default combed frame detection was too low for this clip. Using:

Telecide(threshold=25)

...cleared it up. What was happening was that Decomb thought that some frames were combed and deinterlaced them. You had blend=false so it looked scuzzy. Sometimes, picture detail can spoof the combed frame detector and you have to reduce its sensitivity. Probably the default should be higher, as my esteemed colleague "manono" has suggested.

You might also argue that my default deinterlace threshold is also too low, which explains why you thought it was "cheap". But I'm caught between a rock and a hard place. If I raise the defaults, people with clips that require it lower will say Decomb is passing through combing. :-)

Realistically, Decomb requires some tuning for difficult material, such as poorly mastered anime. Fortunately, it is flexible enough to allow that.

Mentar
13th March 2002, 12:30
Thanks go to Donald for his quick help :D

Unfortunately, the issue doesn't completely end here. While resetting the threshold managed to get 90% of the testclip play totally cleanly, the full movie continues to give headaches. In particular the clean test clip scene is still "screwed up" in the full movie.

I have the suspicions that there are a few "scene changes" in the movie in which the field order changes, leading to very "binary" results - either the output looks perfect or very poor.

Anyway, it seems that my problem is an isolated one and not general as I assumed earlier, so I'll close this thread, follow up via email and once again thank Donald for his great help.

Very much appreciated! :)

Guest
13th March 2002, 13:39
You haven't indicated if the "screwed up" is the same symptom. I'd be very surprised if it was. And I'm doubting your field order explanation because Telecide()'s mission in life is to adapt to just such changes. My guess is that you may actually have some *missing fields* in your source. You have stated that the source is poorly mastered. Anyway, please do continue in email; I hate to have lingering mysteries floating around.

madoka
13th March 2002, 19:02
Sorry for a slightly off topic question, but since we're on the topic of processing anime with decomb, here goes:

neuron2:

You mentioned that the default threshold for decomb is too low in this instance. My experience has been that the thrshold is too low for most anime EXCEPT for the mouths of the characters, which I can only get rid of by setting threshold=2. IMHO combed mouths are more annonying than slightly fuzzier static frames. However I'm wondering if there's a way to get the best of both worlds. I've tried playing with the dthreshold parameter, but with no noticable effect.

Also, about the anti-jitter filter, it would help with anime as well; Evagelion and Nadesico are two instances that I think it'll help.

Guest
13th March 2002, 20:57
@madoka

My recent experience is that the mouth problem (little mouths opening and closing with the rest of the scene static) results from field matching failure, rather than a failure to detect interlacing. Assuming you have 3:2 pulldown material, try this pattern guidance:

Telecide(guide=1,gthresh=25)
Decimate(cycle=5)

And note the warning in the help file about random access with pattern guidance. Does this help?

I am reassessing what the default thresholds should be and may make a new release with new ones.

madoka
14th March 2002, 06:56
Originally posted by neuron2
@madoka

My recent experience is that the mouth problem (little mouths opening and closing with the rest of the scene static) results from field matching failure, rather than a failure to detect interlacing.


Hmm...I don't think I've ever came across any anime DVD that's pure film. Most of them are mixed film / NTSC material. Furthermore, the problem occurs with pure NTSC sources as well. My region 2 Read or Die DVD is pure NTSC yet I still get combed mouths.


Assuming you have 3:2 pulldown material, try this pattern guidance:

Telecide(guide=1,gthresh=25)
Decimate(cycle=5)


I tried the above script (except with gthresh=50 otherwise there's no effect, and post=false) with the X-Men DVD, and I can see what you're saying. So perhaps it's two separate but similar problems?

Guest
14th March 2002, 14:07
@madoka

Normally, for pure interlaced material you want to set full=true for FieldDeinterlace(). Then the mouth problem resulting from failure to detect a frame as combed will not occur, because full=true forces all frames to be considered combed and then smart deinterlaced. Fine. But when you have mixed film/nonfilm, you want to set full=false so that good progressive frames are not affected. Then the issue of combed frame detection arises. You can try setting threshold lower, but if too low again good frames will start getting affected. I wish there was a better solution to this problem of hybrid clips. If you think of one, please let me know!

And yes, there are two ways that the mouth problem can arise: 1) field match failure in film segments, and 2) combed frame detection failure in nonfilm segments of hybrid clips.

madoka
15th March 2002, 01:10
Originally posted by neuron2
@madoka

Normally, for pure interlaced material you want to set full=true for FieldDeinterlace(). Then the mouth problem resulting from failure to detect a frame as combed will not occur, because full=true forces all frames to be considered combed and then smart deinterlaced.


I see. I shall keep that in mind in the future.


Fine. But when you have mixed film/nonfilm, you want to set full=false so that good progressive frames are not affected. Then the issue of combed frame detection arises. You can try setting threshold lower, but if too low again good frames will start getting affected. I wish there was a better solution to this problem of hybrid clips. If you think of one, please let me know!


Nope, sorry. I don't think I possess enough technical knowledge to come up with clever algorithms :o. I was wondering, however, why software DVD players (at least PowerDVD, which is what I have) seems to have no trouble deinterlacing or performing IVTC. So what's so special about their algorithms that seems to "get it right" almost all the time?

western shinma
15th March 2002, 02:12
Actually software DVD players are pretty bad at deinterlacing, at least for certain sources. On many anime discs, you have to force bob deinterlacing or else you get these strange colored lines on some scene changes. And in bob mode, the shimmering on frames that should be static gives me a headache. YMMV of course.

Guest
15th March 2002, 02:25
I agree with western shinma. I have many DVDs that play worse through PowerDVD than through Decomb. And if you think about it, that is not so surprising because to keep up with real time, the software players have to use quick-and-dirty methods. You may not be as aware of them as you could be because you very rarely (if ever) single-step through frames with a software player.

...which leads me to my soapbox!
Along with my esteemed colleague "manono", I think people can get overly fixated on stepping through frames, and getting unduly upset when one out of 1 or 2 thousand frames is rendered suboptimally! I had an email discussion with a chap about the blended frames put out by Decimate(mode=1). I finally got him to reluctantly agree that when viewed at full speed it looks fine and you don't notice the blends. I even had him show the movie without comment at normal speed to innocent observers. None of them remarked about anything being out of the ordinary. But he didn't like THE IDEA of the blends being in there, probably as a result of agonising over them while single stepping. And suppose Decomb (or IVTC4, or whatever) puts out a crummy frame every couple thousand. Is it really worth getting anal about it? :)

trbarry
15th March 2002, 14:37
I think we are going to have to live with it. I find a LOT of blended frames in the source of my HDTV captures. More and more things are getting mastered that way for some reason. And except for throwing away selected frames I don't see any real way around it.

- Tom

OUTPinged_
15th March 2002, 14:51
DG, you know what was the stage of development when you filter has became the best for anime sources?


It was when it could selectively apply smart deinterlace on selected frames. :-)

yeah, that was version 1.7 or earlyer (dont remember)

it was ok already at this point.


The "poorly mastered dvd problem" and "pure ntsc dvd issue" are in fact non-existant.

I made tons of encodes woth sources which can be dubbed as these two above.

Every one of them looked ok after ivtc, with pure 30fps scenes being jerky of course.

I am yet to run into a dvd with pure 30fps anime content at least for 30% of full length. (a tip: dont buy HK dvds :-P )

On worst cases (telecined after poor ivtc of pure 30fps source) you have to dump decomb and use tmpg with animation adaptation routines. these drop a field in some frames and that way it does look beter than decomb for some parts (can send a sample to DG if he would like it). It is quite hard to set up and usually works for a certain parts of the movie, so you have to be really picky bastard to use that.

Decomb forewah! (Motion man denoise is left to implement only atm :P)



A question to DG:

there is a "field bob" filter implemented into late versions of virtualdub. could it be implemented as a quick and dirty postprocessing routine for encodes where speed matters along with blend deinterlace?

Guest
15th March 2002, 15:08
@Tom

Are those HDTV frames progressive? If so, and you're getting blends, it underlines my point about having blends at normal speed is not a "viewability" issue.

@OUTPinged_

Yes, I completely agree with you on the point where Decomb became really useful! That was why the 2.0-2.2 versions were such a fiasco. I removed that feature because I thought the combed frame detection wasn't working good enough. Then I saw how bad the output was and I looked and found a much improved detector algorithm and went back to the correct way for 3.0.

Some people really hate jerkiness. I find people *really hate* different things, so I try where possible to make Decomb flexible enough to let people bias it to their particular tastes. For example, I might hate the jerkiness enough to be willing to leave the file at 30fps [with Decimate(mode=1)] and take the file size hit. Others might not mind the jerkiness so much, especially if there are only a few such segments, but really want a smaller file size.

Often I get mails that start like this: "I tried Decomb but I can't get perfect results." A lot of people seem to think that perfection is achievable with these difficult sources and the tool must be deficient if they can't achieve it! But often the problems are simply inherent in the source.

BTW, I am now seriously considering denoising. As I like to say to my wife: it is a definite possibility.

I don't understand your point about field bob. If you mean to do a bob instead of blend or interpolate, that would produce a clip with each field made into a frame. You'd then have to resize up vertically and the file size would be double as well as have twice the frame rate. If I have guessed wrong about your meaning, please elaborate.

OUTPinged_
15th March 2002, 22:31
DG, that field bob filter does not have anythign to do with fps change. it acts like a casual deinterlace filter but produces better looking results. try it, it is pretty self-explanatory.

Guest
15th March 2002, 22:41
Indulge me, OP! What do you mean by "casual deinterlacing"? What are you comparing it to when you say "better looking results"? What settings do you use to achieve this casual deinterlacing?

I always understood this filter to require field separation first, either through the extended open options, or using Avisynth SeparateFields(). Using it this way doubles the frame rate.

trbarry
15th March 2002, 23:48
@Tom

Are those HDTV frames progressive? If so, and you're getting blends, it underlines my point about having blends at normal speed is not a "viewability" issue.


neuron2 -

No. I don't think I have seen them in native 480p or 720p material. The worst offenders are normal NTSC that has been up-converted to 1080i like my Buffy captures. I can't remember if I've seen them in material like Fox that upconverts 480i to 480p.

But the ones I do see will appear even if I first do SeparateFields. My Buffy's definately have temporal blending that shows up at almost all key frames and scene changes. (Not a Decomb problem)

- Tom

OUTPinged_
16th March 2002, 19:56
2GD:

Try to set both fields to "smooth" and apply it over a 30 or 24 fps source where some interlacing is visible.

Guest
17th March 2002, 02:39
Seems to act just like the internal deinterlace filter set for blend, i.e., it blurs the entire frame. That can't produce "better quality" and it's likely to be slower as well because every pixel is processed. So, tell me again, why would I want to do this? :)

OUTPinged_
17th March 2002, 14:13
DG:
checked it again. for some reason the output looked much better earlyer. maybe mistook filter setup for something else.

discard that please.