Audio Metadata

Sree Gowri sreegowris at gmail.com
Tue Apr 24 23:49:08 PDT 2012


On Tue, Apr 24, 2012 at 9:42 PM, Sree Gowri <sreegowris at gmail.com> wrote:

>
>
> On Tue, Apr 24, 2012 at 5:46 PM, Stefan Sauer <ensonic at hora-obscura.de>wrote:
>
>> **
>> On 04/24/2012 11:18 AM, Sree Gowri wrote:
>>
>>
>>
>> On Mon, Apr 16, 2012 at 12:53 AM, Stefan Sauer <ensonic at hora-obscura.de>wrote:
>>
>>>  On 04/12/2012 06:23 AM, Sree Gowri wrote:
>>>
>>> Hi,
>>>
>>> I am trying to extract audio metadata like
>>> streamurl,streamtitle,artist,genre,album.However I am not able to extract
>>> the metadata using GstTagList. Below is the snippet of the code. Does
>>> anyone suggest what are the additions to be done in order to extract the
>>> metadata?
>>>
>>> Only the following data has been extracted.
>>>              layer: 3
>>>              mode: joint
>>>              emphasis: none
>>>              audio codec: MPEG-1 layer 3
>>>              bitrate: 128000
>>>
>>> Pipeline is as follows:
>>>
>>> [code]
>>> app->pipeline= gst_parse_launch("appsrc name=mysource ! audio/mpeg  !
>>> mad !  alsasink", NULL);
>>> [/code]
>>>
>>>  "appsrc name=mysource ! audio/mpeg  ! mp3parse ! mad !  alsasink"
>>> or even better
>>> "appsrc name=mysource ! audio/mpeg  ! decodebin2 !  alsasink"
>>>
>>> Stefan
>>>
>>>
>>> Audio data fed to the appsrc element
>>>
>>> [code]
>>> buf =( GstBuffer *) gst_app_buffer_new (data, READBUF, g_free, data);
>>> g_signal_emit_by_name (GST_APP_SRC (app->appsrc), "push-buffer", buf,
>>> &ret);
>>> [/code]
>>>
>>> Bus message
>>>
>>> [code]
>>> case GST_MESSAGE_TAG:
>>> {
>>>     GstTagList *tags = NULL;
>>>         char *artist;
>>>         gst_message_parse_tag (message, &tags);
>>>         g_print ("Got tags from element %s:\n", GST_OBJECT_NAME
>>> (message->src));
>>>         if (gst_tag_list_get_string (tags, GST_TAG_ARTIST, &artist))
>>>         {
>>>            printf("got artist: %s\n",artist);
>>>         }
>>>         else
>>>         {
>>>           printf("no artist!! \n");
>>>         }
>>>         gst_tag_list_foreach (tags, print_tag, NULL);
>>>         g_print ("\n");
>>>         gst_tag_list_free (tags);
>>>         break;
>>> [/code]
>>>
>>> print_tag function code
>>> [code]
>>> static void print_tag (const GstTagList * list, const gchar * tag,
>>> gpointer unused)
>>> {
>>>   gint i, count;
>>>   count = gst_tag_list_get_tag_size (list, tag);
>>>   for (i = 0; i < count; i++) {
>>>     gchar *str;
>>>     if (gst_tag_get_type (tag) == G_TYPE_STRING) {
>>>       if (!gst_tag_list_get_string_index (list, tag, i, &str))
>>>         g_assert_not_reached ();
>>>
>>>     } else {
>>>       str =
>>>           g_strdup_value_contents (gst_tag_list_get_value_index (list,
>>> tag, i));
>>>     }
>>>     if (i == 0) {
>>>       g_print ("  %15s: %s\n", gst_tag_get_nick (tag), str);
>>>     } else {
>>>       g_print ("                 : %s\n", str);
>>>     }
>>>     g_free (str);
>>>   }
>>> }
>>> [/code]
>>>
>>> Thanks and Regards,
>>> Sree Gowri
>>>
>>>        Hi stephan,
>>
>>       First would like to thank you for the input you provided.
>>
>>       I tried both the pipelines that you have mentioned,however meta
>> data has not been    extracted.
>>
>>      Kindly request you to let me know if there are any other changes
>> that needs to be done.
>>
>>
>> Are you sure the stream you are looking at is tagged with such metadata?
>> Try gst-launch-0.10 -t playbin2 uri=...
>>
>> Stefan
>>
>
>    Yes the stream contains the metadata like streamTitle, streamUrl. In
> order to check does the stream really has metadata, appsrc buffer is
> written to a file and checked using hexedit and I can find the
> metadata.Sure will try your suggestion tomorrow and update you. Thankyou.
>

Regards,
Sree Gowri

     Hi Stephan,

      gst-launch-0.10 -t playbin2 uri=.... is also not extracting the
metadata.

      Actually I am streaming the shoutcast stream.Audio stream data is
feed to the appsrc element.
    Following is the header that is received

ICY 200 OK^M
icy-notice1:<BR>This stream requires <a href="http://www.winamp.com/
">Winamp</a><BR>^M
icy-notice2:SHOUTcast Distributed Network Audio Server/win32 v1.9.8<BR>^M
icy-name:Radio Afsana Online 24/7 Radio - New - Remix: Non-Stop^M
icy-genre:Desi, Hindi , Bollywood, Fiji, Indian^M
icy-url:http://www.radioafsana.com^M
content-type:audio/mpeg^M
icy-pub:1^M
icy-metaint:8192^M
icy-br:128^M

Metadata is available as "StreamTitle='Aditi Singh Sharma - Luv Ka The End
- LUV KA THE END."
However I am not able to extract the same.

Also not able to extract the metadata for the downloaded mp3 file using the
following pipelines. However the above command that you mentioned will
extract the metadata for the downloaded mp3 file

appsrc name=mysource ! audio/mpeg  ! mad !  alsasink
appsrc name=mysource ! audio/mpeg  ! mp3parse ! mad !  alsasink
appsrc name=mysource ! audio/mpeg  ! decodebin2 !  alsasink

Your input would be of great help.

Regards,
Sree Gowri.


>
>>
>>
>>
>>
>>>
>>> _______________________________________________
>>> gstreamer-devel mailing listgstreamer-devel at lists.freedesktop.orghttp://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>>
>>>
>>>
>>> _______________________________________________
>>> gstreamer-devel mailing list
>>> gstreamer-devel at lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>>
>>>
>>
>> _______________________________________________
>> gstreamer-devel mailing listgstreamer-devel at lists.freedesktop.orghttp://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>>
>>
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20120425/f97a9a07/attachment-0001.html>


More information about the gstreamer-devel mailing list