View Full Version : Impossible clips (both telcined film and true interlaced video mixed)


Stereodude
28th December 2002, 17:43
I have some clips of a TV show that I capped.

Part of the show is telcined film and part is true 29.97fps interlaced video (meaning an IVTC doesn't work). Essentially one of the cameras was film while the rest were video. So the style of footage changes pretty frequently.

According to decomb I should use Telcide() and decimate(mode=1). That makes the stuff shot on film look fine, but the stuff shot on video that is truely interlaced looks a little iffy. I've tried every trick I know and I would rather not do a "blend" on the whole clip.

What other options do I have?

Stereodude

Guest
28th December 2002, 17:54
Originally posted by Stereodude
According to decomb I should use Telcide() and decimate(mode=1). That makes the stuff shot on film look fine, but the stuff shot on video that is truely interlaced looks a little iffy. I've tried every trick I know and I would rather not do a "blend" on the whole clip.
Mode 1 with the right threshold should not make the interlaced parts "iffy".

I am working on a new solution where the interlaced parts are decimated to 24fps as would be done by ConvertFPS(), while the film parts are IVTC'ed normally. Look for a new release of Decomb to have that soon.

Stereodude
28th December 2002, 19:23
Originally posted by neuron2
Mode 1 with the right threshold should not make the interlaced parts "iffy".

I am working on a new solution where the interlaced parts are decimated to 24fps as would be done by ConvertFPS(), while the film parts are IVTC'ed normally. Look for a new release of Decomb to have that soon. Well I guess I should clarify. There isn't a whole lot of motion in parts of the clip, so what happens is during the true interlaced part of the clip (virtually no motion) when ideally I would like decimate to leave those frames alone it creates new frames that reduce the sharpness of the clip. The problem is those frames are too similar to the repeated frame you get from telecide.

I think I found away around it though. It's rather time intensive though. I'll post the script. Essential I'm only processing the "FILM" sections of the clip in telecide and decimate now. Crude, but it works.
LoadPlugin("c:\HDTV Tools\mpeg2dec\MPEG2DEC3.dll")
LoadPlugin("c:\HDTV Tools\decomb\decomblegacy.dll")
v1=mpeg2source("d:\faith\faith_01.d2v",idct=5,cpu=4,
iPP=true,moderate_h=20,moderate_v=40)

v2=trim(v1,0,1292)
v3=telecide(v2)
v4=decimate(v3,mode=1,quality=3)
v5=SeparateFields(v4)
v6=SelectOdd(v5)

v12=trim(v1,1293,8438)
v13=SeparateFields(v12)
v14=SelectOdd(v13)

v22=trim(v1,8439,9876)
v23=telecide(v22)
v24=decimate(v23,mode=1,quality=3)
v25=SeparateFields(v24)
v26=SelectOdd(v25)

v32=trim(v1,9877,10021)
v33=SeparateFields(v32)
v34=SelectOdd(v33)

v42=trim(v1,10022,10167)
v43=telecide(v42)
v44=decimate(v43,mode=1,quality=3)
v45=SeparateFields(v44)
v46=SelectOdd(v45)

v52=trim(v1,10168,11367)
v53=SeparateFields(v52)
v54=SelectOdd(v53)

v62=trim(v1,11368,11684)
v63=telecide(v62)
v64=decimate(v63,mode=1,quality=3)
v65=SeparateFields(v64)
v66=SelectOdd(v65)

v72=trim(v1,11685,12636)
v73=SeparateFields(v72)
v74=SelectOdd(v73)

v82=trim(v1,12637,13023)
v83=telecide(v82)
v84=decimate(v83,mode=1,quality=3)
v85=SeparateFields(v84)
v86=SelectOdd(v85)

v92=trim(v1,13024,13902)
v93=SeparateFields(v92)
v94=SelectOdd(v93)

v102=trim(v1,13903,13968)
v103=telecide(v102)
v104=decimate(v103,mode=1,quality=3)
v105=SeparateFields(v104)
v106=SelectOdd(v105)

v112=trim(v1,13969,14189)
v113=SeparateFields(v112)
v114=SelectOdd(v113)

v122=trim(v1,14190,14700)
v123=telecide(v122)
v124=decimate(v123,mode=1,quality=3)
v125=SeparateFields(v124)
v126=SelectOdd(v125)

final=crop(v6 + v14 + v26 + v34 + v46 + v54 + v66 +v74 + v86 + v94 +
v106 + v114 + v126, 4, 0, -6, -6)
return (final)

This would have been really simple if NBC didn't swap field order several times during the show. Then I could have just dropped all the odd (or even depending on their order) fields.

Stereodude

Guest
28th December 2002, 20:01
There's no need to do it with scripting. Decomb's manual control is easier. For example, to pass through untouched a section of interlaced video, you can use this override file:

200,750 c
200,750 -

That would totally pass through frames 200 through 750. To leave the original field matches but apply deinterlacing:

200,750 c
200,750 +

But anyway, you are always throwing away a field. What is the point of applying Telecide? Throwing away a field is guaranteed to decomb anything. :)

