View Single Post
Old 2008-09-17, 07:48   Link #224
Mentar
Banned
 
 
Join Date: Nov 2003
Location: Hamburg
Age: 54
Quote:
Originally Posted by Kristen View Post
I think that it is the entire episode that is in different frame rates. I looked at the timecode file (the one with lots and lots of numbers. I think this is v2?), and it has strange jumps in numbers at places throughout the entire thing.
This is one of the reasons why I'd strongly discourage using tools like these. Even if you feed a perfect CFR show into them, the resulting v1 turns into a jumble of crap (at least in those early days when I tested them when they popped up, and as far as I've heard, this fundamental problem hasn't changed). I'll never forget how perfect 29.97fps Elfen Lied footage produced a 200-liner v1 timecode file. Bah.

Realistically, I see two ways to do VFR:

1) The best one. You have a clean original source like DVD, BluRay or Transport Stream. Then you can use Yatta to properly mark VFR parts, and Yatta automatically generates the correct timecode files. Encode, mux and be happy.

2) The less-than-perfect one. You have a Non-CFR source of some kind. My recommendation: First, check the main footage of the episode if the animation is 23.976fps or 29.97fps (this will cover 99.999% of all cases unless the capper screwed up). Then, do a filtered CFR encode to lossless in Avisynth via directshowsource(convertfps=true) as base. Check OP and ED if they have differing framerates, and if they do, make seperate directshowsource(convertfps=true) encodes for them, aswell. And finally, write the timecode file manually. Yes, manually. Stop screaming, it's not so hard.

This is an example how it's done for a really nasty case: First, a 29.97fps OP, then 23.976fps episode, a 29.97fps ED and a 23.976 preview, like for example Rental Magica. We're going to do a dual release: Normal AVI for compatibility, and a VFR MKV release to be pretty.

First, make two Conversion scripts for 23.976 and 29.970 frames per second:

Quote:
Originally Posted by ConvertTo24.avs
directshowsource(fps=23.976,convertfps=true,"Raw.a vi")
Quote:
Originally Posted by ConvertTo30.avs
directshowsource(fps=29.970,convertfps=true,"Raw.a vi")
Load ConvertTo24.avs in vdub and write down the beginning/end cut points of OP/ED. Then add filtering, logos and Karaoke, and save the result as "OP-24fps-filtered.avi" lossless. Then, load ConvertTo30.avs and do the same - but you can omit writing down the cut points. They won't be needed later. Finally, load ConvertTo24.avs again and encode it _all_ to filtered lossless named "Episode-24fps-filtered.avi".

I recommend to keep the audio, since then you can make test encodes to check that the Karaoke is timed correctly (you can always work with "zeroed" Karaoke timing, which is useful, but sometimes you need to shift the kara 2-3 frames anyway).

Now it's time to "assemble" the parts we have. This is how it's done:

Quote:
op24 = Avisource("OP-24fps-filtered.avi") # OP cut out adjusted to 24fps for the AVI
op30 = Avisource("OP-30fps-filtered.avi") # OP cut out adjusted to 30fps for the VFR MKV
ep = Avisource("Episode-24fps-filtered.avi") # Reference episode encode in 24fps
ed24 = Avisource("ED-24fps-filtered.avi") # ED cut out adjusted to 24fps for the AVI
ed30 = Avisource("ED-30fps-filtered.avi") # ED cut out adjusted to 30fps for the VFR MKV
This would be the line for the CFR AVI:

Quote:
return op24.assumefps(23.976)\
+ ep.assumefps(23.976).trim(2500,31999)\ # the trim-numbers are the cut-points
+ ed24.assumefps(23,976)\
+ ep.assumefps(23.976).trim(34500,0) # the preview part
(You need the assumefps to make sure all video parts have the same framerate, or Avisynth will complain. It would be easier to add those in the Avisource-line directly, but it would have made things unreadable up there)

That's all you need for the AVI. Congrats, you're done. Now the VFR MKV on the same source:

Quote:
return op30.assumefps(23.976)\
+ ep.assumefps(23.976).trim(2500,31999)\ # the trim-numbers are the cut-points
+ ed30.assumefps(23,976)\
+ ep.assumefps(23.976).trim(34500,0) # the preview part
Just the same, only adjust op/ed24 to op/ed30. Not really hard, was it? Now all we need to do is write the timecode file manually, and we're done. To do that, we just need to open the VFR MKV script from above in Virtualdub and write down the _framenumbers_ of the cut points. The result will look like this:

Quote:
Assume 23.976
0,2449,29.97
32000,34499,29.97
Note that the cut points will be slightly different to the AVI version, because the OP and ED now have several extra frames (since they're 29.97 instead of 23.976). Therefore you MUST open and check the VFR MKV script and check there.

The result will be a 23.976 VFRAC video. Encode it any way you like, and then mux it with the manually written timecode file. Voila, CFR AVI and VFR MKV dual release!

Last edited by Mentar; 2008-09-17 at 13:49.
Mentar is offline   Reply With Quote