v19 Setup a rule to play all dolby vision content with an external player?
#1
Hi there,

Some content I have is encoded using the Dolby Vision codec, which is not supported in software by Kodi or in hardware by my Mac Mini or my TV, and so the colours are wrong:

Code:

❯ mediainfo ~/Downloads/example-2160p.mp4
General
Complete name                            : /home/john/Downloads/example-2160p.mp4
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (isom/mp42/dby1)
File size                                : 7.13 GiB
Duration                                 : 1 h 3 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 16.2 Mb/s
Encoded date                             : UTC 2021-12-17 09:30:58
Tagged date                              : UTC 2021-12-17 09:30:58

Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5@Main
HDR format                               : Dolby Vision, Version 1.0, dvhe.05.06, BL+RPU
Codec ID                                 : dvhe
Codec ID/Info                            : High Efficiency Video Coding with Dolby Vision
Duration                                 : 1 h 3 min
Bit rate                                 : 15.4 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 24.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.077
Stream size                              : 6.79 GiB (95%)
Default                                  : Yes
Alternate group                          : 1
Encoded date                             : UTC 2021-12-17 09:30:26
Tagged date                              : UTC 2021-12-17 09:31:07
Color range                              : Full
Codec configuration box                  : hvcC+dvcC

<snip>

I happen to have a license for Infuse 7, which does have Dolby vision support! Having tested the file, it plays perfectly.

I would prefer to use Kodi's built-in media player for all content except Dolby Vision content. Looking at the external players documentation in the wiki, it seems that "rules" can be setup to define when an external player might be used.

My problem is that I'm unsure how to select for videos which use the Dolby Vision codec: is this possible?
Reply
#2
You probably want a rule similar to this

xml:
<rules action="prepend">
    <rule name="dolby-vision" filename=".*dolbyvision*." player="foo"/>
</rules>

That should match any filename with dolbyvision in it somewhere.  F.e., My.Awesome.Movie.dolbyvision.4k.mkv.

The regex says .* - any bunch of characters, including none at all, followed by dolbyvision, followed by any bunch of characters (or none).  You should have enough info now to customize it to your liking.
Learning Linux the hard way !!
Reply
#3
Currently my files are not kept in such a fashion that I could find out their codec from the filename. Before I use the technique you outline, it’s definitely not possible to detect the Dolby vision codec from the metadata inside the file itself? Mediainfo and ffprobe both show this information.
Reply
#4
Well, funnily enough, I have a current PR to detect the type of hdr in a video file https://github.com/xbmc/xbmc/pull/19983 It does not however include anything to do with playercorefactory as I've never even looked at that!  Does seem to be a good idea though to be able to trigger an external player based on that data so I will add it to my to-do list for v20.

Currently though, the rule I outlined is the easiest option.  If you don't want to rename a bunch of films, then you could also just drop them into a directory containing dolbyvision or whatever in the name.  Kodi looks at the entire filepath when considering the rules so something like /media/films/dolbyvision/filmname (1993).mp4 should also work.

If they are already scanned in, you would need to remove them from the library first though before moving them and then re-scan them.
Learning Linux the hard way !!
Reply
#5
Thank you that clarifies things. Yes, I do think having access to this metadata would be very helpful in situations such as this, so thank you for considering it for v20. Feel free to reach out if you’d like help with testing!

In the meantime I’ll remove all DV files from my library and I’ve banned them from being imported automatically in future.
Reply
#6
@johnhamelink I took a look at this last night and it appears to be relatively straightforward to add "hdrtype" to the rules.  An example playercorefactory.xml would be something like this.

xml:
<playercorefactory>
  <players>
    <player name="infuse7" type="ExternalPlayer" audio="false" video="true">
      <filename>/path/to/executable</filename>
      <args>"{1}"</args>
      <hidexbmc>false</hidexbmc>
    </player>
  </players>
  <rules action="prepend">
    <rule name="trigger-Infuse7" hdrtype="dolbyvision" player="infuse7"/>
  </rules>
</playercorefactory>

I'll get a PR together to add this functionality to v20.  If you don't mind testing alpha software then I should be able to trigger a test build of it for you for OSX, if you'd like, maybe by next weekend.
Learning Linux the hard way !!
Reply
#7
Thank you - yes that would be fantastic and I’ll be happy to test! However, I’ve since found that infuse 7 doesn’t seem have a method for playing from the terminal yet - I submitted a support ticket with them to find out more in the meantime.

I’ll keep my eyes peeled for updates!
Reply

Logout Mark Read Team Forum Stats Members Help
Setup a rule to play all dolby vision content with an external player?0