anacrolix / dms

A UPnP DLNA Digital Media Server that includes basic video transcoding. Tested on a Panasonic Viera television, several Android UPnP apps, and Chromecast.
BSD 3-Clause "New" or "Revised" License
647 stars 97 forks source link

Dynamic audio streams #137

Closed groupmsl closed 11 months ago

groupmsl commented 11 months ago

I wanted to use DMS to transcode a radio stream that isn't compatible with my older internet radio. Previously all dynamic streams were treated as video content, regardless of the content.

This adds a new parameter to the *.dms.json format. "Type", which specifies whether it should be exported over DLNA as video or audio. If omitted it defaults to video, to remain backward compatible.

I could have used the "MimeType" of the resource in the *.dms.json, but I decided not do, as "Resources" is an array/list, so I would need to parse all items to check for the type of all of them. If you think this would be better, let me know. If so, I assume we would export as video unless all resources in a given file were audio?

groupmsl commented 11 months ago

(Tested (and used for the past 9 months) on a number of Yamaha hifi devices)

anacrolix commented 11 months ago

I could have used the "MimeType" of the resource in the *.dms.json, but I decided not do, as "Resources" is an array/list, so I would need to parse all items to check for the type of all of them. If you think this would be better, let me know. If so, I assume we would export as video unless all resources in a given file were audio?

I think you made a good call here. It would be ambiguous and fickle to try to determine it from the Resources or from Title. If dynamic streams were built from a single input file it would make sense, but this is not the case (this is the first thing I verified).

anacrolix commented 11 months ago

Great work, thank you!