DLNA server unrecognized file type: xxx.mkv

What is the problem you are having with rclone?

When I'm trying to serve files over DLNA, I get an error when I'm trying to access a folder with .mkv files, but other files like .mp4 or .jpg are working fine.
I've also tested this using rclone v1.56.2 on Windows 10, but here I get the same error.
I've tested this only using VLC client on iOS 15 and on the Fire TV Stick 4K.
Furthermore, I've also looked into other similar issues like Serve DLNA not working on Samsung TV · Issue #3253 · rclone/rclone · GitHub, but these are not having the same problems as I do.

What is your rclone version (output from rclone version)

rclone v1.56.2

  • os/version: openwrt 19.07.7
  • os/kernel: 4.14.221 (mips)
  • os/type: linux
  • os/arch: mipsle
  • go/version: go1.17.2
  • go/linking: static
  • go/tags: none

Which cloud storage system are you using? (eg Google Drive)

OneDrive for Business

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone serve dlna --read-only --no-checksum --no-modtime -vv onedrive:/Media/

The rclone config contents with secrets removed.

[onedrive]
type = onedrive
token = {"access_token":"xxx"}
drive_id = xxx
drive_type = business

A log from the command with the -vv flag

2021/10/16 17:55:51 DEBUG : rclone: Version "v1.56.2" starting with parameters ["rclone" "serve" "dlna" "--read-only" "--no-checksum" "--no-modtime" "-vv" "onedrive:/Media/"]
2021/10/16 17:55:51 DEBUG : Creating backend with remote "onedrive:/Media/"
2021/10/16 17:55:51 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2021/10/16 17:55:52 DEBUG : fs cache: renaming cache item "onedrive:/Media/" to be canonical "onedrive:Media"
2021/10/16 17:55:52 INFO  : One drive root 'Media': poll-interval is not supported by this remote
2021/10/16 17:55:52 NOTICE: One drive root 'Media': Serving HTTP on [::]:7879
2021/10/16 17:55:52 INFO  : DLNA server on :7879: Started SSDP on eth0
2021/10/16 17:55:52 INFO  : DLNA server on :7879: Started SSDP on eth0.1
2021/10/16 17:55:52 INFO  : DLNA server on :7879: Started SSDP on eth0.2
2021/10/16 17:55:52 INFO  : DLNA server on :7879: Started SSDP on apclix0
2021/10/16 17:55:52 INFO  : DLNA server on :7879: Started SSDP on br-lan
2021/10/16 17:55:52 INFO  : DLNA server on :7879: Started SSDP on ra0
2021/10/16 17:55:52 INFO  : DLNA server on :7879: Started SSDP on rax0
2021/10/16 17:56:13 INFO  : /static/rclone-120x120.png: 192.168.8.248:58284 GET 200
2021/10/16 17:56:13 INFO  : /static/ContentDirectory.xml: 192.168.8.248:58284 GET 200
2021/10/16 17:56:13 INFO  : /ctl: 192.168.8.248:58284 POST 200 "urn:schemas-upnp-org:service:ContentDirectory:1#GetSortCapabilities"
2021/10/16 17:56:14 INFO  : /ctl: 192.168.8.248:58284 POST 200 "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"
2021/10/16 17:56:16 INFO  : /ctl: 192.168.8.248:58284 POST 200 "urn:schemas-upnp-org:service:ContentDirectory:1#GetSortCapabilities"
2021/10/16 17:56:16 INFO  : /ctl: 192.168.8.248:58284 POST 200 "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"
2021/10/16 17:56:19 INFO  : /ctl: 192.168.8.248:58284 POST 200 "urn:schemas-upnp-org:service:ContentDirectory:1#GetSortCapabilities"
2021/10/16 17:56:21 INFO  : /ctl: 192.168.8.248:58284 POST 200 "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"
2021/10/16 17:56:22 INFO  : /ctl: 192.168.8.248:58284 POST 200 "urn:schemas-upnp-org:service:ContentDirectory:1#GetSortCapabilities"
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E01.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E02.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E03.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E04.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E05.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E06.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E07.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E08.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E09.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E10.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E11.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E12.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E13.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E14.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E15.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E16.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E17.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E18.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E19.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E20.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E21.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E22.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E23.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E24.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 DEBUG : DLNA server on :7879: unrecognized file type: Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E25.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv
2021/10/16 17:56:22 INFO  : /ctl: 192.168.8.248:58284 POST 200 "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"

