Howto determine size?

Stef Bon stefbon at
Wed Jul 6 06:08:04 PDT 2011

2011/7/6 Stefan Kost <ensonic at>:
> On 07/05/11 01:31, Stef Bon wrote:
>> Hi,
>> I've written a gstreamer program (my first!) . See at bottom of email.
>> It just plays an mp3 file. What I'm interested in is the progress of
>> bytes decoded and the final size.
>> Now the program gives the "size " in seconds, not in bytes. That's not
>> aproblem, but first the total duration is false:
>> It should be 2:57 in stead of 3:12.
>> sbon [ ~/Programmeren/testgst ]$ ./test /home/sbon/Music/The\ Doors\
>> The\ Ultimate\ Best\ Of\ 2011\ Remastered\ 320\ Kbps/02\ Strange\
>> Days.mp3
>> Time: 0:00:05.074126984 / 0:03:12.604200000
>> (break using Ctrl-C)
>> When rewriting it to use the bytes, it also does not report the right
>> size. Instead of the format GST_FORMAT_TIME, I've used
>> GST_FORMAT_BYTES, and of course another format of the g_print
>> function. But then a far to small size is reported when printing len.
> I'd say use decodebin2 directly or also plug mp3parse before mad. Wonder
> where the bug come from though, filesrc should report the file-size in
> bytes correctly. You could check who answered the duration query.

Thanks for your reply,

I've added mp3parse, and now I get more sensible output.

I would like to use the decoder/encoder encodebin, but that requires a
profile. Can you give an example of that?


More information about the gstreamer-devel mailing list