Wrong Frame Rate In MKV Container When Checking FPS

Everything related to MakeMKV
Post Reply
dream88
Posts: 1
Joined: Thu Jun 30, 2011 8:58 am

Wrong Frame Rate In MKV Container When Checking FPS

Post by dream88 » Thu Jun 30, 2011 9:17 am

Hi

There is a problem with the reported frame rate of the container when i made an MKV of a dvd, the frame rate of the finished MKV is wrong, it is shown as 29.970fps when the actual correct frame rate is 23.976fps.

When i demux the video stream and query the demuxed video stream i get a report that shows 23.976fps which is correct.

If i played the 29.970fps MKV in a media player it will play correctly at 23.976fps but the problem occurs when using the 29.970fps MKV file because when queried it will report the wrong 29.970fps to any application.

So when i convert\encode the mkv with a 3rd party application i get a video that plays too fast because of MakeMKV error with the fps, i have to manually set the fps in the 3rd party application.

dpstjp
Posts: 44
Joined: Wed Dec 08, 2010 12:36 pm

Re: Wrong Frame Rate In MKV Container When Checking FPS

Post by dpstjp » Thu Jul 07, 2011 2:22 pm

Which DVD is this? What are you demuxing with?

It could be a pulldown flag in the video. MakeMKV does not strip pulldown flags out.

This is a problem for HD DVDs as well.

BlackDragon24
Posts: 120
Joined: Sun Mar 20, 2011 5:20 pm

Re: Wrong Frame Rate In MKV Container When Checking FPS

Post by BlackDragon24 » Thu Jul 07, 2011 4:12 pm

As far as I know, most NTSC DVD's are encoded at 29.970 fps. To get 23.976 requires applying a 3:2 pulldown on NTSC film (3 progressive frames followed by two interlaced frames) which takes the two interlaced frames, converts them to a progressive frame, and thus you get pulldown from 29.970 to 23.976 fps. The other way it could be encoded is with decimation, which simply adds duplicate frames (4 progressive frames followed by a duplicate frame.

Which DVD is it that you are trying to make an mkv for?

Romansh
Posts: 872
Joined: Sat Jan 22, 2011 7:09 pm

Re: Wrong Frame Rate In MKV Container When Checking FPS

Post by Romansh » Fri Jul 08, 2011 10:14 pm

BlackDragon24 wrote:As far as I know, most NTSC DVD's are encoded at 29.970 fps. To get 23.976 requires applying a 3:2 pulldown on NTSC film (3 progressive frames followed by two interlaced frames) which takes the two interlaced frames, converts them to a progressive frame, and thus you get pulldown from 29.970 to 23.976 fps. The other way it could be encoded is with decimation, which simply adds duplicate frames (4 progressive frames followed by a duplicate frame.

Which DVD is it that you are trying to make an mkv for?
3:2 pulldown (sometimes also referred to as telecine in this context) is the act of converting 23.976 fps progressive video to 29.97 fps, not the opposite. Most Hollywood films are encoded at 23.976 fps with pulldown flags; DVD players will follow the pulldown flags to convert it to 29.97 fps (unless "Progressive Scan" is enabled).

rogerdpack
Posts: 13
Joined: Tue Jul 05, 2011 8:05 pm

Re: Wrong Frame Rate In MKV Container When Checking FPS

Post by rogerdpack » Wed Jul 13, 2011 5:11 pm

BlackDragon24 wrote:As far as I know, most NTSC DVD's are encoded at 29.970 fps.
I think "most" NTSC DVD's are progressive (i.e. true 23.97 fps), and rely on the DVD player to convert them.


You can tell by running them in mplayer

http://www.mplayerhq.hu/DOCS/HTML/en/me ... ecine.html

If it says
demux_mpg: 24000/1001fps progressive NTSC content detected, switching framerate.

Then the DVD contains 23.97 fps frames, and lets the DVD convert them to 59.97 telecine for output to the TV. AFAIK.

rogerdpack
Posts: 13
Joined: Tue Jul 05, 2011 8:05 pm

Re: Wrong Frame Rate In MKV Container When Checking FPS

Post by rogerdpack » Wed Jul 13, 2011 5:13 pm

dream88 wrote: So when i convert\encode the mkv with a 3rd party application i get a video that plays too fast because of MakeMKV error with the fps, i have to manually set the fps in the 3rd party application.
VLC probably plays it fine, which would seem to imply that the 3rd party application isn't handling it quite right.
The real kicker is that some DVD's go from 29.97 telecine to 23.97 progressive *within the same title* so...I can't think of a way for makemkv to handle this except to stick with 29.97 fps and insert frames by timestamp, so it's relying on your player to know what to do there.

BlackDragon24
Posts: 120
Joined: Sun Mar 20, 2011 5:20 pm

Re: Wrong Frame Rate In MKV Container When Checking FPS

Post by BlackDragon24 » Wed Jul 13, 2011 8:02 pm

My point was that every single NTSC DVD I have ever ripped into mkv format with makemkv has given me a file with a video stream containing 29.970fps when looked at with mediainfo. When I re-encode them with another program that allows me to view the video frame by frame, I can literally see the duplicate and/or telecine frames and must run them thru an avisynth plugin to deinterlace them to get true 23.976 fps progressive output. Most DVD's I work with are TV shows and lots of them are older.

Some content ("The Wire" most recently comes to mind) has duplicate frames and telecine frames so it can be quite challenging to get true progressive video output.

rogerdpack
Posts: 13
Joined: Tue Jul 05, 2011 8:05 pm

Re: Wrong Frame Rate In MKV Container When Checking FPS

Post by rogerdpack » Wed Jul 13, 2011 9:16 pm

BlackDragon24 wrote: When I re-encode them with another program that allows me to view the video frame by frame, I can literally see the duplicate and/or telecine frames and must run them thru an avisynth plugin to deinterlace them to get true 23.976 fps progressive output. Most DVD's I work with are TV shows and lots of them are older.
Are you trying to convert your DVD's to 23.976 fps? If they are telecine then you'll be dropping frames to do that then? How do you hope to accomplish this?

-roger-

BlackDragon24
Posts: 120
Joined: Sun Mar 20, 2011 5:20 pm

Re: Wrong Frame Rate In MKV Container When Checking FPS

Post by BlackDragon24 » Thu Jul 14, 2011 12:17 am

rogerdpack wrote:
BlackDragon24 wrote: When I re-encode them with another program that allows me to view the video frame by frame, I can literally see the duplicate and/or telecine frames and must run them thru an avisynth plugin to deinterlace them to get true 23.976 fps progressive output. Most DVD's I work with are TV shows and lots of them are older.
Are you trying to convert your DVD's to 23.976 fps? If they are telecine then you'll be dropping frames to do that then? How do you hope to accomplish this?

-roger-
If it is NTSC film, then it is 3 progressive frames followed by 2 interlaced frames. So you can use software that will take the 2 interlaced frames and convert them to a progressive frame....which effectively eliminates one of the 5 frames so now you have 4 frames instead of 5. Which if you do the math:

4/5 = 23.976/29.970.

If they are decimated (4 progressive frames, 1 duplicate frame) then the software will just yank out the duplicate frames giving you the same result as above. 4/5 = 23.976/29.970.

rogerdpack
Posts: 13
Joined: Tue Jul 05, 2011 8:05 pm

Re: Wrong Frame Rate In MKV Container When Checking FPS

Post by rogerdpack » Thu Jul 14, 2011 3:36 pm

so makemkv bills itself as a "straight" copy so...it will include all the telecined frames by default. I guess you'll need to use another program to combine them I guess (mplayer pullup comes to mind).

BlackDragon24
Posts: 120
Joined: Sun Mar 20, 2011 5:20 pm

Re: Wrong Frame Rate In MKV Container When Checking FPS

Post by BlackDragon24 » Thu Jul 14, 2011 9:33 pm

rogerdpack wrote:so makemkv bills itself as a "straight" copy so...it will include all the telecined frames by default. I guess you'll need to use another program to combine them I guess (mplayer pullup comes to mind).
You only really need to worry about it if your are re-encoding. Most software and hardware based players take care of the extra frames for you.

Cheers

wmilas
Posts: 2
Joined: Thu Oct 13, 2011 4:19 pm

Re: Wrong Frame Rate In MKV Container When Checking FPS

Post by wmilas » Thu Oct 13, 2011 6:17 pm

I just joined the forum to talk about this very issue.

MakeMKV is definitely doing something wrong.... well not wrong, its just omitting the fps field inside of the header of the video stream. Certain applications such as VLC will calculate the correct FPS on the fly. If you play a DVD that MakeMKV has processed VLC reports under codec info that it is 30000/1001 fps but actually PLAYS it at 24000/1001 when it realizes that the frame count and total length don't add up to the supposed fps rate.

Other players are not that smart and happily play it at 30000/1001.

I ran into this issue last night and spent some time trying to figure out whats going on. I've been using MakeMKV for a while now instead of slysoft/BDClown because its just a nicer package. I've been processing mostly Blurays. This issue doesn't manifest itself with a Bluray. It pops up when dealing with mpeg2 content in a dvd.

What happened is I processed via MakeMKV then ran it through MeGUI. The output file was too short. After some quick math and looking at the mkv headers it dawned on me what was happening. Whats annoying is that you have to manually calculate what the correct FPS is and set it yourself which MakeMKV could easily do for you.

I'll post the logs of whats going on later tonight or tomorrow and propose a fix :)

mike admin
Posts: 3906
Joined: Wed Nov 26, 2008 2:26 am
Contact:

Re: Wrong Frame Rate In MKV Container When Checking FPS

Post by mike admin » Thu Oct 13, 2011 8:16 pm

wmilas wrote:I'll post the logs of whats going on later tonight or tomorrow and propose a fix :)
Please do, thanks!

wmilas
Posts: 2
Joined: Thu Oct 13, 2011 4:19 pm

Re: Wrong Frame Rate In MKV Container When Checking FPS

Post by wmilas » Wed Oct 19, 2011 3:01 pm

Site was down... I'll post them tonight.

Post Reply