Log in

View Full Version : Cartoon capture, do frames like this need to be removed?


1loser
22nd January 2003, 00:13
http://user.7host.com/liketoshop/cartoon.jpg (http://user.7host.com/liketoshop/cartoon.jpg)
Why doesn't the image show up in my post?

I'm capturing with PicVideo's codec at 640 x 480 and using a de-interlace filter during the capture. This is working great but when I capture cartoons I'm not sure what needs to be done to remove frames like this.

I used this script (this is a partial script) but I'm not sure if it's correct. When I load the avs script in virtualdub I get some frames like this.

AVISource("wild thornberry 1.18.3.avi").AssumeFPS(29.970,True)
Telecide()
Decimate(5)

Than I use 2:3 pulldown to get the frame rate back to 29.97.

I'm not sure what if anything can be done with frames like this. Is this normal or should I remove them?

Karyudo
22nd January 2003, 03:10
I'm no genius at this, but I'm almost certain from looking at your sample that you should be IVTC-ing before anything else. In fact, in VirtualDub, that's all you might have to do. No deinterlacing, no telecide, none of that.

That may not be the whole problem, or whole solution, but maybe that will get you started.

I'd also do a Google search for "ivtc".

Karyudo

1loser
24th January 2003, 20:28
Originally posted by Karyudo
....you should be IVTC-ing before anything else. In fact, in VirtualDub, that's all you might have to do. No deinterlacing, no telecide, none of that.I thought using Telecide is IVTC-ing. Can someone set us straight on that?

Karyudo
24th January 2003, 23:56
I thought Telecide and Decimate *together* can IVTC, but they do other things (*more* things) separately. Maybe you can PM Donald Graft hisself -- he shows up here as neuron2 (I think??), with a nice white cat as an avatar. He should know what they do, since I think he probably wrote them...

And, are you getting VirtualDub and AVISynth confused? Because I didn't think VirtualDub needed Telecide at all, nor could load scripts like what you've written. (I could be wrong, of course).

I have found VDub's internal IVTC is quite good, if you use the manual settings on a fairly-regular source. Which, it must be said, anime often isn't.

Karyudo

1loser
25th January 2003, 02:36
Originally posted by Karyudo
I have found VDub's internal IVTC is quite good, if you use the manual settings on a fairly-regular source. Which, it must be said, anime often isn't.

Karyudo I read an article about using Virtualdub to ITVC and I tried using it but it didn't correct the frames with a problem. I only use avisync to encode but I view the avs script in virtualdub to determine if the source needs to be de-interlaced or IVTC'd. Actually, I stopped de-interlacing since I'm making a MPEG-2 for DVD standalone Playback.

dar1us
26th January 2003, 02:24
The image needs to be approved by a moderator before it will show up, you cant just display dirty European porn screen caps can you, unless doom wants to be arrested...

...Only joking. Hail Europe, the pioneers of the world!!

Spent a week and a bit there last year, specifically Germany. rained a little too much though, I 'heard' it is supposed to rain in the UK, never, we get the occasional flood but apart from that - maybe 2 days of big rain in 2 weeks, when a little rest, then a bit more. It isn't half as bad as they say, just chilly and windy.

I don't really consider the UK as part of Europe, though I am proud to be a European! Kinda odd really, but that's how the UK works. The odd nation.

Karyudo
26th January 2003, 03:20
@1loser:

There is always the chance, I suppose, that the weird frame is like that to begin with? Like, whoever dealt with producing the animation in the first place messed it up at the telecine stage?? Could be that your processing is just fine, but the source itself is a bit screwed.

You are very quickly plumbing the depths of my ignorance, so although I'd like to help more, I suspect I don't have the experience to be able to. I may already be on shaky ground as it is...

Your original question was "do frames like this need to be removed?"; maybe the answer is "no"??

Best of luck...

Guest
27th January 2003, 07:43
Karyudo is correct. Frames like that are caused by blended fields in the source material. Read the Decomb help file for details. There is no solution at this time.

These blended fields are usually a consequence of the content provider doing quick-and-dirty NTSC<-->PAL conversion.

