Bitrate from access modules

This forum is about all development around libVLC.
MCyr
Blank Cone
Blank Cone
Posts: 21
Joined: 07 Aug 2009 16:07
VLC version: 1.1.0-git
Operating System: Linux

Bitrate from access modules

Postby MCyr » 10 Aug 2009 20:20

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?

Rémi Denis-Courmont
Developer
Developer
Posts: 15258
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Bitrate from access modules

Postby Rémi Denis-Courmont » 11 Aug 2009 17:50

This would need changes to the access output interface.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

MCyr
Blank Cone
Blank Cone
Posts: 21
Joined: 07 Aug 2009 16:07
VLC version: 1.1.0-git
Operating System: Linux

Re: Bitrate from access modules

Postby MCyr » 11 Aug 2009 17:53

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?

Rémi Denis-Courmont
Developer
Developer
Posts: 15258
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Bitrate from access modules

Postby Rémi Denis-Courmont » 12 Aug 2009 17:03

Definitely not. The input of a stream output chain can change at any moment, so you cannot callback into the input.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

MCyr
Blank Cone
Blank Cone
Posts: 21
Joined: 07 Aug 2009 16:07
VLC version: 1.1.0-git
Operating System: Linux

Re: Bitrate from access modules

Postby MCyr » 12 Aug 2009 19:37

Not as much as a callback, but rather a bunch of info (dictionnary like) about the current input stream.

Rémi Denis-Courmont
Developer
Developer
Posts: 15258
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Bitrate from access modules

Postby Rémi Denis-Courmont » 12 Aug 2009 21:00

The point is, you cannot refer to the input, because it can change asynchronously. Maybe you don't even have an input.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

MCyr
Blank Cone
Blank Cone
Posts: 21
Joined: 07 Aug 2009 16:07
VLC version: 1.1.0-git
Operating System: Linux

Re: Bitrate from access modules

Postby MCyr » 12 Aug 2009 23:28

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.

Rémi Denis-Courmont
Developer
Developer
Posts: 15258
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Bitrate from access modules

Postby Rémi Denis-Courmont » 13 Aug 2009 18:45

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...
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

MCyr
Blank Cone
Blank Cone
Posts: 21
Joined: 07 Aug 2009 16:07
VLC version: 1.1.0-git
Operating System: Linux

Re: Bitrate from access modules

Postby MCyr » 13 Aug 2009 21:49

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?

Rémi Denis-Courmont
Developer
Developer
Posts: 15258
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Bitrate from access modules

Postby Rémi Denis-Courmont » 15 Aug 2009 10:55

Control requests are all over the place.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 12 guests