GNOME Bugzilla – Bug 744070
oggdemux: wrong duration for ogv file
Last modified: 2015-04-03 15:45:26 UTC
Created attachment 296239 [details] ogv file $ gst-play-1.0 /tmp/test.ogv Now playing /tmp/test.ogv 00:01.7 / 1:02:19.0 But the clip is only a few second. Wget-ed from an icecast server.
It's getting this large length from the skeleton stream metadata :/ This is really unfortunate as I'm not sure how one tell when skeleton should be ignored, and when not...
Created attachment 299215 [details] [review] fix wrong duration on partial streams with skeleton index Actually we can.
Review of attachment 299215 [details] [review]: ::: ext/ogg/gstoggstream.c @@ +1487,3 @@ + /* Do not error out, this will happen when catching stream portions + as they are streamed from Icecast */ + GST_WARNING ("Index offets beyond stream length, ignoring index"); Typo :) offets
Would it perhaps make more sense to just assume the file is truncated and clip the index to the available size? We can query the upstream size after all, no?
Icecast will keep the headers and send them when you connect, so the stream might not start at offset 0 - there will be a hole at start and you don't know how many bytes.
That's a good point. But you can know from the packet numbers if this is the case or not, no? (Not sure if it's worth it, just wondering)
You can know there is a hole, but not its byte size, and you really need that for the index to be useful since it's a shortcut though the bisection.
Yeah, I meant keep the index and truncate it if there is no hole, otherwise discard it.
Oh, I see, you could do that indeed. The index removal-or-truncation would have to be moved to later, as we don't know if there's any hole yet when the index is being built.
Created attachment 299296 [details] [review] fix wrong duration on partial streams with skeleton index This version clips or discards based on discontinuity at start.
commit a44258dbe888e65da3151132978dc60825173759 Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> Date: Thu Mar 12 16:01:48 2015 +0000 oggdemux: fix wrong duration on partial streams with a skeleton index When a stream has a skeleton index, the stream time is taken from that index. However, when part of the stream is captured, the index is invalid as its offsets are now wrong. To avoid this, we ignore the index when the last offset points beyond the end of the stream (when its byte length is known). https://bugzilla.gnome.org/show_bug.cgi?id=744070