[Ffmpeg-devel] Calculating PTS Times

Colin Ward lists
Fri Oct 21 02:00:59 CEST 2005

  Hi all.

  I wonder if some kind soul could help me with my PTS calculations.  It
seems that this is an area of confusion for many people.  Take a look at
the attached snippet of code.  It is a simplified piece of code from my
media player which decodes a video frame and calculates its PTS.  As you
can see, it contains logic to both extract the PTS both when it is
specified by the decoder *and* when it is not.

  From my understanding of FFMPEG this should for both VFR and CFR videos. 
However, it does not work for all videos.  For some videos (both VFR and
CFR) it calculates the PTS correctly and the video plays beautifully. 
However, for others the calculated PTS values are crazy.  For instance last
night I enabled MOV support and my calculated values were coming out as 1,
2, 3, 4, 5, 6 etc.  Yes, 1 as in 1 millisecond!  This was for an 8 FPS

  If anyone can shed some light on this problem it would be most

[Hitman/Code HQ - 6502/z80/68000/604e/80x86/ARM coder - Amiga rulez!]
[VZ-200/VIC-20/MZ-700/c16/c64*10/c128*8/Plus-4/CPC464/CD32/500*2    ]
[600/1000/1200*2/A4000/SNES/N64/Dreamcast/Athlon 1100/AmigaOne      ]
[Assembly Language: The most fun you can have with your clothes on! ]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PTS.c
Type: application/octet-stream
Size: 472 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20051021/8383e4dd/attachment.obj>

More information about the ffmpeg-devel mailing list