-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty metadata when streaming to icecast with opus encoder #70
Comments
Unfortunately, Opus does not support Vorbis comments, therefore adding tag support requires implementing it from scratch. But what MPD falls back to is Icy tags, which it enables if your streaming client asks for it. Please confirm that MPD did not send Icy tags, even though your client requested it! |
I have no clue how to confirm that. Verbose MPD log:
But I noticed something that can be a clue why icy tags are not working - when I try to update metadata from Icecast admin panel, I get:
Probably Icecast for some reason doesn't have icy metadata on for opus mountpoint, and since MPD doesn't write opus metadata either, fallback doesn't work by default. I'm wondering if we can't enable metadata write in opus ogg container until we can get proper opus metadata support. Last time I checked, VLC nicely displayed ogg metadata that were included in opus container, even though it's not the "default" way of doing that. What I mean is that VLC can handle both opus metadata, as well as ogg metadata, and since we're using ogg container for opus already, maybe we can use it as a workaround until we can implement proper support for opus metadata. Anyway, I'll try to reach icecast folks over not accepting URL updates, as that's part of the issue I'm having. However, having proper support for opus metadata in MPD can be nice as well, so I'm leaving the issue open, unless you want to close it of course. In any case, thanks a lot for your response and entire work on MPD! 💓. |
If it helps, I compiled latest icecast from source (version 2.4.99.1) and I took a look into the logs.
Most important part is right here:
This means that MPD properly tries to use icy tags, however, icecast doesn't support them for Opus streams.
But according to this, there is some support for Opus tags inside icecast, probably from the stream itself, via |
Thank you for posting this. I have the same issues since a few months but my English is not very good at this time, due to my mother language is Spanish and I felt that maybe MaxKellermann wouldn't understand me. And thanks Max for making MPD a great program to handle music. |
I've been trying to modify opus encoder's code to add tags support. So far I got it working initially (it sends proper metadata when I connect via http) but it's still incorrect for changing track. |
That's great to hear @cathugger! Sadly I'm not able to help since I have no clue myself how it should work, but I'm very happy to hear that somebody decided to pick it up. Please don't hesitate to send PR once you get it fully working, and all the best! 👍 |
@JustArchi I don't have too much clue myself tbh, I barely got it work initially but because of not knowing all details I wasn't able to make it work properly no matter how much random tweaks I threw at it. |
@JustArchi offtopic, but don't use "quality" parameter for opus codec, as it's ignored. use "bitrate" instead. |
https://github.com/cathugger/MPD/tree/opustags it's incomplete but somehow works on vlc, I'm pretty sure I'm doing something wrong still |
I've compiled latest MPD from source with your changes and I'm very positively shocked - it does indeed seem to work just fine with my VLC! 💓 You've done incredible, I'm keeping this build around for a while and looking for future improvements. Please send @MaxKellermann a pull request once you feel that you're satisfied with it so we can have it reviewed and merged into the upstream. I'll also be happy to test any changes you do in the meantime. In short, huge kudos to you! 💓 |
after looking around for a bit, I stumbled upon https://trac.videolan.org/vlc/ticket/18401 and https://jmvalin.ca/misc_stuff/chain_works.opus which is supposed to be well-encoded but mpv throws exactly same errors as my for code.. |
at this point it seems that having a flag to opt-in opus stream chaining support would be desirable |
should I name option "chaining" or "opustags"? I'm currently thinking about "chaining", as it's more technical and could be applied for flac-in-ogg too (incase that would get implemented in future). |
it seems to kinda work for vlc but it still complains about some mismatches, and I'm unsure about clients which doesn't support chained opus yet (like mplayer and mpv), they probably will actually play pre-skip data as silence as they don't parse headers properly and don't take pre-skip value in them into account... |
Anyways, I'll wait for any of mpd devs to review current code before making PR. |
I did some tests with various players and tracks which are meant to be played in gapless way.
So https://wiki.xiph.org/OggOpusImplementation seems to be accurate. |
|
I changed my mind about using "chaining" to indicate feature, as support of clients will depend on particular codec. |
@MaxKellermann Could you help us with any of this? I'd love to have this sorted out, and it seems @cathugger already managed to cover majority of what has to be fixed, we're only after that stutter now, that I also reproduced quite reliably. I love how we have half-baked implementation ready, proving that what we're doing here is in fact possible, we just need somebody with enough knowledge to glue this all together and fix once for good 🙂 |
@JustArchi I'm actually quite confident with my current implementation, but poor client support is quite disappointing. |
this ticket seems to be forgotten at this point. |
Oh, yes, please. Always PR if you have code, even if you're not sure if it's good enough yet. |
@JustArchi it got merged to master |
Since the feature eventually made it in, for which I'm very grateful, I'll close the issue for now since there is no ongoing work required for this. Thanks! |
Hello.
Consider following
audio_output
:With above audio output, streaming to icecast server works totally fine and I verified that data is indeed encoded into opus. Sadly, there is no metadata being announced, which makes it impossible to guess song that is currently being played - only
name
of the radio station is being displayed.Since that info is available in other encoders, mainly
vorbis
, could it be added into opus encoding as well? I'd like to use opus encoder with MPD metadata.Thank you in advance.
The text was updated successfully, but these errors were encountered: