[MPlayer-dev-eng] How to calculate pts with pulldown/telecine ?

Nico Sabbi nsabbi at tiscali.it
Sun Nov 21 19:55:10 CET 2004


Hi,
I have a serious desync problem when muxing (with my new mpeg muxer) 
switching framerate
content (VanHelsing in incoming) that mplayer reports with:


A:40672,9 V:40673,0 A-V: -0,121 ct: -1,525  31/ 28 194% 10%  3,4% 2 0
demux_mpg: 24fps progressive NTSC content detected, switching framerate.
A:40682,0 V:40682,0 A-V:  0,035 ct: -1,605 247/244 93% 10%  2,0% 2 0
demux_mpg: 30fps NTSC content detected, switching framerate.
Warning! FPS changed 23,976 -> 29,970  (-5,994000) [4]  0%  2,0% 2 0
A:40684,5 V:40684,5 A-V:  0,004 ct: -1,545 324/318 91%  9%  2,2% 25 0
demux_mpg: 24fps progressive NTSC content detected, switching framerate.
A:40687,4 V:40687,4 A-V:  0,035 ct: -1,511 395/388 90%  9%  2,2% 39 0
demux_mpg: 30fps NTSC content detected, switching framerate.
Warning! FPS changed 23,976 -> 29,970  (-5,994000) [4]  9%  2,2% 39 0
A:40688,9 V:40688,9 A-V:  0,000 ct: -1,460 441/429 90%  9%  2,1% 53 0
demux_mpg: 24fps progressive NTSC content detected, switching framerate.
[radeon] Restored overlay colorkey settings464/451 87%  9%  2,1% 55 0

(5 times in 10 seconds). The video sequence header in the video stream 
is always set
at 29.97 fps.

At the moment for every frame "n" I store the fps reported by mencoder 
(in this case
either 23.976 or 29.97) and in the demuxer I set the pts of frame "n+1" as

duration(n) = 1/fps(n)
pts(n+1) = pts(n)+duration(n)

but in this case I see that audio and video get quickly out of sync.


What's the right way to proceed? At the moment this is the last big 
problem of the muxer.

Thanks,
    Nico




More information about the MPlayer-dev-eng mailing list