Hi, welcome to the forum.

I'm not very familiar with the dlna feature, but I think this is related to MIME type information. Can you check what the value of MimeType is for one of the files when listing with lsjson, e.g.:

rclone lsjson "onedrive:/Media/Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E01.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv"

hi,

having no issues playing .mkv files using rclone serve dlna

rclone lsjson remote:folder/file.mkv -vv --log-trace
[
{"Path":"file.mkv","Name":"file.mkv","Size":837516929,"MimeType":"video/x-matroska","ModTime":"2021-10-06T19:16:53-04:00","IsDir":false}
]

I get the following response:

rclone lsjson "onedrive:/Media/Anime/Code Geass (2006)/Season 1/Code.Geass.Lelouch.of.the.Rebellion.S01E01.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv"
[
{"Path":"Code.Geass.Lelouch.of.the.Rebellion.S01E01.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv","Name":"Code.Geass.Lelouch.of.the.Rebellion.S01E01.German.PCM.ML.1080p.BluRay.x264-AST4u.mkv","Size":1746777304,"MimeType":"application/octet-stream","ModTime":"2020-05-27T23:31:28Z","IsDir":false,"ID":"xxx"}
]

And the "MimeType":"application/octet-stream" is probably the problem, but how can I fix this?

I've also found this question here, which seems related, but has no answer jet: Graph returning incorrect MIME type for MKV video files - Microsoft Q&A

Yes, I think so too!

It is basically an issue with Onedrive then, and they should fix it. Rclone does not support configuring mime overrides afaik, but perhaps it could somehow..

I just merged this fix serve: do not override mime types from os by albertony · Pull Request #5622 · rclone/rclone · GitHub which is to do with mime types in serve dlna so you might want to try the latest beta 30 minutes from now. I'm not 100% sure it will fix your problem, but it is worth trying!

Interesting idea and there is an obvious place for it now I merged your mime type patch :slight_smile:

Thanks for your quick response, sadly the new beta version hasn't fixed the issue.

I've tested this further and noticed, that this issue only occurs on OneDrive for Business, where it is marked as "MimeType":"application/octet-stream".
On my personal OneDrive with the same test file uploaded, it is correctly marked as type "video/x-matroska".

given that different backends have different behavior, the idea of hardcoding the mine type as a global setting might not be enough.

perhaps this might work
--mime-type-override="mkv:video/x-matroska"

Not unexpected, but thank you for testing.

So I guess this is the problem. Not sure if we can hope Microsoft will fix it soon..? In any case it would make sense to allow overriding this in rclone. Perhaps you can create an issue in github?

hi,
as you were typing, i posted just before you.
did you see it?

That is an option, sure. Would probably cover most cases. I don't know if it would be relevant to also be able to supply a more complete "mime database", not just a few overrides? For example, rclone does use golang's api for mime, which reads it from OS, but it also has a hard coded list with:

minimal number of mime types to augment go's built in types for environments which don't have access to a mime.types file (e.g. Termux on android)

In environments as mentioned it could make sense to be able to not just specify a few "overrides", but a complete mime list to rclone, in some sensible format - e.g. the linux mime.types file format, or perhaps the XML file from https://www.iana.org/assignments/media-types/media-types.xml.

easier and more flexible to just use continue to use whatever the os/backend provides.
override as needed.

the issue with a rclone mime database is that:

  • it will never be complete; will still need to fall back on the undering os/backend.
  • new mime types will be created over time; will still need to fall back on the undering os/backend.
  • database would be hard coded into rclone source code.
  • still no way to override the os/backend, which is what the OP needs.

I did not mean to replace the existing golang/os default. Rather if you were in an environment with no default mime database, or if you wanted to override a lot of them, e.g. from a "trusted" external source. Then it would be convenient to avoid to specify a huge list as an option. But it is true; I haven't thought it through! :smile: Perhaps simple override option is enough.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.