[gst-devel] Getting *fixed* caps information for streams in a file?

Cameron Gorrie sastraxi at gmail.com
Tue Nov 18 21:49:37 CET 2008


2008/11/18 Cameron Gorrie <sastraxi at gmail.com>
>
> Hello all,
>
> I'm trying to get specific information on the media streams attached to a file. To do this I'm using decodebin2 (I have tried decodebin, as well).
> My problem is that it seems to be dependent on the file whether or not media streams are fixated after coming in through the new-decoded-pad callback.
> I have tried:
> - adding an async block on the pads and querying data later;
> - adding a notify::caps callback and querying for the caps later (in this callback);
> - just checking inside new-decoded-pad; and
> - iterating over the pads after they have all been found.
>
> I have also attempted to attach the pads to sinkpads and see what negotiation happens, but that didn't work. I tried that using gstreamer-java, so I'm not 100% sure, but I messed around with it long enough that it makes me think it's not the right way to go about things.
>
> Finally, I was directed to this on the IRC channel:
> http://webcvs.freedesktop.org/gstreamer/gst-plugins-base/gst/playback/test5.c?revision=1.9&view=markup
> This iteration method works exactly as my code did before -- I have three video files, one of which results in "x-video-raw/rgb; x-video-raw/yuv" and a fixated audio (8000hz, 8-bit, 1 channel, PCM), one of which results in a fixated video and a basically-generic audio caps (as in, 1 to some high number hz, 1 or 2 channels, ...), and the third video results in both being "unfixated"
>
> I was also directed to
> http://webcvs.freedesktop.org/gstreamer/gstreamer/docs/design/part-block.txt?revision=1.9&view=markup
> However, either I have implemented the idea here and it did not work in the way I expected, or I did not implement it correctly for lack of documentation. I think I did implement it correctly using async blocker callbacks on the srcpads, though. Feel free to correct me.
>
> Basically, I'm looking to query *all* information about a file, kind of like how you can right-click on a file in Gnome's Nautilus and get properties like frame size, framerate, codec, ...
> I need all the pertinent information for the uncompressed format of each stream, and the length (though the length calculation is working just fine right now), enough information to know exactly how much space each frame will need, and how to access the information in these frames in my application.
>
> Finally, I'm looking to do this decoding a minimal amount of the bitstreams (as there will be thousands of files to load at the start). Can anyone help out with some code that is doing what I want?
>
> Thanks a ton!
> Cameron
>
> P.S. Apologies if this gets posted twice; I have cancelled my original unauthorized posting, but you never know...

I apologise; I didn't realise I didn't send the email in plain text. I
am so bad with mailing lists. Anyhow, I was encouraged on IRC to post
my code, so here's a link to Pastebin:

http://pastebin.com/m35a9b6b9

Cameron




More information about the gstreamer-devel mailing list