Log in

View Full Version : TV prog encoding - credits


aramo
27th July 2002, 09:56
I've done many film encodes with gknot and even edited the .avs file on occassion but I can't quite figure out how to deal with R2 Season 2 X-Files.

For ivtc/deinterlace I installed decomb3.91 and add the lines
LoadPlugin("C:\PROGRA~1\GORDIA~1\decomb.dll")
..crop line 700x576..pity about top black matt
Telecide(guide=2)
to the avs file is the best I can come up with after trying various deinterlace methods - this still leaves an occassional problem when camera is panning across an area with strong contasting regular shapes e.g. b&w photos with white borders on a dark table.

More importantly I could do with some guidance on how to efficently deal with the opening credits sequence which is gobbling up bytes - I'm currently seeing how going a split within dvd2avi so entire episode is split in two with the break at the end of the opening credits [is that the right name] just after "The truth is out there". At least I can then treat the opening credits as credits within gknot2.31. Current attempt ignores audio which I'll prepare via the command prompt and merge with ? vdub or nandub at the very end.

Target is 350MB/episode 512x384 ~125kBps video 96kbps audio, so saving 12MB or so withing the opening credits seems worth the effort.
Software gknot2.31 divx4.12 decomb3.91 xp-pro
Hardware P2-350 [ouch!] 512MB 50GB

theReal
27th July 2002, 12:24
Just make another avs file for the start-credits and use the trim(startframe,endframe) command (in analogy to what Gknot does if you save two avs files, one for the movie, one for the credits).

Use bilinear resizing for the credits and encode them at a high quantizer (27-31) to squeeze them as much as possible.

For ivtc, I just collected a few settings - some are from Gknot 0.26, some are from dedicated anime encoders of the doom forum :D.
Those seem to be quite good for different, complicated sources:

#Telecide()
#Decimate(cycle=5)
# or use
#InverseTelecine(32,11,110)
# or use
#InverseTelecine(60,11,110)
# or use
#InverseTelecine(44,11,95)
# or use
#GreedyHMA(1,0,4,0,0,0,0,0)


or use manual ivtc (be aware that the pattern might change throughout one episode, so it's quite hard to do...)

DoubleWeave()
#
# plus ONE of the following (depends)
#
#Pulldown(0,2)
#Pulldown(1,3)
#Pulldown(2,4)
#Pulldown(0,3)
#Pulldown(1,4)

aramo
28th July 2002, 02:22
thanks theReal, I'm unsure by what you mean by "Just make another avs file for the start-credits and use the trim(startframe,endframe) command" - do you mean from within gknot0.23b open the vobs in dvd2avi and select the 'open-credits'. I don't see how this on it's own will help make a single avi per episode. Using gknot to make 3 avis per episode [prologue, opening credits, main with end credits treated as credits] leads me into audio problems when I try to merge the pieces and it is tiresome to compute the various filesizes.

In the interim I've tested using gknot to make the follow from vobs
start.avi with opening credits treated as credits
end.avi with closing credits treated as credits
and then join the two using vdub and merge all.mp3 generated from the command line using azid and lame [versions in the gknot directory].

Unfortunately while the video is nice & clean the audio is seriously desync'ed, audio and video lengths seem to differ as well - young eyes/ears might be able to fix this in a few minutes but I've to squint and tilt for too long a time ;-| Now I remember why I liked gknot so much 1st time I used it!

Using an avi created using standard gknot approach [one credit seqeunce at the end, audio at --alt-preset cbr 96] I did the following
In nandub: save audio as all.wav
In nandub: split video into 3 parts prologue + opening credits + the rest
In vdub: fast recompress 'opening credits' @ 320kbps, high quants
In nandub: merge 3 video segments and interleave audio [import all.wav as type vbr mp3]

Using anything other than 'fast recompress' generated 24bit video avi which nandub/vdub will refuse to merge with other two video segments. Using vdub instead of nandub leads to async issues. I've looked at the final avi on 3 PCs and; despite vdubs warnings concerned fast recompress; it plays ok.

While I still can't figure out the trickery nandub performs on audio e.g. my cbr 96kbps get reported as 95kbps the above works, audio is sync'ed and I can shave about 10MB off the ~360MB avi. The whole process takes about 10 minutes (excluding the 12 hours it takes to generate the 1st avi :).

I've yet to determine if there is any benifit to altering the audio interleave settings from the defaults during the final nandub run - 320/320 does work. As I'm using the all.wav file outputted by nandub in the first step above [and inserted by gknot using nandub in the standard vob>avi process] I; thankfully; do not have to use any delay setting.

theReal
28th July 2002, 12:16
If select to encode the end credits seperately with Gknot, Gknot saves two .avs files which are encoded seperately.

In the one for the movie, you'll find a line like:

trim(0,24567)

which means this file goes from frame 0 to frame 24567.
Then, in the credits avs file, you'll find the line:

trim(24567,31456)

which means the credits are from frame 24567 to the last frame, 31456 in this case.

I suggested you just make a copy of the first file and change the trim values to (0,3000) - of course you have to know how long the start credits are to enter the correct frame.
Then, change the main avs to trim(3000,24567).
Now, you have three avs files which you can all encode seperately (now you can't encode them with the Gknot encoder-tab because you have two credits avs files and Gknot only has the option for one, but you have to set up the encoding jobs manually in VDub, or use "Jonny's Divx5enc" to do it).
When the encoding is done, you join the files in Nandub. To mux with the audio, you shouldn't run into problems when you have an mp3 file called "audio.mp3" and mux it using Nandub. I don't know why you get a .wav extension for the mp3 file created by Gknot - it should be an .mp3 extension, then you just add it as "(VBR) mp3" audio in Nandub.

So, I'd say make yourself acquainted with Avisynth and VirtualDub (the tools that Gknot uses for encoding). Open the avs files created by Gknot and see what it does, then you can change everything as you like.