[vlc-devel] Re: AW: Re: BUG modules/demux/ts.c DEMUX_GET_LENGTH

Derk-Jan Hartman hartman at videolan.org
Tue Jan 10 23:18:54 CET 2006


Basically because in the case of TS files it's not really possible.  
You can take the timestamp of the last TS packet and the first TS  
packet and calculate duration based on that, but the thing is that  
with TS, times are not guaranteed to be consistent. The counter can  
restart at any time. So you can have 0 - 15mins, reset to 6mins  
continue counting to 59mins.
In this case the above proces would indicate 59 mins. while in  
reality, it was 68 minutes.

This is legal within TS. TS is a very complicated stream format that  
is not designed for filestorage. It's for streaming. Calculating a  
reliable duration is impossible without processing the entire file,  
beforehand.

DJ


On 10-jan-2006, at 20:41, Viktor Haas wrote:

> Hi,
> I get the correct length of ts files with ffmpeg-php.
> TS files was made by vlc.
> Why vlc can't determine the length?
>
> Viktor
>
>
> On 1/10/06, Dunsti <dunsti at vol.at> wrote:
>> Hello,
>> Why you dont use the timesatmp of the MPEG packet?
>> Or ist this only possible in MPEG-PS streams?
>>
>> regards dunsti
>>
>> -----Ursprüngliche Nachricht-----
>> Von: vlc-devel-bounce at videolan.org [mailto:vlc-devel- 
>> bounce at videolan.org] Im
>> Auftrag von Clément Stenac
>> Gesendet: Dienstag, 10. Jänner 2006 14:15
>> An: vlc-devel at videolan.org
>> Betreff: [vlc-devel] Re: BUG modules/demux/ts.c DEMUX_GET_LENGTH
>>
>> Hello,
>>
>> We are currently unable to compute the length of a TS stream  
>> (well, I assume
>> we have a TS file, here, else, it's of course impossible to).
>>
>> We could calculate a value by getting the mux rate and using the  
>> total file
>> size, but this will only work on constant bitrate streams, while  
>> there are
>> many variable bitrate streams. I don't know if it is possible to  
>> know if a
>> stream is cbr or vbr, in which case we could set 0 if vbr and the  
>> result of
>> the computation if cbr.
>>
>> Hope this helps,
>>
>> --
>> Clément
>>
>> --
>> This is the vlc-devel mailing-list, see http://www.videolan.org/ 
>> vlc/ To
>> unsubscribe, please read http://developers.videolan.org/lists.html
>>
>> --
>> This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
>> To unsubscribe, please read http://developers.videolan.org/lists.html
>>
>>
>
> --
> This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
> To unsubscribe, please read http://developers.videolan.org/lists.html
>
>

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list