Stereodude
28th December 2002, 20:05
Here's an example of what I'm talking about. The difference in the two frames was a metric of .20% There are frames that are really identical in the telcined portion of the video that have a higher metric, so I can't fix the issue with the threshold.

These are all the same 3 frame numbers (2003, 2004, 2005)

[Sorry, you'll have to click the links. I didn't know image tags didn't work when I wrote the post.]

http://stereodude.cjb.net:900/faith_normal_01.jpg
"Raw" footage

http://stereodude.cjb.net:900/faith_decimate_01.jpg
Footage after telecide and decimate

http://stereodude.cjb.net:900/faith_normal_02.jpg
End footage (from RAW) after discard 2nd field, and resize (blown up 200%)

http://stereodude.cjb.net:900/faith_decimate_01.jpg
End footage (from telecide and decimate) after resize (blown up 200%)

You should be able to see the blending in the one that has been run through telecide and decimate. Look specifically at her eyes and the area around the drummer's drum stick. In some scenes the blending causes is far more pronouced (I'll try to find an example and it causes motion to look jerky at times. It also looks a little odd when you get slightly blurier frames every so often.

Stereodude

Guest
28th December 2002, 20:08
OK, I see now. Thank you for the data. I am working in this area right now and your report is valuable to me.

But still, aren't you throwing away the even fields? If so, why bother with Telecide?

Stereodude
28th December 2002, 20:11
Originally posted by neuron2
But anyway, you are always throwing away a field. What is the point of applying Telecide? Throwing away a field is guaranteed to decomb anything. :) NBC changed the field order all over the place (inside the telcine'd sections). As a result if you always pick odd sometimes you get repeated frames, sometimes you get 29.97 unique frames a second. So I had to do the telecide to get rid of the repeated frames that occured some of the time when the field order was inverted.

When I originally processed this I did not discard half the fields. I only did a resize. I am discarding half the fields now because I do not want to do a blend de-interlace on the interlaced portion of the video and I can't come up with any other way to make sure all the sections return the same size video (I greatly dislike AVIsynth's resizing in YUY2 mode, and the fact that it's about 4x as slow as VirtualDub in RGB mode)

Stereodude

Guest
28th December 2002, 20:15
Thanks, great info, much appreciated.

I am working in just this area now and hope to have a better solution soon.

Stereodude
28th December 2002, 20:22
Neuron2,

You're welcome.

I take your earlier comment to mean that I could handle this video differently as well? I could do a decimate mode=0 and then use ConvertFPS() to change the interlaced portion to 23.976fps?

I think that might cause problems where I switch "methods" in the script though. What do you think?

Stereodude

Guest
28th December 2002, 20:31
Originally posted by Stereodude
I take your earlier comment to mean that I could handle this video differently as well? I could do a decimate mode=0 and then use ConvertFPS() to change the interlaced portion to 23.976fps?
No, because Decimate already changes everything to 23.976.

When using a method that leaves it at 29.97, we want to do the blends as with mode=1 but restrict it to film portions (those in an active pulldown pattern).

When using a method that leaves it at 23.976, we want to treat the film portions as normally (IVTC), and apply a blend decimation to the non-film portions (as done by ConvertFPS when going 30->24).

I am making a version of Decomb that supports both of these.

Stereodude
28th December 2002, 22:49
Originally posted by neuron2
There's no need to do it with scripting. Decomb's manual control is easier. For example, to pass through untouched a section of interlaced video, you can use this override file:

200,750 c
200,750 - Thanks for this tip. I did the 2nd section of the show this way and it was a lot easier.

Stereodude

Stereodude
28th December 2002, 22:52
Originally posted by neuron2
No, because Decimate already changes everything to 23.976.

When using a method that leaves it at 29.97, we want to do the blends as with mode=1 but restrict it to film portions (those in an active pulldown pattern).

When using a method that leaves it at 23.976, we want to treat the film portions as normally (IVTC), and apply a blend decimation to the non-film portions (as done by ConvertFPS when going 30->24).

I am making a version of Decomb that supports both of these. I mean in my scripted version. Only for the portions that I'm not applying the decimate to, but now I see that this method involves blending, so I guess I'll pass.

Stereodude

Stereodude
29th December 2002, 09:43
Originally posted by Stereodude
Thanks for this tip. I did the 2nd section of the show this way and it was a lot easier.

Stereodude Actually after look closer this isn't any real help. Unfortunately the same manual control script doesn't work for decimate. There is no way to force decimate to steer clear of said frames. Decimate's overide control only allows you to target certain frames for removal which is not what I'm looking to do. It seems I have to do it in long scripting form.

Stereodude

Guest
29th December 2002, 17:35
I have just put a version of Decomb here that might help you:

http://forum.doom9.org/showthread.php?s=&postid=231943#post231943

It will allow you to avoid getting the blends on your video segments. Please advise if this helps your situation.

Just set guide=1 and be sure that Decimate immediately follows Telecide in the script.

Stereodude
29th December 2002, 19:22
Originally posted by neuron2
I have just put a version of Decomb here that might help you:

http://forum.doom9.org/showthread.php?s=&postid=231943#post231943

It will allow you to avoid getting the blends on your video segments. Please advise if this helps your situation.

Just set guide=1 and be sure that Decimate immediately follows Telecide in the script. Don,

I'm still using AVIsynth 2.07, so I'm not able to get the plugin to work. I can't seem to find a compile of v2.5 (at least a free one). If you can point me in the right direction I'll be happy to try this new version of decomb out.

Stereodude

Edit: Ok, I found a link in the sticky http://cultact-server.novi.dk/kpo/avisynth/avisynth_alpha.html , but the site it points to is down. Is there someplace else to get it?

Guest
29th December 2002, 19:31
I'm attaching the 12-17 build.

Stereodude
29th December 2002, 20:46
Don,

Is this what you meant?LoadPlugin("c:\HDTV Tools\mpeg2dec\MPEG2DEC3_2.5.dll")
LoadPlugin("c:\HDTV Tools\decomb\Decomb_406b2.dll")
mpeg2source("d:\faith\faith_04.d2v",idct=5,cpu=4,iPP=true,moderate_h=20,moderate_v=40)
Telecide(guide=1,ovr="faith_04.ovr")
Decimate(mode=1,quality=3,show=true)I think there is a problem.

Here is beginning of the .ovr file. It is in the same directory as the avs file also.811,845 c
811,845 -
972,7707 c
972,7707 -
8399,8538 c
8399,8538 -
8781,8882 c
8781,8882 -
8930,8963 cHere's frame 1015 http://stereodude.cjb.net:900/frame_1015.jpg

Unless I'm mistaken it shouldn't be doing anything to frame 1015 because telecide is told to leave it alone and decimate should be getting a flag from telecide to ignore it. Correct?

Stereodude

Guest
30th December 2002, 06:13
Your link is broken so I have no idea what your current problem is.

What I gave you is controlled by Telecide's decision about whether a frame is part of a 3:2 sequence (film) or is not (video). Regions believed to be video will not get the blending of Decimate(mode=1), regardless of its threshold. This should greatly improve the situation regarding your original complaint, which was that video sections were being blended by Decimate(mode=1). You won't need an overrides file; it will be done automatically.

If you are reporting a different problem now, please explain it clearly in text, or directly attach your jpegs. Thank you.

Guest
30th December 2002, 06:22
OK, I tried to guess what the JPEG would show. :)

