[Gambas-user] Icecast catching metadata using gambas

T Lee Davidson t.lee.davidson at gmail.com
Wed Nov 8 18:19:52 CET 2023


On 11/8/23 09:26, Martín wrote:
> Hi,
> 
> I try to get metadata from a stream source with
> 
> $ curl -H "Icy-MetaData:1" -v "https://stream.io/thestream.mp3" >/dev/null
> 
> Then I get this:
> 
> ...
> 
>  > Icy-MetaData:1
> 
> < icy-br:192
> < icy-description: Description of the stream
> < icy-genre:Radio
> < icy-name:Name of the stream
> < icy-pub:1
> < icy-url:http://stream.io
> < icy-metaint:16000
> 
> ...
> 
> But i want to know the tag "StreamTitle" but it is not present. Ii I use mpg123 for the same stream URL I get the info:
> 
> $ mpg123 https://stream.io/thestream.mp3
> ...
> 
> ICY-NAME: xxxxxx
> ICY-URL: http://stream.io
> MPEG 1.0 L III cbr192 48000 j-s
> ICY-META: StreamTitle='This is the title';
> 
> So it is possible to access to all the metadata of the stream in gambas? Gstramer maybe?
> 
> I try to get some info from MediaPlayer class without success.
> 
> Sample:
> 
> $Media = New MediaPlayer As "Player"
> $Media.URL = "http://ec3.yesstreaming.net:4500/stream"
> 
> Thanks.

Sorry, I can't help much; if at all. I can't even try out what you're doing.

With your `curl` command, I get:
< HTTP/1.1 403 Forbidden
< Content-Type: application/xml
< Transfer-Encoding: chunked
< Connection: keep-alive
< Date: Wed, 08 Nov 2023 16:46:08 GMT
< Server: AmazonS3
< X-Cache: Error from cloudfront
< Via: 1.1 4bc6659eecc0a4bfcaa0abdbfb655888.cloudfront.net (CloudFront)
< X-Amz-Cf-Pop: ORD58-P2
< X-Amz-Cf-Id: 3bDOrwF83c6bsn7_t_6lHgOnX904E0sl6XyHRRtOrKsjLHbns2gWMA==

And, with your `mpg123` command, I get:
[src/libmpg123/readers.c:1204] error: Cannot open file https://stream.io/thestream.mp3: No such file or directory
main: [src/mpg123.c:738] error: Cannot open https://stream.io/thestream.mp3: File access error. (code 22)

I see that Gstreamer has a GstDiscoverer command-line utility [1]. It provides a 'title' property, but I have no idea if that is 
what you need or if it is even accurate.

[1] https://gstreamer.freedesktop.org/documentation/tutorials/basic/media-information-gathering.html


-- 
Lee



More information about the User mailing list