[FFmpeg-devel] [PATCH] flv 32 bit signed timestamps

Baptiste Coudurier baptiste.coudurier
Sat Aug 30 05:08:00 CEST 2008


Michael Niedermayer wrote:
> On Mon, Jul 28, 2008 at 11:42:29AM -0700, Baptiste Coudurier wrote:
>> Michael Niedermayer wrote:
>>> On Mon, Jul 28, 2008 at 10:17:13AM -0700, Baptiste Coudurier wrote:
>>>> Michael Niedermayer wrote:
>>>>> On Sun, Jul 27, 2008 at 10:19:17PM -0700, Baptiste Coudurier wrote:
>>>>>> Hi,
>>>>>>
>>>>>> Like figured out, flv uses 32 bit signed timestamps, meaning that
>>>>>> pts_wrap_bits must be set to 31.
>>>>> What fails, why does it fail and how is it fixed by this change?
>>>> Don't remember ? 
>>> i remember signed timestamps, flv, weird dts and pts, but i do not remember
>>> how they where connected and how that leads to this patch or what exactly
>>> this is supposed to change.
>>>
>>>
>>>> Let me restate, FLV specs say timestamps are unsigned,
>>>> while flash player use _signed_ 32 bits, this means that max timestamp
>>>> value is INT_MAX, if you go > INT_MAX, flash player just interpret
>>>> timestamps as 0, which is broken.
>>> timestamps are in ms, to reach INT_MAX needs 3.5 weeks, thats not what you
>>> mean i assume ...
>> Depends, timestamps are not meant to start at 0, for example, when using
>> FFserver, timestamps reflect current time, so timestamps can be >
>> INT_MAX, and this is what happens. I guess flash player range value for
>> timestamps is 0 - INT_MAX, and for that pts_wrap_bits needs to be set to
>> 31 due to truncate_ts.
> 
> ok, iam starting to understand things.
> would simply changing:
> -put_byte(pb,ts >> 24);
> +put_byte(pb,(ts >> 24) & 0x7F);
> 
> not solve the whole as well? I think that would be simpler
> 

Indeed, applied.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Smartjog USA Inc.                                http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA




More information about the ffmpeg-devel mailing list