After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 606287 - Add an 'is-vbr' boolean tag
Add an 'is-vbr' boolean tag
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-01-07 06:47 UTC by Arun Raghavan
Modified: 2013-08-14 09:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
taglist: Add an 'is-vbr' boolean tag (1.63 KB, patch)
2010-01-07 06:47 UTC, Arun Raghavan
none Details | Review
Updated patch incorporating feedback from review (1.79 KB, patch)
2010-01-07 11:38 UTC, Arun Raghavan
reviewed Details | Review

Description Arun Raghavan 2010-01-07 06:47:32 UTC
Created attachment 150959 [details] [review]
taglist: Add an 'is-vbr' boolean tag

It would be good to have decoders/demuxers add a boolean flag on streams which have a variable bitrate. Specifically, this would be useful for GstDiscoverer and its users. Attaching a patch to do this.

I'll post some patches to actually post this tag for some of the codecs in a while.
Comment 1 Edward Hervey 2010-01-07 10:50:35 UTC
Review of attachment 150959 [details] [review]:

::: gst/gsttaglist.h
@@ +655,3 @@
+ * GST_TAG_VARIABLE_BITRATE:
+ *
+ * whether the stream has a variable bitrate (boolean)

A more extensive description/usage would be nice imho.

If True, the stream is *guaranteed* to have a variable bitrate.
If False, the stream is *guaranteed* to have a constant bitrate.
Comment 2 Arun Raghavan 2010-01-07 11:38:16 UTC
Created attachment 150968 [details] [review]
Updated patch incorporating feedback from review
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2011-02-28 15:16:31 UTC
Comment on attachment 150968 [details] [review]
Updated patch incorporating feedback from review

Looks good. Please push.
Comment 4 Sebastian Dröge (slomo) 2011-02-28 16:18:45 UTC
Wouldn't IS_VBR be a better name for this?

And what exactly does VBR or CBR mean in general? You always have to talk about a constant size for a specific time unit, e.g. all 384 sample frames have the same size for mp3.

Also, to *guarantee* that an mp3 stream is CBR you have to look at every single frame and the same is probably true for most other formats.
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2011-02-28 21:41:14 UTC
(In reply to comment #4)
> Wouldn't IS_VBR be a better name for this?

I think a stream "has a variable bitrate".

> 
> And what exactly does VBR or CBR mean in general? You always have to talk about
> a constant size for a specific time unit, e.g. all 384 sample frames have the
> same size for mp3.
> 
> Also, to *guarantee* that an mp3 stream is CBR you have to look at every single
> frame and the same is probably true for most other formats.

I was wondering earlier if we would need a probability or a string like "cbr, maybe-cbr, unknown, maybe-vbr, vbr". But that's ugly :/
Comment 6 Arun Raghavan 2011-03-01 04:21:56 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > Wouldn't IS_VBR be a better name for this?
> 
> I think a stream "has a variable bitrate".

Or "is a variable bitrate stream". Both are identical as far as I am concerned, though. :)

[...]
> I was wondering earlier if we would need a probability or a string like "cbr,
> maybe-cbr, unknown, maybe-vbr, vbr". But that's ugly :/

Which is why this patch hasn't been pushed so far.

We could retain the current tag name and replace the "guaranteed" to "most probably" with a big caveat in the documentation about the accuracy of this tag. I think this is an uncertainty that we will have to live with since the only definitive way to determine this (parse the whole stream) is not likely to be practical in most cases.
Comment 7 Sebastian Dröge (slomo) 2011-05-17 07:21:44 UTC
Comment on attachment 150968 [details] [review]
Updated patch incorporating feedback from review

Ok, so what's the plan now?
Comment 8 Arun Raghavan 2011-05-17 07:43:40 UTC
I still think that having is_vbr as a best-effort "this is probably a vbr stream" is good enough. Might as well design for the normal case and account for pathological cases rather than try to include all possibilities and clutter the design.
Comment 9 Stefan Sauer (gstreamer, gtkdoc dev) 2011-05-17 10:40:37 UTC
We could also have "is-vbr" and "is-cbr" for the cases we are (quite) sure and don't do anything where we are not. The docuementation would make clear that the absence of e.g. "is-vbr"=TRUE does not mean "is-cbr"=TRUE / "is-vbr"=FALSE, bur rather "sorry, we don't know".
Comment 10 Edward Hervey 2013-08-14 06:21:40 UTC
We now have BITRATE and NOMINAL_BITRATE tags, shouldn't detecting vbr or cbr be using those ?
Comment 11 Sebastian Dröge (slomo) 2013-08-14 08:05:02 UTC
I'm still not sure if this would be useful at all, and if so, what it would be useful for. Who cares if something is VBR or CBR (for some definition of CBR), why does it matter? If you have special bitrate constraints you have to do more than looking at such a best-effort, undefined tag anyway.

And users should not care at all, that's an implementation detail of the codec and users will only do weird conclusions based on misunderstanding the codec concepts if they see such a thing.
Comment 12 Edward Hervey 2013-08-14 08:21:41 UTC
It would be for information reporting for discoverer users.
Comment 13 Sebastian Dröge (slomo) 2013-08-14 08:31:23 UTC
Yes, what would they do with this useless information? :)
Comment 14 Tim-Philipp Müller 2013-08-14 09:23:49 UTC
I believe it was meant for DLNA stuff/profiles.

One reason why it might be useful to have is that if you know a file is VBR and you want to figure out e.g. the duration or so, then one might want to try a little harder instead of just doing preroll + query (though I believe this should ultimately be solved differently).
Comment 15 Sebastian Dröge (slomo) 2013-08-14 09:33:55 UTC
How is CBR defined for DLNA? Sorry if I'm blocking this but to me it seems like just useless API bloat that is confusing people later. Also it's not really simple to detect e.g. if an MP3 is VBR, you would need to check all frames.
Comment 16 Tim-Philipp Müller 2013-08-14 09:46:52 UTC
I'm aware of all that. I don't mind WONTFIXing this for the time being until someone finds a better solution, just stating what the original context was.
Comment 17 Arun Raghavan 2013-08-14 09:57:20 UTC
I'd originally opened this to deal with DLNA specifying different requirements for some VBR/CBR streams. We managed to pretty much get by without this flag, iirc, so will mark this WONTFIX until a better reason comes up.