1loser
28th January 2003, 04:10
I captured that cartoon with a de-interlace filter. I guess all I can do is encode it as 29.97 fps and leave it as it is.

jcsston
28th January 2003, 04:18
What deinterlace filter did you use?
The frame looks like VirtualDub's Deinterlace: Blend Fields.

1loser
28th January 2003, 04:35
Originally posted by jcsston
What deinterlace filter did you use?
The frame looks like VirtualDub's Deinterlace: Blend Fields. This is the Cyberlink filter and it's used while capturing with iuVCR. You can read about it here (http://forum.doom9.org/showthread.php?s=&threadid=42088). I'm not sure if it's a good idea to use it or not.

Karyudo
28th January 2003, 05:01
Why don't you put up 10-12 consecutive frames someplace, so we can *really* see what's what? The one frame you've posted looks royally screwed -- but that's not quite enough to determine what's gone on with your deinterlacing on the fly. What came before that frame? Or just after? Inquiring minds want to know...

1loser
28th January 2003, 05:55
Originally posted by Karyudo
Why don't you put up 10-12 consecutive frames someplace, so we can *really* see what's what? The one frame you've posted looks royally screwed -- but that's not quite enough to determine what's gone on with your deinterlacing on the fly. What came before that frame? Or just after? Inquiring minds want to know... http://user.7host.com/liketoshop/pics.zip right-click, save target as to d/l.

Here are 21 consecutive pics.

Karyudo
28th January 2003, 06:44
OK, I took a quick look. Good news: I think it can be saved! Here's what I see:

Frame/Field 1/Field 2
00: AB
01: BB*
02: BB
03: CC*
04: CC
05: CD
06: DD*
07: DD
08: EE*
09: EE
10: EF
11: FF*
12: FF
13: GG*
14: GG
15: GH
16: HH*
17: HH
18: II*
19: II
20: IJ

Note that if you toss the first frame (00), you've got 20 frames total, and 8 that are good. Multiply by 3, and you get 24 good frames in 60 total frames. Sounds like we're in good shape to me!

I don't know for sure what sort of frame rate we're looking at here, but I think it's 30fps with animation done at only 12fps (or, less likely, animated at 24fps and capped at 60fps). Either way, what's happening is regular: 5 consecutive copies of each field, giving two complete, clear frames followed by one messed up piece of garbage, in a nice repeating pattern. To get the original, unique film frames, you'd have to keep one (the ones marked with asterisks), skip one, keep one, skip two, and repeat.

I think what you want in the end is either:

BB, CC, DD, EE, FF, etc.,

...(with some flags set to do 3:2 pulldown on the fly) if it's starting as 60fps, or the less-optimal (i.e. slightly jerkier) but easier to MPEG-encode:

BB, BB, CC, CC, CC, DD, DD, EE, EE, EE, etc.,

...if it's starting as 30fps. This would mean the source was at 12fps, which isn't your fault! ;)

I'm sorta hoping neuron2 (or some other master) is still following along to either confirm or deny (or elaborate) on my suspicions, but that's my 2¢.

Hope you're handy with AVISynth, because I'm not, and I suspect that's going to be the best tool to keep and duplicate the appropriate frames!

Good luck (and keep us posted),
Karyudo

dar1us
29th January 2003, 08:14
there is a blured frame every 5, remove 0,5,10,15,20 and you are ok...

try a different decimation, or even an extended one (run another on the decimated material). every other of the remaining frames is motion here, so if you then do a SelectEven or SelectOdd in avisynth you will be left with only the useful frames. Then if you calculate the FPS it should run at, if it were pal, drom 25 to 12.5, for NTSC take your original framerate 29.97 and take away the frame every 5 frames removal, then divide it by 2, you should get something like 14. Then run it, dunno what will happen with the sound, it is early and I will play around tonite, with some captures of my own (I get the same problem under pal).

My good sequence runs

01
03
06
08
11
13
16
18

So, the same as karyudo's

