View Full Version : Hybrid DVDs
Djuby
22nd March 2004, 20:16
We all know that TV series DVDs (Stargate SG-1, Star Trek TNG and many more) have hybrid content, and it's really frustrating after encoding it to have that jerky playback. I have been experimenting a lot and finally reached a sweet spot for dealing with hybrids. I want to share it, 'cos I know it's really gonna save you guys a lot of time and nerves (if you have some left :-) ). So here it is:
LoadPlugin("Decomb511.dll")
Telecide(order=1,guide=1,post=0)
Decimate(mode=3,threshold=2.0)
As you can see I've used Decomb v.5.1.1
This works great with the Stargate SG-1 series. Any new ideas and suggestions will be greately appreciated.
Djuby
InfoCynic
23rd March 2004, 07:11
Rule #1: What works for one series almost universally does not work for another series. Try that on Star Trek: Voyager or Babylon 5 and you'll see.
Mode 3 is awful anyway... the motion doesn't stay smooth during the 30fps portions because mode 3 works like this:
say you have 2 cycles (10 frames) of video
ABCDE FGHIJ
these become
A[BC][DE]E F[GH][IJ]J
as if the transition from A to [BC] isn't bad enough, the transition from [DE] to E and F to [GH] to [IJ] to J gives you 2 bad transitions in every cycle.
Now if your VIDEO content is under 5% this might not be that bad. But it starts to get ugly pretty fast.
Djuby
23rd March 2004, 15:18
I agree with you, that it depends on the series. I am trying to find that sweet spot for the hybrids, which I thought I did. It's really hard. I am gonna continue the battle anyway. Any suggestions will be greately appreciated.
Does it really matter? Non-motion-compensated 30->24 looks bad, period. Having strange and/or changing decimation cycles can actually improve perceived smoothness. My question to you (InfoCynic) is, have you tried it yourself? What did your eyes say? This is simply a case of WFM. "Works For Me". Apparently, it works for Djuby, and because of that, he's sharing. What's with the shooting down of what might be a pretty good idea?
mf, slapping people in the face and removing the boxes around their minds since 1996.
gizmotech
23rd March 2004, 22:04
WFM is a good solution.
A better solution would be to see if you could poll the telecide information, and determine 30fps content via matching output. It would be a little complicated, but w/ some creative scripting it would be possible to determine 30fps live action content based on strings of CCCCC matching (perferably 25+ in a row, as most 30fps should last more then 30frames) and then do a VFR MKV w/ selective deinterlacing.
Who knows, a random application might have this support in the future. It should be relatively easy to code an app which takes telecide debug, finds C values, creates a complicated trim statement from a non decimate and a decimated clips, and then output a vfr file.
Gizmo.
InfoCynic
24th March 2004, 07:14
I spent 6 hours working on Voyager. I don't have SG1 handy to play with, but hey, I didn't totally pull this out of thin air. My best settings for Voyager are (Decomb 5.1.0, because .1.1 didn't exist when I started work and I don't like to change in the middle of a batch)...
Telecide(order=1,guide=1,gthresh=25,nt=30,post=0,show=false,hints=false)
Decimate(mode=1,quality=3,threshold=0.25,show=false)
The nt is flexible, it could maybe be lower, and the decimate threshold is probably a titch higher than it needs to be, but short of going across the entire thing looking for problems with the decimate thresh, I doubt I could do better. The redundant/default settings are there because I like to have them there to change them more easily if I need to. :)
Is the gthresh too high? Maybe. It's influenced by the nt for sure. With the default nt, you can't maintain a good pattern at all.
Voyager is complicated by the fact that some of their special effects are 3:2 pulldown, and some of them are not... on TNG and DS9, as I recall, the intros used 3:2 with special effects but the rest was 30. Late DS9 may have started using 3:2 for some effects as well... hard to say.
I looked into VFR matroska and determined that it was still way too much work... if somebody could make something that tied into Telecide's pattern guidance, it's usually possible, since Decomb 5, to get good pattern matching.... I doubt a good 30 to 24 fps solution will ever exist that works in one pass... it seems like you'd have to know how long the string is and convert it as a giant run instead of blocks of 5 to do anything good with it.
WorksForMe may be the way to go, but WorksForOne certainly doesn't mean WorksForAll. That was my point more than anything.
Originally posted by InfoCynic
WorksForMe may be the way to go, but WorksForOne certainly doesn't mean WorksForAll. That was my point more than anything.
And Djuby's point was that WorksForMe may mean WorksForSomeoneElse too. I think you scared him off in sharing settings that don't hurt to be shared.
Djuby
24th March 2004, 15:56
Hey guys, thanks for the replies. I really appreciate all the suggestions. I am still a bit confused on which mode to use. DVD2AVI reports 90% FILM content. Decomb's manual says that mode=3 is the way to go for clips with mostly FILM content, but then a lot of people are saying that mode=1 is better.
InfoCynic, I will try your settings on SG-1 and post the results.
Djuby
Djuby
25th March 2004, 22:25
InfoCynic, you did a great job. Your script worked perfectly on SG-1. Now I can see that mode=1 for Decimate is the way to go, even though Decomb's gude suggests to use mode=3 for mostly FILM content.
InfoCynic
26th March 2004, 06:18
No problem. Glad to help. The only series I've ever had luck with mode 3 in was X-Files, because the NTSC content is sparser... and by the later seasons of that show, it was starting to be upwards of 95% FILM anyway.
I have settings around here for B5 somewhere. I've played with DS9 and TNG too but never really liked what I got... I'd probably start with what I have there and tweak it again.
Djuby
26th March 2004, 15:14
@InfoCynic
Have you ever tried anything else except Decomb? I've heard of PerfectMotion software which can make a video playback very smooth.
Djuby
Originally posted by Djuby
Have you ever tried anything else except Decomb? I've heard of PerfectMotion software which can make a video playback very smooth.I've tried it on a simple short animation of a book opening. It was 30->24 so it didn't need to synthesize any missing frames, but it still managed to look really ugly. I'd say these DynaPel products are greatly overhyped on this forum, especially considering their worthless UI, instability and bad compatibility.
scharfis_brain
26th March 2004, 18:14
I think that Motionperfect would be really, really good, without its crappy GUI and incompatibilty to AVS.
mf, 30 to 24 fps should give a quiete nice result with MP, so I do not understand, what you want?!?
but do not feed MP with interlaced streams. It will mess up everything.
to convert a 30/24 - hybrid to 24p, you have to select the 30p scenes and convert them each alone to 24p.
THen realgin the original 24p-parts with the converted parts.
THis will give a nearly perfect hybrid to 24p conversion.
malkion
26th March 2004, 18:58
Djuby, I've been messing around and share a very similar script as yours. I use the following and try to fine tune the threhold without worry about too much about vthres or dthres, and let decomb do the deinterlacing itself.
telecide(order=1,guide=1,post=2).decimate(mode=3,threshold=x.xx)
the threshold usually ends up being around 1.00, give and take a little.
not sure if this will help you, since ivtc is such a pain.
Djuby
29th March 2004, 15:43
Hi guys,
I've been playing around for the last few days with Decomb and I think I got an AVS script for SG-1 that produces perfect results (IMO). Here it is:
Telecide(order=1,guide=1,gthresh=25,nt=40,post=0,show=false)
Decimate(mode=3,threshold=1.0,show=false)
I made two disks from the series and watched them. It looks great.
Thanks to InfoCynic for the increased nt parameter for maintaining a good 3:2 pattern. This script may be used for content with 90-95% of FILM, as SG-1 falls in the same limits. Very soon I'll be testing the script with Star Trek TNG and will post the results here.
Djuby
Originally posted by scharfis_brain
mf, 30 to 24 fps should give a quiete nice result with MP, so I do not understand, what you want?!?
I'd like it without the textures moving around like mad on perspective motion.
Here, have a look:
http://www.mufunyo.net/video/Yami_OP_TagON_xvid_mended.avi
phædrus
1st April 2004, 15:27
Originally posted by InfoCynic
Mode 3 is awful anyway... the motion doesn't stay smooth during the 30fps portions because mode 3 works like this:
say you have 2 cycles (10 frames) of video
ABCDE FGHIJ
these become
A[BC][DE]E F[GH][IJ]J
as if the transition from A to [BC] isn't bad enough, the transition from [DE] to E and F to [GH] to [IJ] to J gives you 2 bad transitions in every cycle.
Would it be really difficult to change the program so as to interpret these frame blends smoothly? For a cycle of five frames, if you interpolated A and B so that the new frame was weighted about 80% to A. Then interpolated B and C so it was weighted about 60% to B, and so forth (I have the exact percentages written down somewhere), you would get four frames [AB] [BC] [CD] [DE] that should have smooth motion. Mode 3, in the limited testing I've done, works great on the film parts, but the video part is indeed jerky. The answer is better interpolation of every 5 video frames into 4.
Now I confess I know nothing about interpolation theory or implementation or coding. But conceptually, this is what needs to be done. In the interpolation between the A and B frames, an object moving across the screen needs to appear closer to the A position than the B position. In the interpolation between the B and C frames, the object should appear almost exactly in between the B and C position, but a little closer to the position in B. In the [CD] interpolation, the object should be nearly in between the C and D positions, but a little closer to the D position. In the last interpolation in a five frame cycle, the [DE] frame should show the object much closer to the E position than the D position. When implemented properly, this would provide smooth motion of 30fps->24fps material.
Now, who has the smarts to actually do this? It would be a great service to the community. I don't even care if it reduces processing speed a lot. Time, I got. Jerky video, I cannot stand.
EDIT: Postscript: to clarify, I am talking about NTSC hybrid material like Star Trek and Babylon 5, which were mentioned. I think mode 3 is what we're talking about on those types of shows, if there is a lot of film content, and you want to reduce it all to 24 fps.
cweb
1st April 2004, 16:07
I think you're referring to the NTSC versions..
My PAL Stargate SG-1 dvd's didn't seem hybrid.. according to dvd2avi at least. The quality isn't that bad, too. It looks very good to me at least.
phædrus
1st April 2004, 21:59
I refer obviously to NTSC. But Star Trek and Babylon 5 were mentioned, and those are definitely hybrid -- which will be a problem whether it is PAL or NTSC I would think. I don't know about Stargate. I suspect some of the early shows may have been hybrid, as that seems to have been the standard for science fiction TV shows at the time.
tritical
2nd April 2004, 02:37
Actually, a much, much smoother way of blending together those ten frames (say ABCDE FGHIJ) is to do:
A [75% B 25% C] [50% C 50% D] [25% D 75% E]
F [75% G 25% H] [50% H 50% I] [25% I 75% J]
instead of:
A [50% B 50% C] [50% C 50% D] E
F [50% G 50% H] [50% H 50% I] J
as decimate currently does in mode 3. I coded up a little plugin that did just this a long time ago (when I still messed with doing special handling for hybrid content) and the difference was quite noticeable. As others have said though blend decimation isn't really the best way to handle it, but its better then nothing.
tritical
2nd April 2004, 08:33
I took a closer look at the source for decimate and it would be pretty easy to change the interpolation weights used for the blend decimation. I might hack up a quick test version tomorrow just to try out a few things... to see if it really is all that much better. The nice thing about the 75/25 and 25/75 blends are that they are still almost as fast to do in isse as the 50/50 is. You just need one more pavgb instruction.
phædrus
2nd April 2004, 14:10
tritical, this is interesting. Your system might just be sufficient to attain smoothness that is "good enough." I'm afraid I messed up my percentages on the frame interpolation. I don't know what I was thinking. I'll have to work it out all over again. :-(
But I do hope someone will come up with a solution someday that will give us at least smooth blending if not smooth interpolation.
EDITED: OK, my calculation is that for proper smooth blending or smooth interpolation of ABCDE FGHIJ to [AB][BC][CD][DE] [FG][GH][HI][IJ], the percentage weighting should be:
Frame [AB]= 88%A 12%B
[BC]= 62%B 38%C
[CD]= 38%C 62%D
[DE]= 12%D 88%E
repeat pattern for the next four frames.
Using 75/25 blend on the [AB] and [DE] frames, and 50/50 blend on the [BC] and [CD] frames is about 12% away from the optimum on each frame, but it might look very good. There must be some point at which the eye/brain will tolerate a bit of error, since taking 24frames of film content and telecining it does not result in perfect smoothness when played back on a TV set, either. Yet, it never seemed to bother me.
tritical
2nd April 2004, 18:44
Forgive my ignorance, but would you explain to me how you arrived at those numbers? I was assuming the only thing that you want to minimize to obtain smoothness is the abs() difference between step sizes between frames. i.e. with the blending pattern I described earlier the "theoretical" step size between the four new frames is always 1.25 and then the difference between step size is always 0. With your solution you obtain practically the same result (yours actually changes back and forth between 1.26 and 1.24) the only difference I can see is that yours starts on a blended frame, i.e. somewhere between frame A and B. I'm not sure that made any sense, but here is what I was thinking (again the ABCDE FGHIJ K scenario)...
A B C D E F G H I J K = frame
0 1 2 3 4 5 6 7 8 9 10 = point
d = difference between previous p and p
dd = abs() difference between d and previous d
[100%A 0%B] p = 0.0
[75%B 25%C] p = 1.25 d = 1.25
[50%C 50%D] p = 2.50 d = 1.25 dd = 0
[25%D 75%E] p = 3.75 d = 1.25 dd = 0
[100%F 0%G] p = 5.00 d = 1.25 dd = 0
[75%G 25%H] p = 6.25 d = 1.25 dd = 0
[50%H 50%I] p = 7.50 d = 1.25 dd = 0
[25%I 75%J] p = 8.75 d = 1.25 dd = 0
[100%K 0%L] p = 10.0 d = 1.25 dd = 0
and your solution, comes out with pretty close to the same numbers, just it starts at 0.12 and not 0.00...
[88%A 12%B] p = 0.12
[62%B 38%C] p = 1.38 d = 1.26
[38%C 62%D] p = 2.62 d = 1.24 dd = 0.02
[12%D 88%E] p = 3.88 d = 1.26 dd = 0.02
[88%F 12%G] p = 5.12 d = 1.24 dd = 0.02
[62%G 38%H] p = 6.38 d = 1.26 dd = 0.02
[38%H 62%I] p = 7.62 d = 1.24 dd = 0.02
[12%I 88%J] p = 8.88 d = 1.26 dd = 0.02
[88%K 12%L] p = 10.12 d = 1.24 dd = 0.02
My next question is why did you pick 88-12, 62-38, 38-62, 12-88...
and not 88-12, 63-37, 38-62, 13-87? Again, sorry if the answer is obvious to everyone but me. But now you've got me really interested in this :p.
EDITED (third times a charm):
Here are the numbers for the current blending scheme decimate uses...
[100%A 0%B] p = 0.00
[50%B 50%C] p = 1.50 d = 1.5
[50%C 50%D] p = 2.50 d = 1.0 dd = 0.5
[0%D 100%E] p = 4.00 d = 1.5 dd = 0.5
[100%F 0%G] p = 5.00 d = 1.0 dd = 0.5
[50%G 50%H] p = 6.50 d = 1.5 dd = 0.5
[50%H 50%I] p = 7.50 d = 1.0 dd = 0.5
[0%I 100%J] p = 9.00 d = 1.5 dd = 0.5
[100%K 0%L] p = 10.0 d = 1.0 dd = 0.5
phædrus
4th April 2004, 14:18
Originally posted by tritical
Forgive my ignorance, but would you explain to me how you arrived at those numbers? I was assuming the only thing that you want to minimize to obtain smoothness is the abs() difference between step sizes between frames. i.e. with the blending pattern I described earlier the "theoretical" step size between the four new frames is always 1.25 and then the difference between step size is always 0. With your solution you obtain practically the same result
I'm glad you asked. OK, first, how did I get the numbers I got? I approached it empirically, with a ruler and a piece of paper, and imagined at what position an object moving left to right over the course of ten frames ought to be in eight frames versus ten. I came up with a step of 1.25 times the motion that occured between two frames in a 30fps series, just as you did. I just figured this out by measuring with a ruler, and determining the percentages that way. (and I rounded the numbers to two places, which is why the percentages I gave are not exactly 1.25 times the difference) For the first interpolation it should be 7/8 to 1/8. Which is more precisely 87.5% to 12.5%, I think. And so on.
I see now that you have accomplished the same thing by shifting your starting point. Somehow, quickly glancing at your percentages, I thought apparent motion would be a bit more between some frames than others, but that was wrong. Your system would provide smooth apparent motion with a good interpolation algorithm.
Your system is better than mine in this respect: you would only need to make calculations to blend or interpolate 3 frames in a 5-frame cycle, versus interpolating four frames with mine.
I see one theoretical disadvantage. If you are blending, you will have one clear frame, followed by three somewhat blurry blended ones, if I understand how blending works. Is that correct? Whether this looks bad in practice, I wouldn't know. (I know that when I keep the frame rate at 30fps and then the film parts of a hybrid program have some frames that are deinterlaced by blending two mismatched fields, and some that are clean, it looks bad.)
If you are interpolating, and the interpolation is very good, so that it can draw very accurate and clean interpolations between two frames, then the interpolated frames [BC][CD][DE] should look about as good as the non-interpolated frames [A] and [F].
Using my percentages, all frames would be blended, and so the quality might be more similar (all somewhat blurry) from frame to frame. Whether this makes a difference in practice I can't say.
Now, the only question left is the effectiveness of implementation. Do you have sample clips I could upload to see the effect of your modification? If it looks really good, then I might beg you to help me implement it in my own system. :-) (I'm not very confident at messing with scripts yet, beyond modifying them a bit in DVD2SVCD to change the mode in Telecide/decimate.)
Mephiston
12th April 2004, 13:48
Hey everyone,
Just curious if anyone has tried anything with Star Trek TNG yet.
Got season 1 for christmas and need to back it up, still learning about Telecide & Decimate though and havn't gotten very good results.
phædrus
15th April 2004, 18:26
Originally posted by Mephiston
Hey everyone,
Just curious if anyone has tried anything with Star Trek TNG yet.
Got season 1 for christmas and need to back it up, still learning about Telecide & Decimate though and havn't gotten very good results.
I truly think the best bet with those Trek DVDs is to keep them interlaced at the original frame rate. Wait, are you talking NTSC or PAL? PAL, I have no experience with.
For NTSC Babylon 5, I could not find anything that worked very well, unless I chopped the sides of the frame off, and encoded the middle of the frame as 4:3 aspect ratio, kept the interlacing at 30fps, and used 4 passes with CCE to make a nice SVCD. This is pretty much the way they were played on television anyway. Babylon 5 was shown widescreen in Europe, but in USA syndication, they were 4:3 aspect ratio.
since ST-TNG is already 4:3, you don't even need to mess with cropping the frame. Of course, you can try all sorts of other permutations to get results that will be superior in some respects, and worse in others. For me, there is always an element of jerkiness in the motion that is introduced, unless one keeps the original fields intact, i.e. keep it interlaced.
I haven't done any ST-TNG yet, but this is what I'm going to try when I do.
phædrus
15th April 2004, 18:34
Originally posted by Mephiston
Hey everyone,
Just curious if anyone has tried anything with Star Trek TNG yet.
Got season 1 for christmas and need to back it up, still learning about Telecide & Decimate though and havn't gotten very good results.
Also, check out this thread:
http://forum.doom9.org/showthread.php?s=&threadid=59767&highlight=hybrid+dvds
cheapredwine says just what I said. leave it interlaced. another user says keep it at 30fps and use TomsMoComp. You can read as they duke it out. :-)
Djuby
15th April 2004, 19:56
@phædrus
I've been messing around with Star Trek TNG and so far have found nothing that will not produce jerkiness in the playback. If you search Doom9 forums you will find that some people are working on automated IVTC (reversing the Telecining). You can also find AVS scripts that are very close to perfect IVTC, but what may work for one episode could be really bad for other. Until the day comes when hybrid content can be IVTCed correctly I suggest that you use tools like Pinnacle's Instant Copy. TNG is 4x3 format so you almost won't have the undersizing problems. Once you get a handle of it, it produces pretty good results. I'm currently giving a try to a new tool called DVD-RB. Check it out at: http://forum.doom9.org/showthread.php?s=&threadid=73051
resonator
16th April 2004, 18:13
Originally posted by phædrus
For NTSC Babylon 5, I could not find anything that worked very well, unless I chopped the sides of the frame off, and encoded the middle of the frame as 4:3 aspect ratio, kept the interlacing at 30fps, and used 4 passes with CCE to make a nice SVCD. This is pretty much the way they were played on television anyway. Babylon 5 was shown widescreen in Europe, but in USA syndication, they were 4:3 aspect ratio.
At first it was shown only in 4:3 here in Europe, and when TNT made their widescreen version the (16:9 crazy) BBC aired it in the UK, but most of Europe still has the 4:3 version on tv today. (The DVDs are obviously in 16:9)
And if you crop the sides of the 16:9 version you'll crop the sides of every FX-scene too, which is a bad idea because on DVD they are already cropped on the top.
http://www.cs.tut.fi/~leopold/Babylon5/DVD/DVDTransfer.html
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.