View Full Version : Frame rates allowed in NTSC (& PAL) DVD-Video?
r0lZ
26th December 2012, 11:12
I have never really paid attention to the frame rate of the Titles in NTSC DVDs, but now, I have noticed that some NTSC titles are encoded at 23.976fps. At least, MkvMerge requires the "24000/1001p" frame rate to work properly, as otherwise, the audio is completely out of sync.
How is it possible to know (or compute) the right frame rate of a specific Title? As far as I know, it is not stored in the IFO.
In the VOB, there is a "frame rate code" in the MPEG sequence header (lower nibble of byte 3 of the Video Attributes). That value can theoretically be:
1 = 24000/1001
2 = 24
3 = 25
4 = 30000/1001
5 = 30
6 = 50
7 = 60000/1001
8 = 60
I guess that most of these frame rates cannot be used in a DVD-Video. What are the allowed frame rates for NTSC and PAL? If 24000/1001 fps is possible for NTSC, does that mean that 24 fps is also possible for PAL?
Also, it seems that even when a NTSC film is encoded at 24000/1001 fps, the frame rate code is still 4 (30000/1001 fps) in the VOB. Is it a bug in the VOB, or is it necessary to set the frame rate code to 4 anyway for NTSC video?
Since it seems impossible to trust that frame rate code, is it a better way to accurately determine the real frame rate?
mp3dom
26th December 2012, 14:16
The framerate is always 30000/1001 for NTSC and 25 for PAL.
You can get that framerate in different ways anyway:
You can for example encode the video at 23.98/24 and apply a soft-pulldown (RFF in the MPEG2) to get the 29.98 fps. You can also encode at 23.98/24 and soft-pulldown to 25 (euro pulldown with 2^12:3 pattern) and so on. As long as your file have a "final" framerate of 29.98 or 25 (NTSC/PAL) the file will be accepted for DVD-Video. You can also have a mix of both (23.98+soft-pulldown AND true 29.98i/p mixed together, or 24p+soft-pulldown and 25i/p mixed together). Try to index the MPEG with DGIndex and look at the film % you get. If it's not 100% film this means that some parts of your file are encoded at true 29.98 while the most are 23.98+pulldown. MKVMerge probably 'assumes' that your file have a fixed framerate... which is not true if it ignores the RFF flags.
r0lZ
26th December 2012, 14:48
OK, makes sense. Thanks.
One precision. RFF means Repeat First Field, right?
mp3dom
26th December 2012, 15:08
Exactly.
r0lZ
26th December 2012, 15:31
OK, thanks again.
BTW, it's not MkvMerge that causes the problem. It's x264. When the video is re-encoded, the h264 stream doesn't contain the frame rate, and it is necessary to specify it for MkvMerge. I'm trying to automate the re-encode and mux job, and I need to find the right frame rate. It is easy to deduce it by looking at the RFF flag in the first few frames of the VOB, but only if I can assume that the VOB contains only soft or hard-pulldown. The case of the mix of both is much more difficult to handle, and I don't know what frame rate I must specify in that case. I suppose that the mix of both is not frequent in commercial DVDs. Can you confirm that?
mp3dom
26th December 2012, 17:31
It's not frequent on movies, but it's frequent on anime. A lot of pre-HD24p digital anime (i mean, commercial R2J version) often switch from hard to soft pulldown (and viceversa). Basically because the editing is made at post-telecine stage (when it's already 60i hard-pulldowned) so at every scene-change the metrics (3:2 pattern) can change (and you can also have true 60i parts). When encoding from master (60i, on digital becatam) to MPEG-2, the mpeg encoder for efficiency reason, can do an IVTC. The detected IVTC is encoded at 23.98+softpulldown, while the non-detected IVTC is left as is, and encoded at 60i. This happens frequently at scene change.
TheSkiller
26th December 2012, 17:35
Here's a little more information on soft-pulldown. :)
The maximum amount of pulldown that can be applied is ⅓ of the output frame rate which is always fixed to either 25 or 29.97.
That means the "base" frame rate needs to be at least 16.66 fps for PAL and 19.98 fps for NTSC. The encoded base frame rate always needs to be lower than the output frame rate and the base video needs to be progressive.
Another important point for DVD compatiblity is, using pulldown requires the GOP length of the MPEG2 video to be shorter than the usual max GOP lengths which are 18 frames for NTSC and 15 frames for PAL. For the popular 3:2 pulldown used among NTSC compatible DVDs to store 23.976 film sources for example, the GOPs should be no longer than 12 frames.
In theory hard- and soft pulldown can be mixed wildly but hard-pulldown should always exhibit interlaced frames so if you don't see any interlaced frames after ignoring the soft-pulldown flags, it should be safe to assume there's no hard-pulldown left. I'm from a PAL country but I don't think there would be many examples where both types are actually mixed within a single titleset on a DVD.
r0lZ
26th December 2012, 17:52
I'm in PAL land too, and I hate NTSC for its infamous pulldown technique, absurd frame rates and bad colours. Anyway, I have understood how to determine precisely the "base frame rate", but the method requires some human analysis, such as looking for interlaced frames or using DGIndex. What I want to do is a fully automatic method, and it's not simple. But with your help, I have now a good idea of what to do, and I can start coding. In the beginning, I will assume that if there are RFF flags in NTSC material, the base frame rate is 24000/1001, and 24 for PAL. I will also ignore the constraints you have explained above (but thanks for the precision anyway). If I find a more complex DVD, I'll modify the code. Anyway, I can't test without a good example, so I must begin with the most simple cases, that I have here. I have verified, and it's the standard film to NTSC soft-pulldown (only), easy to process.
Thanks again.
filler56789
28th December 2012, 20:17
The maximum amount of pulldown that can be applied is ⅓ of the output frame rate which is always fixed to either 25 or 29.97.
That means the "base" frame rate needs to be at least 16.66 fps for PAL and 19.98 fps for NTSC. The encoded base frame rate always needs to be lower than the output frame rate and the base video needs to be progressive.
All right, however TMPGenc Plus does offer options to accept input framerates which are "integer submultiples" of the valid framerates (for example, 10fps somehow can be flagged as 30fps). How does it happen then? :confused:
TheSkiller
28th December 2012, 22:09
I'm quite sure TMPGenc simply converts the input frame rate to the requested output frame rate via frame-repetition or frame-dropping, like ChangeFPS(), and encodes the result. It most likely does not apply any pulldown flags at all in such case.
Like that, of course, any frame rate can be converted and be made DVD compatible. However, this method is not quite high quality.
sneaker_ger
1st January 2013, 15:51
BTW, it's not MkvMerge that causes the problem. It's x264. When the video is re-encoded, the h264 stream doesn't contain the frame rate, and it is necessary to specify it for MkvMerge.
As long as you encode in CFR mode, newer mkvmerge versions will auto-guess the used framerate automatically.
I wouldn't underestimate the NTSC mess, DVDs with hard or mixed pulldown do exist. And that's still easy - this forum is full of a lot of weird other stuff, like field blending conversions PAL<>NTSC.
r0lZ
1st January 2013, 16:05
Thanks for the precisions.
To encode in CFR, is it sufficient to specify --fps N, or should I also use --force-cfr ?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.