dar1us
29th January 2003, 22:13
Ok, I have done a test but the results are pretty useless unless you can get a plugin to search for these frame types and remove them. The problem was that the frame types arn't at a fixed difference.

It may go (g=good, b=bad)

GBGBGBGBGBBBBGGBGBGBBBGGGBGB

If you get what I mean, if you take a short sample - like the original frames, they are a lot easier to decide which to keep and which to kill, selecting every 5 frames to encode.

Incase you didn't notice, if you had been to your maths classes looking for patterns, take the difference, and in the original sample, differences go 2,3,2,3,2 (frames 1,3,6,8,11,13,16,18(the good frames). I assume this pattern could possibly continue, in AVISynth, use 'SelectEvery(2,3) to remove the bad frames. I think that will include frame 1, if it doesn't, simply add a blank frame (cant remember the command) at the beginning of the movie, or add frames until the SelectEvery works.

Hope this has been insight to some, though I would really like someone to explain why cartoons captured look like this. Are they made at 24fps or even 12fps, then sped up to 24 allowing 2:3 or even PAL speedup. (sorry, not to hot on all that NTSC pulldown, pullup, PAL works just fine. If everything worked in PAL, there would be no problems, if cartoons were made at 12.5 fps, then each frame repeated, easy!

Finally, a possible reason for these bad frames is if the cartoons are made at half TV FPS, say if they were 12.5 (as animated) and displayed at 25, they are adding a blurred motion frame between each animated frame to make the motion smoother.

dar1us
29th January 2003, 22:22
So... Your Script should be

*****************************

AVISource("wild thornberry 1.18.3.avi").AssumeFPS(29.970,True)
SelectEvery(2,3)

Give that a whirl, should work ok.

To you Americans and such like, Mr Thornberry doesn't sound like any Brit's I know:) It's a lie, we arn't really that posh and drink tea. Please, tell all your friends, our image has been tarnished by the idea that we all speak like the Queen and hail to her, but if she came in my house for some food, I would get out the special cuttlery.


Sorry - that's like 3 posts in a row!

1loser
3rd February 2003, 08:29
Originally posted by dar1us
I assume this pattern could possibly continue, in AVISynth, use 'SelectEvery(2,3) to remove the bad frames. I think that will include frame 1, if it doesn't, simply add a blank frame (cant remember the command) at the beginning of the movie, or add frames until the SelectEvery works.I tried this and it didn't get rid of the bad frames:

AVISource("wild thornberry 1.18.3.avi").AssumeFPS(29.970,True)
c1=trim(334,15902).Reverse.FadeOut(30).Reverse.fadeout(15)
c2=trim(22078,36777).Reverse.FadeOut(15).Reverse.fadeout(15)
c3=trim(40684,51319).Reverse.FadeOut(15).Reverse.fadeout(30)
c4=BlankClip(60,640,480,"YUY2",29.970,1,48000,true,true,$000000)
c1 ++ c2 ++ c3 ++ c4
SelectEvery(2,3)
AssumeFrameBased().SeparateFields()

I changed trim(334,15902) to trim(335,15902) etc. and that didn't help

Neo Neko
6th February 2003, 21:30
Originally posted by 1loser
I tried this and it didn't get rid of the bad frames:

AVISource("wild thornberry 1.18.3.avi").AssumeFPS(29.970,True)
c1=trim(334,15902).Reverse.FadeOut(30).Reverse.fadeout(15)
c2=trim(22078,36777).Reverse.FadeOut(15).Reverse.fadeout(15)
c3=trim(40684,51319).Reverse.FadeOut(15).Reverse.fadeout(30)
c4=BlankClip(60,640,480,"YUY2",29.970,1,48000,true,true,$000000)
c1 ++ c2 ++ c3 ++ c4
SelectEvery(2,3)
AssumeFrameBased().SeparateFields()

I changed trim(334,15902) to trim(335,15902) etc. and that didn't help

you should selectevery(2,3) before you crop. Cropping alters the pattern.

