Skip to content
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

Make encoder header more robust by using a callback. #3276

Merged
merged 1 commit into from
Jul 28, 2023
Merged

Make encoder header more robust by using a callback. #3276

merged 1 commit into from
Jul 28, 2023

Conversation

toots
Copy link
Member

@toots toots commented Jul 28, 2023

Fixes: #3265

@DigiBC
Copy link

DigiBC commented Jul 28, 2023

@toots

Maybe I'm too late because you're working on a fix already, but here's an observation of the original issue that I'd like to share with you:
Most streaming clients fail with an error while VLC keeps the HTTP connection and continues "listening". As soon as there's a track change in Liquidsoap which results in a new logical OGG stream, VLC suddenly starts playback. (VLC playback isn't seamless on track changes, but that's a flaw of VLC.)

@toots
Copy link
Member Author

toots commented Jul 28, 2023

@DigiBC yeah that tracks. We had a mechanism to keep the last ogg header on hand to send to the client on initial connection and it got broken somehow. This PR fixes it.

Couple of things worth noting:

  • FFmpeg is bad with chained ogg streams so input.http might not be super well behaved with live ogg streams
  • The header support is only for the various internal %ogg encoders (including %vorbis and etc). It won't work with %ffmpeg ogg support. It should work with %wav tho, which is nice but anecdotical.

Overall, and quite regretfully, looking at back over time really shows that the ogg spec for chaining tracks is pretty bad. It was never well understood or implemented correctly and we might have had it wrong for some formats for years too (see this explanation).

At this point, I would recommend avoiding the ogg container unless you are willing to strip all track marks and metadata. The number of decoder/clients who get it wrong is just too big.

@DigiBC
Copy link

DigiBC commented Jul 28, 2023

@toots

Many thanks for the explanation!
I agree that OGG FLAC has quite some flaws, but so far I've had only good experience with output.harbor feeding a digital radio audio encoder with built-in GStreamer and ICY metadata support on the same machine. The stream works perfectly and without any glitches for months...
I'd like to continue to do that. ☺️

@toots
Copy link
Member Author

toots commented Jul 28, 2023

Ha yes, if you have control over the listener or for a limited exposure it's a different story of course.

@toots toots added this pull request to the merge queue Jul 28, 2023
Merged via the queue into main with commit 318cba9 Jul 28, 2023
27 checks passed
@toots toots deleted the fix-3265 branch July 28, 2023 18:55
@DigiBC
Copy link

DigiBC commented Jul 28, 2023

After testing the artefact liquidsoap-fix-3265_2.3.0-ubuntu-jammy-1_amd64.deb I can confirm that it works again!
Thank you!
👍

@toots
Copy link
Member Author

toots commented Jul 28, 2023

Great! Just pushed the patch to the next rolling release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[v2.2.0] output.harbor OGG container broken
2 participants