Page 1 of 1

Bitrate from access modules

Posted: 10 Aug 2009 20:20
by MCyr
From shout.c:

Code: Select all

/* The shout module only "transmits" data. It does not have direct access to "codec level" information. Stream information such as bitrate, samplerate, channel numbers and quality (in case of Ogg streaming) need to be set manually */
Is that accurate? There is no way of finding the actual bitrate from an access out module?
Let's say I want to create a chain like Fake -> MPEG -> TS -> file and I want to output a header or something in the context of the file aout, what would be the correct way/place to set and then get/read the bitrate?

Re: Bitrate from access modules

Posted: 11 Aug 2009 17:50
by Rémi Denis-Courmont
This would need changes to the access output interface.

Re: Bitrate from access modules

Posted: 11 Aug 2009 17:53
by MCyr
Is there some kind of "metainfo" repository that exists in which I could store settings available from the input that could later be accessed by some other part of the chain?

Re: Bitrate from access modules

Posted: 12 Aug 2009 17:03
by Rémi Denis-Courmont
Definitely not. The input of a stream output chain can change at any moment, so you cannot callback into the input.

Re: Bitrate from access modules

Posted: 12 Aug 2009 19:37
by MCyr
Not as much as a callback, but rather a bunch of info (dictionnary like) about the current input stream.

Re: Bitrate from access modules

Posted: 12 Aug 2009 21:00
by Rémi Denis-Courmont
The point is, you cannot refer to the input, because it can change asynchronously. Maybe you don't even have an input.

Re: Bitrate from access modules

Posted: 12 Aug 2009 23:28
by MCyr
Ok, I see I might have not been clear enough in my question. I mean that if I customize the input module, is there some common place I can access from both the input and output modules? I think I've seen something like vlc_object_find (and seen it refered as bad practice by yourself if I'm not mistaken) that could do the trick (I guess) but perhaps it wouldn't be the nicest solution.

Again, thanks for the feedbacks, they are greatly appreciated.

Re: Bitrate from access modules

Posted: 13 Aug 2009 18:45
by Rémi Denis-Courmont
Not really. The stream output and the multiplexer have access to the codec informations (which might incidentally include bitrate). In theory, the multiplexer could compute the total bitrate from its own overhead and the sum of the bitrate of each elementary stream. Then it could provide it to the output via some new control request.

As for vlc_object_find... well if you resorts to such hacks you can really do anything from anywhere, although it probably won't be thread-safe...

Re: Bitrate from access modules

Posted: 13 Aug 2009 21:49
by MCyr
Control request? Is it used somewhere else in the source tree? Sound really interesting. And of course, I'm guessing that because of the structure of VLC, no thread safety = bad things guaranteed to happen?

Re: Bitrate from access modules

Posted: 15 Aug 2009 10:55
by Rémi Denis-Courmont
Control requests are all over the place.