Audio Metadata

Stefan Sauer ensonic at hora-obscura.de
Wed Jul 4 10:51:33 PDT 2012


On 07/02/2012 03:09 PM, Sree Gowri wrote:
>
>
> On Fri, May 4, 2012 at 11:22 AM, Sree Gowri <sreegowris at gmail.com
> <mailto:sreegowris at gmail.com>> wrote:
>
>
>
>     On Fri, Apr 27, 2012 at 1:13 AM, Stefan Sauer
>     <ensonic at hora-obscura.de <mailto:ensonic at hora-obscura.de>> wrote:
>
>         On 04/26/2012 07:53 PM, Sree Gowri wrote:
>>
>>
>>         On Wed, Apr 25, 2012 at 12:19 PM, Sree Gowri
>>         <sreegowris at gmail.com <mailto:sreegowris at gmail.com>> wrote:
>>
>>
>>
>>             On Tue, Apr 24, 2012 at 9:42 PM, Sree Gowri
>>             <sreegowris at gmail.com <mailto:sreegowris at gmail.com>> wrote:
>>
>>
>>
>>                 On Tue, Apr 24, 2012 at 5:46 PM, Stefan Sauer
>>                 <ensonic at hora-obscura.de
>>                 <mailto: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
>>>                     <mailto: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 list
>>>>                         gstreamer-devel at lists.freedesktop.org <mailto:gstreamer-devel at lists.freedesktop.org>
>>>>                         http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>>
>>>
>>>                         _______________________________________________
>>>                         gstreamer-devel mailing list
>>>                         gstreamer-devel at lists.freedesktop.org
>>>                         <mailto:gstreamer-devel at lists.freedesktop.org>
>>>                         http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>>
>>>
>>>
>>>                     _______________________________________________
>>>                     gstreamer-devel mailing list
>>>                     gstreamer-devel at lists.freedesktop.org <mailto:gstreamer-devel at lists.freedesktop.org>
>>>                     http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>>
>>                     _______________________________________________
>>                     gstreamer-devel mailing list
>>                     gstreamer-devel at lists.freedesktop.org
>>                     <mailto:gstreamer-devel at lists.freedesktop.org>
>>                     http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>>
>>             Hi Stephan,
>>
>>
>>         I am still stuck with metadata parsing as mentioned earlier.
>>         Could you please help me.
>>
>>         Thanks and Regards,
>>         Sree Gowri
>
>         Just tried te winamp stream from http://www.radioafsana.com
>         and it works fine (use the uri from inside the listen.pls).
>
>         Stefan
>
>         gst-launch -t playbin2 uri=http://208.186.112.40:8000/
>         Setting pipeline to PAUSED ...
>         Pipeline is PREROLLING ...
>         FOUND TAG      : found by element "source".
>             organization: Radio Afsana Online 24/7 Radio - New -
>         Remix: Non-Stop
>                    genre: Desi, Hindi , Bollywood, Fiji, Indian
>                 location: http://www.radioafsana.com
>         FOUND TAG      : found by element "icydemux0".
>             organization: Radio Afsana Online 24/7 Radio - New -
>         Remix: Non-Stop
>                    genre: Desi, Hindi , Bollywood, Fiji, Indian
>                 location: http://www.radioafsana.com
>         FOUND TAG      : found by element "mpegaudioparse0".
>              audio codec: MPEG 2 Audio, Layer 3 (MP3)
>          nominal bitrate: 24000
>         FOUND TAG      : found by element "mpegaudioparse0".
>                  has crc: FALSE
>             channel mode: mono
>         FOUND TAG      : found by element "mad0".
>              audio codec: MPEG-1 Layer 3 (MP3)
>         FOUND TAG      : found by element "mpegaudioparse0".
>          minimum bitrate: 24193
>                  bitrate: 24010
>          maximum bitrate: 24193
>         FOUND TAG      : found by element "mpegaudioparse0".
>          minimum bitrate: 23887
>         Prerolled, waiting for buffering to finish...
>         Pipeline is PREROLLED ...
>         Setting pipeline to PLAYING ...
>         New clock: GstPulseSinkClock
>         FOUND TAG      : found by element "icydemux0".
>                    title: Shahid Mallya - Rabba Main Toh Mar Gaya Oye
>         - MAUSAM [2011]
>>
>>
>>         _______________________________________________
>>         gstreamer-devel mailing list
>>         gstreamer-devel at lists.freedesktop.org <mailto:gstreamer-devel at lists.freedesktop.org>
>>         http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>         ______________________________________________
>         gstreamer-devel mailing list
>         gstreamer-devel at lists.freedesktop.org
>         <mailto:gstreamer-devel at lists.freedesktop.org>
>         http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
>     Hi Stephan,
>
>     Using http request along with gstreamer is working fine along with
>     the metadata.
>
>     However I would like to extract the metadata from the buffer that
>     is fed to the appsrc element.
>
>     Encountered the following error using the pipelines where
>     downloading and feeding data is happening parallely
>
>
>     "appsrc name=mysource ! audio/mpeg  ! decodebin2 !  alsasink"
>     "appsrc name=mysource ! audio/mpeg  ! mp3parse ! mad !  alsasink"
>
>     ####
>     ERROR from element mpegaudioparse0: Failed to parse stream
>     Debugging info: gstbaseparse.c(2140): gst_base_parse_check_sync
>     ():
>     /GstPipeline:pipeline0/GstDecodeBin2:decodebin20/GstMpegAudioParse:mpegaudioparse0
>     ERROR from element mysource: Internal data flow error.
>     Debugging info: gstbasesrc.c(2582): gst_base_src_loop ():
>     /GstPipeline:pipeline0/GstAppSrc:mysource:
>     streaming task paused, reason error (-5)
>     ERROR from element mpegaudioparse0: Failed to parse stream
>     Debugging info: gstbaseparse.c(2140): gst_base_parse_check_sync
>     ():
>     /GstPipeline:pipeline0/GstDecodeBin2:decodebin20/GstMpegAudioParse:mpegaudioparse0
>     ERROR from element mpegaudioparse0: No valid frames found before
>     end of stream
>     Debugging info: gstbaseparse.c(1037):
>     gst_base_parse_sink_eventfunc ():
>     /GstPipeline:pipeline0/GstDecodeBin2:decodebin20/GstMpegAudioParse:mpegaudioparse0
>     ERROR from element decodebin20: GStreamer encountered a general
>     stream error.
>     Debugging info: gstdecodebin2.c(3239): gst_decode_bin_expose ():
>     /GstPipeline:pipeline0/GstDecodeBin2:decodebin20:
>     all streams without buffers
>     * About to connect() to scfire-dtc-aa03.stream.aol.com
>     <http://scfire-dtc-aa03.stream.aol.com> port 80 (#0)
>     *   Trying 205.188.234.3... * connected
>     * Connected to scfire-dtc-aa03.stream.aol.com
>     <http://scfire-dtc-aa03.stream.aol.com> (205.188.234.3) port 80 (#0)
>     > GET /stream/1013 HTTP/1.1
>     Host: scfire-dtc-aa03.stream.aol.com
>     <http://scfire-dtc-aa03.stream.aol.com>
>     Accept: */*
>     ####
>
>     Request your kind inputs on this.
>
>     Thanks and Reards,
>     Sree Gowri
>
>
>
> Hi Stephan,
>
> Unfortunately I was not able to work on extracting audio metadata from
> buffer from last 2 months.I started working on this again.
>
> Using curl, audio data is downloaded and using the following
> pipeline(all three pipelines work), I am able to play the buffer data.
> However not able to extract the streamtitle metadata. Other metadata
> has been extracted like layer,mode,bitrate etc..
>
> app->pipeline= gst_parse_launch("appsrc name=mysource ! audio/mpeg !
> mad ! alsasink", NULL);
> app->pipeline= gst_parse_launch("appsrc name=mysource ! audio/mpeg  !
> decodebin2 !  alsasink", NULL);
> app->pipeline= gst_parse_launch("appsrc name=mysource ! audio/mpeg  !
> mp3parse ! mad !  alsasink", NULL);
>
> I tried even setting "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7"
> in curl before sending http request but still not able to extract the
> metadata.
>
> I somehow feel some prerequisites needs to be set in the curl before
> sending http request for downloading buffer. It would be really great
> to have your suggestions on this.
If you run gst-launch -tv playbin2 uri=http://208.186.112.40:8000/ you
will see which elements post the metadata in the above example.

Stefan
>
> Thanks and Regards,
> Sree,
>
>
>
> _______________________________________________
> 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/20120704/34aa24d4/attachment-0001.html>


More information about the gstreamer-devel mailing list