[FFmpeg-devel] [PATCH] avformat/utils: improve get duration

平凯 pingkai010 at gmail.com
Fri May 31 03:13:27 CEST 2013


The file is too big
click
http://pan.baidu.com/share/link?shareid=574906&uk=1677986196
 and click 下载(3.19M) button to download it.


2013/5/31 平凯 <pingkai010 at gmail.com>

> Sample file is in my attachment.
> Without my patch the duration is 2:40,but the duration is long than this.
> Witch my patch the duration is 3:27, the accuracy is about 1s.
>
> Thinks.
>
>
> 2013/5/31 平凯 <pingkai010 at gmail.com>
>
>> Ok, I've modify the patch as your suggestiones.
>> I'll provide a sample later. Case the sample file is on the pc that not
>> at my home now.
>> 2013/5/31 Carl Eugen Hoyos <cehoyos at ag.or.at>
>>
>>> Ping Kai <pingkai010 <at> gmail.com> writes:
>>>
>>> > improve the accuracy of getting
>>> > duration from bit rate.
>>>
>>> Could you provide a sample that gets an
>>> improved duration by your patch?
>>>
>>> > +    int64_t *sample_bit_rate_sum = av_malloc(ic->nb_streams *
>>> > sizeof(int64_t));
>>> > +    int *sample_count = av_malloc(ic->nb_streams * sizeof(int));
>>> >
>>> > +    if (sample_bit_rate_sum == NULL || sample_count == NULL)
>>>
>>> > +        return AVERROR_INVALIDDATA;
>>>
>>> AVERROR(ENOMEM)
>>>
>>> > +    memset(sample_bit_rate_sum ,0 ,ic->nb_streams * sizeof(int64_t));
>>> > +    memset(sample_count,0 ,ic->nb_streams * sizeof(int));
>>>
>>> If you use av_mallocz, the memset should not be
>>> necessary.
>>>
>>> > -
>>>
>>> Do not remove the empty line, same below.
>>>
>>> Carl Eugen
>>>
>>> _______________________________________________
>>> ffmpeg-devel mailing list
>>> ffmpeg-devel at ffmpeg.org
>>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>>
>>
>>
>>
>> --
>> ――――――――――――――――――――――――
>> 平凯
>> e-mail:pingkai010 at gmail.com
>> msn:pingkai010 at hotmail.com
>> tel:15101537133
>> qq:306978600
>>
>>
>
>
> --
> ――――――――――――――――――――――――
> 平凯
> e-mail:pingkai010 at gmail.com
> msn:pingkai010 at hotmail.com
> tel:15101537133
> qq:306978600
>
>


-- 
――――――――――――――――――――――――
平凯
e-mail:pingkai010 at gmail.com
msn:pingkai010 at hotmail.com
tel:15101537133
qq:306978600


More information about the ffmpeg-devel mailing list