video = AVISource("wild thornberry 1.18.3.avi").AssumeFPS(29.970,True).SelectEvery(2,3)
video = video.trim(334,15902).Reverse.FadeOut(30).Reverse.fadeout(15)+video.trim(22078,36777).Reverse.FadeOut(15).Reverse.fadeout(15)+video.trim(40684,51319).Reverse.FadeOut(15).Reverse.fadeout(30)+BlankClip(60,640,480,"YUY2",29.970,1,48000,true,true,$000000)
video = video.AssumeFrameBased().SeparateFields()
return video

dar1us
7th February 2003, 14:27
The only problem is that adverts may also alter the pattern aswell. They dont have dodgy frames like the cartoon.

It is a tough question really. Somebody - please explain why they are there in the first place, I guess that they are blend frames to make cartoons appear smoother:-
try a different decimation, or even an extended one (run another on the decimated material). every other of the remaining frames is motion here, so if you then do a SelectEven or SelectOdd in avisynth you will be left with only the useful frames. Then if you calculate the FPS it should run at, if it were pal, drom 25 to 12.5, for NTSC take your original framerate 29.97 and take away the frame every 5 frames removal, then divide it by 2, you should get something like 14. Then run it, dunno what will happen with the sound, it is early and I will play around tonite, with some captures of my own (I get the same problem under pal). <ME:)

But an actual definition would really help.

Karyudo
7th February 2003, 15:44
I think if you look up a few messages, you'll see one of my posts, which said:


I don't know for sure what sort of frame rate we're looking at here, but I think it's 30fps with animation done at only 12fps.


...which I'm more convinced than ever is the case. If you're producing some weekly animated series, and you want to cut costs, you're not likely to animate at a full 30fps or even 24fps; 12fps for this sort of thing is probably plenty. Not super-smooth or anything, but enough.

If that's the case, then once you telecine it, it'll look like the sample frames provided. Especially if, as 1loser says, you were to deinterlace on the fly.

Also, in theory, you'd have smoother frames (less broadcast noise) and better MPEG compression if you were to merge the two good copies of each frame and use each merged frame twice. There are threads here on how to go about that in AVISynth -- once again, beyond my knowledge of ASynth thus far!

dar1us
7th February 2003, 16:45
That's what I assumed. If only the dodgy frames were at regular intervals (on my TV network) - they are all over the place, I can't work out how to transfer the pattern into a frame removal on AVISynth (selectEvery...).

Again, MY good/bad pattern is...(g=good, b=bad)

GBGBGBGBGBBBBGGBGBGBBBGGGBGB

Anyone?

1loser
9th February 2003, 19:54
Originally posted by Neo Neko
you should selectevery(2,3) before you crop. Cropping alters the pattern.I assume you mean trim instead of crop. If I do that than the trim is of course now in all the wrong places. If I remove all the trims the problem is still there.

AVISource("wild thornberry 1.18.3.avi").AssumeFPS(29.970,True)
SelectEvery(2,3)

Neo Neko
9th February 2003, 20:03
The pattern itself may not actually change. If you are watching a broadcast of someone sitting in a chair relatively still there is almost no need to deinterlace it. Because all the frames will be almost exactly the same. And the fields will line up well. But the video "is" still interlaced. Likewise only if there is a large or long movement going on in you cartoon are you likely to notice the crappy telecine. A 12fps animation with frames doubled to 24 and telecined to 29.97 as mentioned will be a prime source of headaches. Instead of the small changes between frames of true 24fps material or the even smaller changes of 29.97fps material each frame at 12fps represents a large change in movement very often. Though with crappy nick toons quality telecine would be the least of my problems if I bothered with em. ;) I take it you do it for your kids though.

Neo Neko
9th February 2003, 20:05
Originally posted by 1loser
I assume you mean trim instead of crop. If I do that than the trim is of course now in all the wrong places. If I remove all the trims the problem is still there.

AVISource("wild thornberry 1.18.3.avi").AssumeFPS(29.970,True)
SelectEvery(2,3)

Yes I don't know why I said crop. If you will look in my AVS snippet there is no crop to be seen. Trim is indeed what I was wanting to say.;)