[Ffmpeg-devel] Calculating PTS Times

Colin Ward lists
Fri Oct 21 08:28:16 CEST 2005

Rich Felker wrote:
>>  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
> Increment by one timebase unit is definitely NOT correct. You need to
> obtain a pts value for each frame. For proper containers, every frame
> will come with a pts value to begin with. For broken containers, it
> can be a lot of work to get the pts.. :(

   I took this logic from one of the example programs that comes with 
FFMPEG; IIRC it was from ffplay.c.  So what must I do in the case where 
AVFrame->pts is 0?  Does this mean that the container/codec is broken? 
And if so, shouldn't they be fixed?

   Surely if this is the case then everyone will be struggling with the 
same issues that I am struggling with.  So what is happening?  Are they 
coming up with their own solutions that work just with the subset of 
formats and codecs they have chosen?

   Is there any documentation on this issue, apart from the source itself?

[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! ]

More information about the ffmpeg-devel mailing list