View Full Version : Encoding Selections
Vantage
21st July 2002, 00:15
Here is my problem: I'm encoding a bunch of TV episodes from a DVD as one big .avi file, and I need to separate the episodes in the very short time between when one ends and the next one begins. Gknot is usually pretty good about placing a key frame at the end of each episode but sometimes not. So, is there anyway to tell Gknot to encode 1 episode at a time and/or insert a keyframe in the correct place? Maybe something in the .avs script? Any help would be appreciated.
manono
21st July 2002, 00:56
Hi-
If you're using DivX 3.11, perhaps the easiest way is to manually insert the keyframes after the first pass, save the ECF, and then run the second pass, and split when done.
But since you didn't say whether you're using DivX 3.11 or DivX 5.02, I'll save the other ways until you let us know.
Vantage
21st July 2002, 05:24
Yeah, its the latest DivX 5 that I'm using.
manono
21st July 2002, 06:50
Hi-
Damn-now I gotta do some work. OK-if you still have the DVD, then decrypt by chapters. Say there are 4 episodes and 20 (or 21-the last will be a dummy) chapters, then each episode should consist of 5 chapters. That's one way.
Another way-Run the 2 passes on the whole thing. Reencode the places where the keyframes weren't set properly. Do a Trim command (more on that shortly) between 2 keyframes in the middle of which is the place where you want to cut. Set the maximum keyframe spacing at 10 frames and do a 1 pass quant 3 or something, and then do a cut and splice into the right position and cut. Make any sense?
Another is to use the Trim command four different times (for 4 episodes) in your .avs. Say there are 80,000 frames total and 20,000 in each episode. So you make an .avs with this at the end:
Trim(0,20000) and run the 2 passes. Then next you'll make another .avs with:
Trim(20001,40000), and so on. You can open the original .avs in VDub and figure out the frame numbers to put in. When you're all done encoding 4 different times, join them back together with the Append AVI segment command in VDub-Nandub, add the sound and split again.
And a more elegant way (but I'm not 100% sure that it will set the keyframes where you want, but I think it will) is do the previous process within 1 .avs.
Try this:
LoadPlugin("E:\DIVXST~1\GKnot\mpeg2dec.dll")
LoadPlugin("E:\DIVXST~1\GKnot\SimpleResize.dll")
mpeg2source("D:\Tillie's Punctured Romance\Tillie.d2v")
#do your IVTC or deinterlacing here if you aren't using Force Film.
Trim1=Trim(0,20000).crop(8,0,704,480).SimpleResize(512,384)
Trim2=Trim(20001,40000).crop(8,0,704,480).SimpleResize(512,384)
Trim3=Trim(40001,60000).crop(8,0,704,480).SimpleResize(512,384)
Trim4=Trim(60001,0).crop(8,0,704,480).SimpleResize(512,384)
Trim1+Trim2+Trim3+Trim4
#add more filters if you like down here
Like I said, I think that will set keyframes at the end of each Trim section, but I'm not positive. And I don't know of any way to tell for sure without running the 2 passes. Maybe the Log file will tell you after the first pass. Perhaps you can edit the log file manually after the first pass to put I frames (Keyframes) in there if they're not set in the right places. But that's over my head. Perhaps someone else knows for sure (hakko504, where are you?). Anyway-good luck.
Vantage
23rd July 2002, 03:41
Thanks for the help!
Tried the elegant method and that didn't work - produced the same keyframes as encoding the whole thing at once did. Currently experimenting with using multiple .avs scripts, trying to get the bitrate correct so the total is 1 CD worth of files
manono
23rd July 2002, 04:58
Hi Vantage-
I'm sorry to have wasted your time with that suggestion. I was going to try it myself the next time I had a bunch of anime episodes all run together in one set of vobs. Now I know. I have used the reencode, cut and splice method several times with success, but you have to keep careful track of all the pieces and frame numbers so you can get everything put back together properly. One advantage of it is that you will have equal quality among the episodes.
As for the other method, and getting equal quality among the episodes, and having the total come out to 1 CD: One way is to run a compression test on each of the 4 (or however many) episodes, set the file size for 175 MB for each (you'll have to estimate the audio-if total=100 MB, then 25 MB per episode), get the percentages for each episode, and then juggle bitrates-file size until the percentage for each episode is roughly the same. I've done it that way a bunch of times. Good Luck to you.
Vantage
24th July 2002, 01:03
Using a separate .avs script for each episode works well. The episodes vary in length greatly, so I used the bitrate to encode the entire DVD into a 1 CD as the bitrate for each episode encode. I set the bitrate in the 'calculate .avi file size' mode of Gknot and then made sure that it did not recalculate the bitrate anywhere along the line.
manono
24th July 2002, 07:10
Good-Glad it worked out for you. And I learned something too, even if you had to be the guinea pig for it.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.