[libavg-devel] Audio Support Patch
Ulrich von Zadow
uzadow at libavg.de
Mon Jan 7 23:31:54 CET 2008
Nick Hebner wrote:
> Hey again,
>
> I am working on modifying seeking to work correctly with audio, and have
> come up with some points for discussion.
>
> The main problem that I have run into is seeking is currently based on a
> frame number. This is fine for video, but when we have audio only nodes,
> we will not have frame numbers to seek to. I think that the best thing
> to do here is to change seeking (at least at the decoder/demuxer level)
> to be based on stream time as this applies to audio as well as video
> streams.
I hadn't thought of that, but: yes, we need a seekToTime().
> Now we obviously need to retain seeking by frame numbers for backwards
> compatibility (and its a nice option to have), and as I see it, there
> are two ways to accomplish this.
>
> 1. Have two seek methods in IVideoDecoder: seekFrame(int DestFrame) and
> seekTime(long long DestTime). seekFrame() may be internally built on
> seekTime() using the nominal framerate to calculate the time.
>
> 2. Simply provide an accessor to the nominal framerate and allow higher
> level nodes to implement their own seekFrame() behavior. This seems a
> bit cleaner and simpler to me, and is my preference currently.
Actually, I think I prefer keeping seekToFrame() around. libavg seeks
extremely fast in I-frame-only movies, and this allows you to see a
movie more as a collection of images than as a sequence of images
ordered in time. We have used this, for instance, to prerender lots of
images of an object from different perspectives, with the frame numbers
corresponding to an angle. There is really no concept of time in these
'movies'. Also, it's quite easy to have little rounding and off-by-one
bugs in the conversion of frame numbers to time stamps, so having this
implemented in the library would probably save some people some time.
> Once these issues are sorted, would we like to add a seekToTime() method
> to the video node as an alternative to seeking by frame?
Sounds good :-).
I haven't yet found the time to look through your commits - will do
soon, though. I promise.
Cheers,
Uli
--
Ulrich von Zadow | +49-172-7872715
Jabber: cocacoder at jabber.berlin.ccc.de
Skype: uzadow
More information about the libavg-devel
mailing list