Hi,<br><br>&nbsp;Try this in your callback function:<br>&nbsp;&nbsp;&nbsp; myInfo = gst_caps_to_string(caps);<br>&nbsp;&nbsp;&nbsp; g_print(myInfo);<br><br>You will see something like that for a video pipeline in your console:<br>&nbsp; video/x-raw-rgb, bpp=(int)16, depth=(int)16, width=(int)640, height=(int)464, framerate=(fraction)25/1, pixel-aspect-ratio=(fraction)1/1, red_mask=(int)63488, green_mask=(int)2016, blue_mask=(int)31, endianness=(int)1234
<br><br>hope this help you,<br>Erwan Masson<br><br><br><br><div><span class="gmail_quote">2007/4/13, Vincent Torri &lt;<a href="mailto:vtorri@univ-evry.fr">vtorri@univ-evry.fr</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Hey,<br><br>I wrote a prog that extracts (some of ?) those data from any<br>multimedia file (audio or video) 2 years ago. I&#39;ve attached it.<br><br>Basically:<br>1) I build a basic pipeline : filesrc ! decodebin<br>
2) I set the pipeline to the PAUSED state.<br>3) Each time a stream is found, I get its properties.<br><br>The program has 2 parts :<br>1) a lib one, that stores the properties<br>2) a binary one that uses the lib part. I&#39;ve made a CLI one (no gui) and 3
<br>gui, one with gtk. You&#39;ll have to disable the other gui to compile the<br>progs, iirc (or maybe they&#39;ll not be built as I think that you don&#39;t have<br>those toolkits. I can&#39;t remember).<br><br>That means that you can even use directly the lib part and integrate it to
<br>your prog if you find it usefull. There is a GNU Copying licence, but I<br>think that it has been automatically created. I didn&#39;t intend to use the<br>GPL.<br><br>Or else, you can just look at how I wrote it and get only the audio part
<br>(as the lib extracts also the video informations)<br><br>Example of output with the CLI:<br><br>Filename....................: ********.mp3<br>Size........................: 6,2 MB (or 6305,8 KB, or 6457150 B)<br>Container...................:&nbsp;&nbsp;no informations
<br><br>Streams<br>&nbsp;&nbsp;|<br>&nbsp;&nbsp;+-Audio stream #0<br>&nbsp;&nbsp;&nbsp;&nbsp; +-Mimetype..............: audio/mpeg<br>&nbsp;&nbsp;&nbsp;&nbsp; +-Decoder info<br>&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;|<br>&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;+-Name...............: mad mp3 decoder<br>&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;+-Description........: Uses mad code to decode mp3 streams
<br>&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;+-Class..............: Codec/Decoder/Audio<br>&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;+-Author.............: Wim Taymans &lt;<a href="mailto:wim@fluendo.com">wim@fluendo.com</a>&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; |<br>&nbsp;&nbsp;&nbsp;&nbsp; +-Duration..............: 0:04:29.31916666
<br>&nbsp;&nbsp;&nbsp;&nbsp; +-Sample rate...........: 44100<br>&nbsp;&nbsp;&nbsp;&nbsp; +-Sample count..........: 11864307<br>&nbsp;&nbsp;&nbsp;&nbsp; +-Channels..............: 2<br>&nbsp;&nbsp;&nbsp;&nbsp; +-Endianess.............: 0<br>&nbsp;&nbsp;&nbsp;&nbsp; +-Width.................: 32<br>&nbsp;&nbsp;&nbsp;&nbsp; +-Depth.................: 32
<br>&nbsp;&nbsp;&nbsp;&nbsp; +-Signed................: yes<br><br>I hope this helps.<br><br>Regards,<br><br>Vincent Torri<br><br>On Fri, 13 Apr 2007, Mario Torre wrote:<br><br>&gt; Hello!<br>&gt;<br>&gt; My project for the Google Summer Of Code was accepted as part of the GNU
<br>&gt; Project:<br>&gt; <a href="http://code.google.com/soc/gnu/appinfo.html?csaid=FDB6DFFB07FE351C">http://code.google.com/soc/gnu/appinfo.html?csaid=FDB6DFFB07FE351C</a><br>&gt;<br>&gt; As I said in an earlier mail, my task is to hook GStreamer into GNU
<br>&gt; Classpath.<br>&gt;<br>&gt; Now, I&#39;ve found a problem that is blocking me from a couple days and is<br>&gt; taking me away all my sleep :)<br>&gt;<br>&gt; I need to write a (Java) class that displays this kind of information
<br>&gt; about an audio file:<br>&gt;<br>&gt; * Encoding type<br>&gt; * Sample rate<br>&gt; * Sample size in bits<br>&gt; * Channels<br>&gt; * Frame size<br>&gt; * Frame rate<br>&gt; * Endiannes<br>&gt; * Header size<br>&gt;
<br>&gt; Of course, I could just add a reader for any given kind of audio file,<br>&gt; but then this is pointless to have a gstreamer hook that can recognize<br>&gt; (almost) any type given the right plugin.<br>&gt;<br>&gt; My problem is that I can&#39;t find an example of how to parse a file and
<br>&gt; extract this data (I need to do that in C, not Java). The program should<br>&gt; return as soon as all these info are retrieved (if possible). I&#39;ve see<br>&gt; the Discover class from the python bindings (which seems to be what I&#39;m
<br>&gt; looking for), but I hate to admit that I was unable to recreate its<br>&gt; behaviour, though I think I&#39;m on the correct way. What I&#39;m doing is this<br>&gt; (to see what capabilities an element has), I get a typefind element and
<br>&gt; attach a signal handler to it, but this seems to be not enough, and all<br>&gt; the output I get is:<br>&gt;<br>&gt; -----<br>&gt; application/ogg<br>&gt; print_pad<br>&gt; size of caps: 1<br>&gt; fields in structure: 0
<br>&gt; -----<br>&gt;<br>&gt; [...]<br>&gt; g_signal_connect (G_OBJECT (typefind), &quot;have-type&quot;,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;G_CALLBACK (have_type_callback), loop);<br>&gt; [...]<br>&gt;<br>&gt; gboolean have_type_callback(GstElement *typefind,
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;guint probability,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;const GstCaps *caps,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gpointer data)<br>&gt; {<br>&gt;&nbsp;&nbsp;[...]<br>&gt;&nbsp;&nbsp;GstStructure *st = NULL;<br>
&gt;&nbsp;&nbsp;int size = 0;<br>&gt;<br>&gt;&nbsp;&nbsp;g_fprintf (stderr, &quot;print_pad\n&quot;);<br>&gt;<br>&gt;&nbsp;&nbsp;size = gst_caps_get_size (caps);<br>&gt;&nbsp;&nbsp;g_fprintf (stderr, &quot;size of caps: %d\n&quot;, size);<br>&gt;<br>&gt;&nbsp;&nbsp;for (int j = 0; j &lt; size; j++) {
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;st = gst_caps_get_structure (caps, j);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;if (st != NULL) {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;size = gst_structure_n_fields (st);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;g_fprintf (stderr, &quot;fields in structure: %d\n&quot;, size);<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (int i = 0; i &lt; size; i++) {
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;g_fprintf (stderr, &quot;field name: %s\n&quot;,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_structure_nth_field_name(st, i));<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&gt;&nbsp;&nbsp;}<br>&gt; [...]<br>&gt; }<br>&gt;<br>&gt; I&#39;m a bit new to all that, so forgive me if I&#39;m doing some incredibly
<br>&gt; stupid mistake :)<br>&gt;<br>&gt; Thanks for all the help,<br>&gt; Mario<br>&gt; --<br>&gt; Lima Software - <a href="http://www.limasoftware.net/">http://www.limasoftware.net/</a><br>&gt; GNU Classpath Developer - 
<a href="http://www.classpath.org/">http://www.classpath.org/</a><br>&gt; Jabber: <a href="mailto:neugens@jabber.org">neugens@jabber.org</a> - Profile: <a href="http://www.gtalkprofile.com/profile/9661.html">http://www.gtalkprofile.com/profile/9661.html
</a><br>&gt; pgp key: <a href="http://subkeys.pgp.net/">http://subkeys.pgp.net/</a><br>&gt; PGP Key ID: 80F240CF<br>&gt; Fingerprint: BA39 9666 94EC 8B73 27FA&nbsp;&nbsp;FC7C 4086 63E3 80F2 40CF<br>&gt;<br>&gt; Please, support open standards:
<br>&gt; <a href="http://opendocumentfellowship.org/petition/">http://opendocumentfellowship.org/petition/</a><br>&gt; <a href="http://www.nosoftwarepatents.com/">http://www.nosoftwarepatents.com/</a><br>&gt;<br>&gt;<br>&gt; -------------------------------------------------------------------------
<br>&gt; Take Surveys. Earn Cash. Influence the Future of IT<br>&gt; Join SourceForge.net&#39;s Techsay panel and you&#39;ll get the chance to share your<br>&gt; opinions on IT &amp; business topics through brief surveys-and earn cash
<br>&gt; <a href="http://www.techsay.com/default.php?page=join.php&amp;p=sourceforge&amp;CID=DEVDEV">http://www.techsay.com/default.php?page=join.php&amp;p=sourceforge&amp;CID=DEVDEV</a><br>&gt; _______________________________________________
<br>&gt; gstreamer-devel mailing list<br>&gt; <a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>&gt; <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel">
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>&gt;<br>&gt; --<br>&gt; Ce message a été vérifié par MailScanner<br>&gt; pour des virus ou des polluriels et rien de<br>&gt; suspect n&#39;a été trouvé.<br>
&gt; Message délivré par le serveur de messagerie de l&#39;Université d&#39;Evry.<br>&gt;<br>&gt;<br>-------------------------------------------------------------------------<br>Take Surveys. Earn Cash. Influence the Future of IT
<br>Join SourceForge.net&#39;s Techsay panel and you&#39;ll get the chance to share your<br>opinions on IT &amp; business topics through brief surveys-and earn cash<br><a href="http://www.techsay.com/default.php?page=join.php&amp;p=sourceforge&amp;CID=DEVDEV">
http://www.techsay.com/default.php?page=join.php&amp;p=sourceforge&amp;CID=DEVDEV</a><br>_______________________________________________<br>gstreamer-devel mailing list<br><a href="mailto:gstreamer-devel@lists.sourceforge.net">
gstreamer-devel@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br><br><br></blockquote></div><br>