BASSEnc Server - Setting any type of metadata

Started by anes08,

anes08

Hello, it's been long since my last question here, i've been using BASS for 5-6 years now and i'm loving it. i made a music player with it if you want to check it out QuickBeat. I want to add a broadcast feature on my player i was digging on ways to do one and found BASS_Encode_ServerInit i set it up with BASSenc STDIN encoders and i got white noise, switched to BASSenc_MP3 with lame and the stream is working fine now on 320kbps. I want to add tags to my stream, i tried BASS_Encode_CastSetTitle but the new title didn't show on Chrome, VLC, Windows Media Player, the BASS_Encode_CastSendMeta since it is intended for shoutcast as far as i know. What are the metadata types (title, artist, album, cover...) that i can set using BASS built in server ?
Thank you.




suathd

I think the MetaData content depends on the Media Servers (Shoutcast, Icecast etc).

In Shoutcast, you can just set Title, DJ and Url (query parameters are "song", "dj", "url").
In Icecast, you can just set Title and Url (query parameters are "song", "url").

all the parameters must be type of char (not unicode or widechar). they may be utf-8 encoded.

there are 2 types of tags stored in those servers

1) Stream embedded tags: in this type, tags are hosted with audio periodically (e.g after every 16000 bytes).
It is the best way to synchronize audio and tags. but due to CORS (Cross Origin Resourse Sharing) limitations, Internet browsers cannot read tags by this way. Because your web page domain and stream server's domains are different. Some media servers (Icecast KH, Wowza etc. overcomes this problem).

2) Out of Stream Tags: you can read metadata by making request for JSON or XML Data.
In this method; the major problem is synchronization. If your audio stream has 10 seconds delay, meta tag change will occur 10 seconds before the audio. You can measure the delay and compansate it.

here is an opensource link for reading metadata by java script written by me.
https://june8fm.com/
it supports both Shoutcast and Icecast.

finally, check your code for sending meta data as 8 bit characters.



anes08

the built in server is a HLS server as far as i know, will the connected players check for available tags from all protocols (ice, shout...) or should i add specific headers to the connection request?

suathd

Quote from: anes08the built in server is a HLS server as far as i know, will the connected players check for available tags from all protocols (ice, shout...) or should i add specific headers to the connection request?

if you will not send blob data (logo, album photo etc.), you will just need BASS_Encode_CastSetTitle (for setting just title value). title string can contain both artist name and song name. you don't need to check available tags. just use title tag and url tag. url tag may contain the link for album photo, artist photo etc.

I know that an HLS server is not a stand alone server. it is connected to a Shoutcast or an Icecast server and hosts both metadata and audio (behaves like proxy server).

 

Chris

Hi i saw here some bugs in your code.
bass_enc and bassenc_mp3 are both not plugins, they are addons .
so you can remove the 2 bass_plugin.load calls .
the second parameter of the bassenc_mp3 looks like wrong.
BASS_Encode_MP3_Start will have a build in Lame.
So i suggest something like
BASS_Encode_MP3_Start(stream,"-b 320" .........
see here https://www.radio42.com/bass/help/html/29c0e9db-7664-17e7-8baf-070b6bef1911.htm

with the flag BASS_ENCODE_SERVER_META   , you can send Shoutcast MetaData.
https://www.radio42.com/bass/help/html/1e627f23-f551-26aa-f0d4-cd8427b3fdf5.htm

Ian @ un4seen

Quote from: anes08the built in server is a HLS server as far as i know, will the connected players check for available tags from all protocols (ice, shout...) or should i add specific headers to the connection request?

BASS_Encode_ServerInit actually implements a server much more like a Shoutcast/Icecast server than an HLS server. The BASS_ENCODE_SERVER_META flag enables Shoutcast metadata, which can then be updated via BASS_Encode_CastSetTitle. From the code in the first post, it looks like you are already doing that, but note not all players support Shoutcast metadata. Of the players you mention, I believe VLC does support it, but not Chrome or Windows Media Player. If you aren't seeing your metadata in VLC, please try the pre-compiled SERVER-ADDONS.EXE example from the BASSenc package (C\BIN folder) and see if title updates work with that. If that's not working either, please confirm what VLC version you're using (and try upgrading if it isn't the latest).