[gst-devel] problem when getting the data of a frame
Ronald S. Bultje
rbultje at ronald.bitfreak.net
Wed Jul 20 05:16:19 CEST 2005
On Tue, 2005-07-19 at 23:19, Vincent Torri wrote:
> > On Tue, 2005-07-19 at 17:51, Vincent Torri wrote:
> > > a) I seek to frame #n (with DEFAULT type, it works as it returns true)
> any other possible error ?
The only other possibility that I can think of is this, but it'd depend
on what movie format you're seeking in. The thing is, DEFAULT has been
undocumented and thus (ab)used for anything for years.
In original GStreamer, until halfway 0.8, DEFAULT meant 'do in any
format the container wishes, and return the format, too'. Still, a lot
of code does that. So a format could for example interpret DEFAULT as
TIME and return TIME as format in the function. That's also why
GstFormat is a pointer and not a value in our API.
One year or half a year ago, Ogg started to (ab)use it as default format
for the specific format in question, which means granulepos. This means
that for theora, it is (num_frames_before_keyframe << ilog) +
num_frames_since_keyframe, or for vorbis, it is the samplenumber. Given
the requirements for Ogg muxing, DEFAULT got later re-interpreted as
media-specific sample offset, i.e. frame number for video or sample
number for video. But really only Ogg interprets it this way right now.
So although what you want may work for Ogg in 0.8, it won't work for
anything else in practice, even though the definition now matches what
you want. Simply because of old code lying around.
So hence my question, in what type of movie are you seeking? It's
probably a three-liner to implement it in AVI or OGM, but Matroska may
Ronald S. Bultje <rbultje at ronald.bitfreak.net>
More information about the gstreamer-devel