Hi,

Am 16.08.2010 15:48, schrieb IOhannes m zmoelnig:
> On 2010-08-16 15:12, Burkhard Plaum wrote:
>>
>>
>> This file is weird. I made again the mistake not to be prepared for all
>> stupidities, which can occur in media files.
>
> that's why i love things like gmerlin-avdec: they make this their
> problem :-)
>

Hehe :)

Of course, as the last possibility, I can declare the file as broken. And it 
will be
hard to prove me wrong.

>> sampleseek.c, bgav_seek_video() called by bgav_seek_scaled() in sample
>> accurate mode:
>>
>>     if(time == s->out_time)
>>       {
>>       return;
>>       }
>>
>
> ok, i have added a little code on my side that relaxes this condition to
> |time - s->out_time|<MAX_OFFSET ....

Ok, but note that the frame duration can be 1 (e.g. for PAL with a timescale of 
25)
in which case you can be wrong by MAX_OFFSET-1 frames.

>> Relying on a constant framerate is not good.
>>
>
> true but i have no clue how to update dynamically....
> do i have to poll bgav_get_video_format() to get the most current
> framerate, or is the returned gavt_video_format_t updated whenever a
> change occurs?

No, if the framerate is variable, the frame-duration *should* be set to
zero and (more important) framerate_mode is set to GAVL_FRAMERATE_VARIABLE.
In the case of River.mp4 it's flagged as constant although it's in reality
slightly variable.

Variable framerate doesn't mean switching between framerates but simply
individual (increasing but else arbitrary) timestamps for each frame.
E.g. I saw a file with a 3 (or so) second still image at the beginning encoded
as one single frame. Or a presentation, where you hear the speakers voice and
see the slides as video frames, one frame per slide. Many formats are constant
framerate only, but VFR files are more common than many people think.

If you want to know all frame times in advance (and you use sample accurate mode
anyway) you can get a frame table for that stream:

http://hirntier.blogspot.com/2009/09/frame-tables.html

This allows things like "find the frame, which is displayed at time x" or
"get the pts of the yth frame".

Burkhard

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Gmerlin-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gmerlin-general

Reply via email to