Let's suppose it shows a blended frame from a range you told Telecide() to ignore. It can only be that Telecide thought it was a film frame.

How about this...? Can you make available the clip that shows the problem, I can work directly on it. I am keen to get it as handling of hybrid material desperately needs better solutions. Please advise.

scmccarthy
30th December 2002, 07:38
@neuron2

Sh0dan already posted a newer version of AviSynth 2.5a in this thread:
http://forum.doom9.org/showthread.php?s=&threadid=41584 (forum.doom9.org/showthread.php?s=&threadid=41584)
Stephen

Stereodude
30th December 2002, 08:09
Originally posted by neuron2
OK, I tried to guess what the JPEG would show. :)

Let's suppose it shows a blended frame from a range you told Telecide() to ignore. It can only be that Telecide thought it was a film frame.

How about this...? Can you make available the clip that shows the problem, I can work directly on it. I am keen to get it as handling of hybrid material desperately needs better solutions. Please advise. I fixed the link.

You are correct. Decimate blended a frame that telecide was told to ignore. How can that happen if telecide isn't processing those frames. What is seeding decimate with "hints"?

It would seem that if decimate is being seeded by values from telecide, and telecide is ignoring the frames, it should be telling decimate to pass the frames unaltered. Which brings up the question of why decimate is blending them.

