[Ffmpeg-devel] Re: [PATCH] new mov_read_packet, mov_read_seek

Baptiste Coudurier baptiste.coudurier
Fri Jul 7 17:02:27 CEST 2006


Hi

Michael Niedermayer wrote:
> [...]
> 
> edit lists .... well
> how should that be implemented?
> there are 2 ways
> 1. output stuff exactly as the edit lists say 
> 2. output stuff completely ignoring the edit lists and exporting the
>    information from the edit lists in a nice way, maybe a AVEditList
>    or so, so that the user application can decide what to do, keep in
>    mind that edit lists and such could reorder and duplicate stuff so
>    a simple dont-display flag isnt enough
> 
> if now the mov-edit-lists ignore keyframes and contain stuff like
> "display from frame 100 to 150" while frame 100 is no keyframe
> then 1. is not cleanly possible anyway

I'll think about implementing AVEditList then.

> [...]
> 
> could you add a little function to libavcodec/utils.c :
> something like
> av_get_bits_per_sample(CodecID codec_id){
>     switch(codec_id;
>     case CODEC_ID_PCM_S16LE:
>     case CODEC_ID_PCM_S16BE:
>         return 16;
>     ...
>     default:
>         return 0;
> }
> 
> and use it, there are so many places in libav* which need this that its
> starting to hurt to see this in various varations over and over ...
> 
> [...]

Like the attached patched ?

> 
>> +    /* compute duration */
>> +    assert(sc->stts_data[sc->sample_to_time_index].duration % sc->time_rate == 0);
>> +    pkt->duration = sc->stts_data[sc->sample_to_time_index].duration / sc->time_rate;
> 
> i think this is wrong, if this is the dts difference then its not the real
> duration, AVPacket.duration must be the real duration, which is the pts
> difference
> 
> for example:
>          IPBBP
> dts:     01356
> pts:     16359
> duration:2321
> 

Ok, I see the point. I fear that is going to be the same mess as in
movenc to compute since pts difference is not available...

> [...]

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: av_get_bits_per_sample.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060707/2e414cb8/attachment.txt>



More information about the ffmpeg-devel mailing list