Track_Number of container formats like wma,asf, ogg

classic Classic list List threaded Threaded
4 messages Options
kcu
Reply | Threaded
Open this post in threaded view
|

Track_Number of container formats like wma,asf, ogg

kcu
Hi,

I am trying to develop a gstreamer based media player, To print track number i am doing this
BOMBAY_AWAKENS.wma
if(!gst_tag_list_get_uint(tagList, GST_TAG_TRACK_NUMBER,
                    &TrackNumber))
        {
            TrackNumber = 0;
        }

It works fine for mp3 and aac, only for wma,asf & ogg files track number is always 0,( tried with different files, gst_tag_list_get_uint is returning false )

what might be wrong?
Reply | Threaded
Open this post in threaded view
|

Re: Track_Number of container formats like wma,asf, ogg

yannick inizan
here an sample in Vala : 

public static void main (string[] args) {
Gst.init (ref args);
var pb = Gst.ElementFactory.make ("playbin", "playbin");
pb["uri"] = "file:///home/yannick/Musique/test.wma";
pb.bus.add_watch (0, (bus, message) => {
switch (message.type) {
case Gst.MessageType.TAG:
Gst.TagList list;
message.parse_tag (out list);
uint track;
list.get_uint ("track-number", out track);
print (@"$track\n");
break;
}
return true;
});
pb.set_state (Gst.State.PLAYING);
new MainLoop().run();
}

I found TAG type twice. first message with 7 as track number and 0 in second message. may be you could save a static tag list and save tag only if his value changed

2015-06-23 13:28 GMT+02:00 kcu <[hidden email]>:
Hi,

I am trying to develop a gstreamer based media player, To print track number
i am doing this
BOMBAY_AWAKENS.wma
<http://gstreamer-devel.966125.n4.nabble.com/file/n4672414/BOMBAY_AWAKENS.wma>
if(!gst_tag_list_get_uint(tagList, GST_TAG_TRACK_NUMBER,
                    &TrackNumber))
        {
            TrackNumber = 0;
        }

It works fine for mp3 and aac, only for wma,asf & ogg files track number is
always 0,( tried with different files, gst_tag_list_get_uint is returning
false )

what might be wrong?



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Track-Number-of-container-formats-like-wma-asf-ogg-tp4672414.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Track_Number of container formats like wma,asf, ogg

Thiago Santos-3
In reply to this post by kcu
On 06/23/2015 08:28 AM, kcu wrote:

> Hi,
>
> I am trying to develop a gstreamer based media player, To print track number
> i am doing this
> BOMBAY_AWAKENS.wma
> <http://gstreamer-devel.966125.n4.nabble.com/file/n4672414/BOMBAY_AWAKENS.wma>
> if(!gst_tag_list_get_uint(tagList, GST_TAG_TRACK_NUMBER,
>                      &TrackNumber))
>          {
>              TrackNumber = 0;
>          }
>
> It works fine for mp3 and aac, only for wma,asf & ogg files track number is
> always 0,( tried with different files, gst_tag_list_get_uint is returning
> false )
>
> what might be wrong?
Are you sure the tracks you've been using as wma/asf/ogg have the track
number tag in them? Did you try a recent version? 1.4.5 or 1.5 or git
master?

It would be nice to test with a recent version and see if it still
doesn't work. In that case, please open a bug and put a link to the
files that aren't having the tags extracted properly.

If, for some reason, you are unable to test with a recent version please
open a bug anyway and link the files there so someone might try to
reproduce with git master.

Thanks,

>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Track-Number-of-container-formats-like-wma-asf-ogg-tp4672414.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


--
Thiago Sousa Santos
Senior Multimedia Engineer, Open Source Group
Samsung Research America - Silicon Valley

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
kcu
Reply | Threaded
Open this post in threaded view
|

Re: Track_Number of container formats like wma,asf, ogg

kcu
I used gst-discoverer-0.10 in terminal to check the tags, it showed like this,

gst-discoverer-0.10 BOMBAY\ AWAKENS.wma
Analyzing file:///home/kcu/BOMBAY%20AWAKENS.wma
Done discovering file:///home/kcu/BOMBAY%20AWAKENS.wma

Topology:
  container: Advanced Streaming Format (ASF)
    audio: Windows Media Audio 8

Properties:
  Duration: 0:02:18.541000000
  Seekable: yes
  Tags:
      title: BOMBAY AWAKENS
      artist: { "AR\ REHMAN", "A.R.\ Rahman" }
      date: 2002-01-01
      album: BOMBAY DREAMS
      track number: 1
      container format: ASF
      audio codec: WMA Version 8

so i guess track no is present in tags. Hence I used discoverer, and modified my code as below,

    GstDiscoverer *disc = NULL;
    GstDiscovererInfo *info = NULL;
    GstDiscovererStreamInfo *sinfo = NULL;
    GError *err = NULL;
    gchar file[200] = "file:///home/kcu/";
    GstTagList *tglst = NULL;
    guint tno = 0;
    GstDiscovererResult result = 0;

    disc = gst_discoverer_new(3*GST_SECOND,&err);
    if(!disc)
    {
        printf("\nDiscoverer creation failed");
        printf("\nMessage : %s \n",err->message);
    }
    strcat(file,gData->currentPlayParams.playparam.FileSystem.filename);
    info = gst_discoverer_discover_uri(disc,file, &err);
    result =  gst_discoverer_info_get_result(info);

    if(result == GST_DISCOVERER_OK)
       printf("Discoverer OK\n");
    else if(result == GST_DISCOVERER_ERROR)
       printf("Error, Message:%s\n",err->message);
    else if(result == GST_DISCOVERER_TIMEOUT)
       printf("Time out\n");

    sinfo = gst_discoverer_info_get_stream_info(info);
    if(sinfo != NULL)  printf("\nsinfo not null\n");
    tglst = (GstTagList *) gst_discoverer_stream_info_get_tags(sinfo);

    if(tglst != NULL)
    {
    printf("\ntaglist is not null\n");
    if(gst_tag_list_get_uint(tglst, /*GST_TAG_TRACK_NUMBER*/"track-number",
                    &tno))
           printf("\n T.No: %u\n",tno);
    }
    else printf("\n tag is null\n");


but i am always getting tag is null, am i doing something wrong?
I have attached the file for your reference
BOMBAY_AWAKENS.wma