I'll be more than happy to provide you a nice test clip. They're not small though. How would you like it delivered?

Stereodude

Guest
30th December 2002, 18:39
Originally posted by Stereodude
You are correct. Decimate blended a frame that telecide was told to ignore. How can that happen if telecide isn't processing those frames. What is seeding decimate with "hints"?Telecide is sending a flag with each frame marking it as film or video. Decimate looks at it and avoids blending frames marked as video. But the video/film detection is not perfect and indeed I am working on improving it.

It would seem that if decimate is being seeded by values from telecide, and telecide is ignoring the frames, it should be telling decimate to pass the frames unaltered. Which brings up the question of why decimate is blending them.Decimate is blending them because they are detected as film frames.

I agree that when you tell Telecide to pass through a frame unchanged then Decimate should honor that. I will work out a solution for that and post it shortly.

I'll be more than happy to provide you a nice test clip. They're not small though. How would you like it delivered? No need, but thanks. I think I understand what is going on from what you've said.

Guest
30th December 2002, 20:04
OK, here's a new Decomb beta (4.06 beta 3) to try, StereoDude.

It adds a new override for Telecide: 'x'. It means to match to current and consider the frame as video. That will force Decimate not to blend the frame when in mode=1. You'd say this to get a clean, nonblended range:

300,500 x

You can add overrides for the deinterlacing as desired. E.g., to get completely untouched frames, use:

300,500 x
300,500 -

Please let me know your results.

Stereodude
31st December 2002, 15:59
Originally posted by neuron2
OK, here's a new Decomb beta (4.06 beta 3) to try, StereoDude.

It adds a new override for Telecide: 'x'. It means to match to current and consider the frame as video. That will force Decimate not to blend the frame when in mode=1. You'd say this to get a clean, nonblended range:

300,500 x

You can add overrides for the deinterlacing as desired. E.g., to get completely untouched frames, use:

300,500 x
300,500 -

Please let me know your results. Don,

I'll try this out a little later today. The machine I do all my work on was down last night while I installed the water cooling setup on it. Later today I'll see how the new version works.

Stereodude

scmccarthy
31st December 2002, 16:46
Water cooling unit? Boy, oh boy, you really have it good in Detroit, don't you?

Stereodude
31st December 2002, 19:11
Originally posted by scmccarthy
Water cooling unit? Boy, oh boy, you really have it good in Detroit, don't you? What do you mean? I wanted my new PC to be quiet and I wanted to overclock it, so my only options were water cooling or a phase change setup. I didn't feel like spending $600 on a Vapochill, or even more on a Prometia, so I got a watercooling setup.

Stereodude

scmccarthy
31st December 2002, 22:21
Oh of course, I forgot what a water cooler setup was. It is for the CPU if you overclock it. Much more effective and quieter that a fan.

I temporarily lost interest in over-clocking now that I have a 1.79 GHz Pentium4. Even though there are already much faster CPUs.

Stephen

Stereodude
2nd January 2003, 02:02
Originally posted by scmccarthy
Oh of course, I forgot what a water cooler setup was. It is for the CPU if you overclock it. Much more effective and quieter that a fan.

I temporarily lost interest in over-clocking now that I have a 1.79 GHz Pentium4. Even though there are already much faster CPUs.

Stephen Yeah, I didn't OC my AMD 1.4 at all. The new machine is super quiet. It's erie how silent it is.

I've also found that CCE has issues with really fast CPUs.

Don,

I'll try to get you some results within the hour. I was trying to clear a backlog of transport file out.

Stereodude

Stereodude
2nd January 2003, 02:26
Don,

The new beta 4 doesn't work correctly. Using it telecide(mode=1) never blends anything. It follows the .ovr file loaded into telecide. That's good, but it doesn't replace the duplicated frame (from telecide) with a blended one either. The duplicated frame just passes through. In a given section of my test clip which has over 600 telcine'd frames in a row (7708 to 8398) it didn't blend any of them.

Here's the scriptsLoadPlugin("c:\HDTV Tools\mpeg2dec\MPEG2Dec3_2.5.dll")
LoadPlugin("c:\HDTV Tools\decomb\decomb_406b4.dll")
mpeg2source("d:\faith\faith_04.d2v",idct=5,cpu=4,iPP=true,moderate_h=20,moderate_v=40)
Telecide(guide=1, ovr="faith_04.ovr",show=true)
Decimate(mode=1)
ConvertToRGB()811,845 x
811,845 -
972,7707 x
972,7707 -
8399,8538 x
8399,8538 -
8781,8882 x
8781,8882 -Stereodude