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

unneeded multiplication by 8 when parsing bitrate #70

Open
mczerski opened this issue Nov 26, 2020 · 7 comments
Open

unneeded multiplication by 8 when parsing bitrate #70

mczerski opened this issue Nov 26, 2020 · 7 comments

Comments

@mczerski
Copy link

bitrate=obj.get("Bitrate", 0) * 8 or None,

I guess it should be not multiplied by 8 as bitrate is already in kbits/s

@tkem
Copy link
Owner

tkem commented Nov 27, 2020

What makes you think so? What does your media server report?

@mczerski
Copy link
Author

Well, the "Bitrate" string implies it is in bits not bytes. It not implies that is is in kilo bits though. I don't know the dlna protocol so I don't know if the protocol even defines if it is kbits or bits. But my media server is reporting in kbits.

@tkem
Copy link
Owner

tkem commented Nov 27, 2020

B.2.1.6 res@bitrate Namespace: DIDL-LiteProperty Data Type: xsd:unsignedInt Multi-Valued: NO
Description: The res@bitrate property indicates the bitrate in bytes/second of the encoding of the resource.Note that there exists an inconsistency with a res@bitrate property name and its value being expressed in bytes/sec.

http://www.upnp.org/specs/av/UPnP-av-ContentDirectory-v4-Service.pdf

So your assumptions are based on one particular media server implementation, right? So it would be kind of helpful to mention which one...

@mczerski
Copy link
Author

LOL, so they admit in the protocol definition that they are INCONSISTENT.
My NAS is Linksys WRT120AC router, which is using Twonky media server I believe.
So According to the specification You posted it should be * 8 / 1000 not only * 8. Mopidy requires the bitrate in kbits: Track

@tkem
Copy link
Owner

tkem commented Nov 27, 2020

AFAIK, this hasn't been resolved, really: mopidy/mopidy#1514

@mczerski
Copy link
Author

ok, whatever. You can close the issue. I don't need the bitrate, it just seemed something is wrong to me while I was tinkering with the code.

@tkem
Copy link
Owner

tkem commented Nov 27, 2020

yeah, this was never cleanly specified nor implemented, but nobody seemed to care too much about "bitrate"...
I'll leave this open, at least for future reference.

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

No branches or pull requests

2 participants