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

Handle "estimateContentLength" on stream endpoint in subsonic api #244

Closed
thelinkin3000 opened this issue Jun 22, 2022 · 3 comments
Closed
Milestone

Comments

@thelinkin3000
Copy link

Hi!

I noticed LMS doesn't handle the "estimateContentLength" parameter on the stream endpoint while using the subsonic api.

The reference for the endpoint is here http://subsonic.org/pages/api.jsp#stream

The handling of this parameter is useful for players such as VLC. Wihtout the Content-Length HTTP header set to some reasonable value, VLC does not report a current position while playing, thus the client can't report the current position nor seek to a desired position.

Note that this only happens when transcoding. If I disable transcoding on the server the error goes away and VLC reports position as expected.

@epoupon epoupon modified the milestone: v3.31.0 Jul 13, 2022
@epoupon epoupon pinned this issue Aug 18, 2022
@epoupon
Copy link
Owner

epoupon commented Aug 18, 2022

Hello,

Just tried this, and I am a bit puzzled:

  • if we set a Content-Length header that is too small, the produced file is truncated.
  • if we set a Content-Length header that is too big, we have to pad with 0 to satisfy clients, and I am not sure it is always a good idea for audio formats (maybe that's fine for the output formats supported by lms, will have to check)
  • but what about embedded metadata and pictures If we keep them while transcoding? It becomes quite tricky to calculate an accurate output size.

Do you know how other servers handle these problems?

@epoupon
Copy link
Owner

epoupon commented Aug 19, 2022

Some updates:

  • setting a smaller value will make MP3 and Ogg/Opus correctly be detected and played by VLC (but truncated)
  • setting a higher value (pad with 0) will make MP3 files show higher durations (but VLC stops playing at the end of the actual transcoded file). However for Ogg/Opus files the duration is not displayed.

@epoupon
Copy link
Owner

epoupon commented Aug 20, 2022

Well let's go for a basic guess for Content-Length for now...

@epoupon epoupon closed this as completed Aug 20, 2022
@epoupon epoupon unpinned this issue Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants