Jump to content

MediaInfo For Emby Plugin(HDR, Vision, Atmos, DTS:X)


Cheesegeezer

Recommended Posts

rbjtech
54 minutes ago, MagicDoubleM said:

No idea what went wrong with the xml.
No problem, JSON with 23.04 here we go:mediainfo.json

ok thanks - let me check this tomorrow - it's late here in the UK... ;)

  • Thanks 1
Link to comment
Share on other sites

rbjtech

So I tried to re-create this issue - and can see no issues.

I don't usually have those audio options enabled - but I set them - and then re-processed that item - and they appeared just fine.

image.png.ac7448a825d4f781121b123f469245c4.png

Maybe worth sendind a video sample ?  is it ALL files or just some ?

from the log -

2023-05-27 20:02:32.825 Info MediaInfo: PERFORMING MEDIAINFO EXTRACTION
2023-05-27 20:02:32.918 Info MediaInfo: PROCESSING OF  1917  HAS STARTED
2023-05-27 20:02:32.918 Info MediaInfo: Item FilePath = \\media\Films\1917 (2019) [tmdbid=530915]\1917 (2019) - WEBDL-2160p DV8 HDR10.mkv 
2023-05-27 20:02:33.009 Info MediaInfo: Video Track successfully Written & Exited with Code 0
2023-05-27 20:02:33.009 Info MediaInfo: Video Track Title Set to UHD DV8 HDR10 Rx [70.1Mb/s]
2023-05-27 20:02:33.082 Info MediaInfo: Audio Track successfully Written & Exited with Code 0
2023-05-27 20:02:33.082 Info MediaInfo: Audio Stream #1 Updated to: Dolby Digital 5.1 (48Khz) (Default)
2023-05-27 20:02:33.130 Info MediaInfo: Audio Track successfully Written & Exited with Code 0
2023-05-27 20:02:33.130 Info MediaInfo: Audio Stream #2 Updated to: Dolby THD 7.1 [Atmos] (48Khz) [24-Bit]
2023-05-27 20:02:33.183 Info MediaInfo: Audio Track successfully Written & Exited with Code 0
2023-05-27 20:02:33.183 Info MediaInfo: Audio Stream #3 Updated to: DTS-HD 7.1 [MA] (48Khz) [24-Bit]
2023-05-27 20:02:33.229 Info MediaInfo: Audio Track successfully Written & Exited with Code 0
2023-05-27 20:02:33.229 Info MediaInfo: Audio Stream #4 Updated to: DTS 5.1 (48Khz) [24-Bit]
2023-05-27 20:02:33.275 Info MediaInfo: Audio Track successfully Written & Exited with Code 0
2023-05-27 20:02:33.275 Info MediaInfo: Audio Stream #5 Updated to: Dolby Digital+ 7.1 (48Khz)
Edited by rbjtech
  • Like 1
Link to comment
Share on other sites

MagicDoubleM
1 hour ago, rbjtech said:

So I tried to re-create this issue - and can see no issues.

I don't usually have those audio options enabled - but I set them - and then re-processed that item - and they appeared just fine.

image.png.ac7448a825d4f781121b123f469245c4.png

Maybe worth sendind a video sample ?  is it ALL files or just some ?

It's just some files.

I already had them remuxed with mkvtoolnix 76, but that didn't change a thing.

Here's a 1sec samplesample.mkv
 

Link to comment
Share on other sites

rbjtech
On 27/05/2023 at 21:16, MagicDoubleM said:

It's just some files.

I already had them remuxed with mkvtoolnix 76, but that didn't change a thing.

Here's a 1sec samplesample.mkv
 

So I've managed to re-create with your sample - thanks.

I believe it's because the audio is True-HD but without Atmos.

I have checked the code, and this 'should' have been trapped, but I can't find ANY such tag's in my emby system which I find hard to believe as THD was available long before Atmos, there should 'some' ...

It should be this part of the code below - I've included the THD with Atmos part as well.

For just THD, there is no 'AdditionalFeatures' field and I think that's where it's not picking it up, but the logic below looks good  .. (Dave, is it possible it's not clearing it from a previous use maybe - ie additionalFeatures is NOT Null or Empty - thus neither condition is true so output = null ?)

@Cheesegeezer- Any thoughts ?  I've shown the JSON below -

                if (input == "MLP FBA" && additionalFeatures == "16-ch" && !config.AbbrAudioOutput)
                {
                    output = "Dolby TrueHD Atmos";

                }
                if (input == "MLP FBA" && additionalFeatures == "16-ch" && config.AbbrAudioOutput)
                {
                    output = "Dolby THD Atmos";

                }
                if (input == "MLP FBA" && string.IsNullOrEmpty(additionalFeatures) && !config.AbbrAudioOutput)
                {
                    output = "Dolby TrueHD";

                }
                if (input == "MLP FBA" && string.IsNullOrEmpty(additionalFeatures) && config.AbbrAudioOutput)
                {
                    output = "Dolby THD";

 

"@type": "Audio",
"@typeorder": "1",
"StreamOrder": "1",
"ID": "2",
"UniqueID": "1364044095921764637",
"Format": "MLP FBA",
"Format_Commercial_IfAny": "Dolby TrueHD",
"CodecID": "A_TRUEHD",
"Duration": "1.001000000",
.....

 

Edited by rbjtech
  • Like 1
Link to comment
Share on other sites

Cheesegeezer
11 hours ago, rbjtech said:

So I've managed to re-create with your sample - thanks.

I believe it's because the audio is True-HD but without Atmos.

I have checked the code, and this 'should' have been trapped, but I can't find ANY such tag's in my emby system which I find hard to believe as THD was available long before Atmos, there should 'some' ...

It should be this part of the code below - I've included the THD with Atmos part as well.

For just THD, there is no 'AdditionalFeatures' field and I think that's where it's not picking it up, but the logic below looks good  .. (Dave, is it possible it's not clearing it from a previous use maybe - ie additionalFeatures is NOT Null or Empty - thus neither condition is true so output = null ?)

@Cheesegeezer- Any thoughts ?  I've shown the JSON below -

                if (input == "MLP FBA" && additionalFeatures == "16-ch" && !config.AbbrAudioOutput)
                {
                    output = "Dolby TrueHD Atmos";

                }
                if (input == "MLP FBA" && additionalFeatures == "16-ch" && config.AbbrAudioOutput)
                {
                    output = "Dolby THD Atmos";

                }
                if (input == "MLP FBA" && string.IsNullOrEmpty(additionalFeatures) && !config.AbbrAudioOutput)
                {
                    output = "Dolby TrueHD";

                }
                if (input == "MLP FBA" && string.IsNullOrEmpty(additionalFeatures) && config.AbbrAudioOutput)
                {
                    output = "Dolby THD";

 

"@type": "Audio",
"@typeorder": "1",
"StreamOrder": "1",
"ID": "2",
"UniqueID": "1364044095921764637",
"Format": "MLP FBA",
"Format_Commercial_IfAny": "Dolby TrueHD",
"CodecID": "A_TRUEHD",
"Duration": "1.001000000",
.....

 

I agree that the logic is good. If the json output has no additional features, when this is serialised to the model then addition features property will be null or string.Empty. 
 

the only possibility that may have happened is that they(mediaInfo) have changed the case in the json output for either the format or the additional features and our model must match the case when stating the [json property] attribute or the property itself.

 

  • Like 1
Link to comment
Share on other sites

rbjtech
6 hours ago, Cheesegeezer said:

I agree that the logic is good. If the json output has no additional features, when this is serialised to the model then addition features property will be null or string.Empty. 
 

the only possibility that may have happened is that they(mediaInfo) have changed the case in the json output for either the format or the additional features and our model must match the case when stating the [json property] attribute or the property itself.

 

I've found the issue - i think - it only effected the 'RBJ' formatting.

As THD without Atmos is classed as a 'normal' codec, it needs to be processed in that code segment, as it then breaks out.  In the non-rbj formatting - you added it -

                    case "MLP FBA":
                        output = "Dolby THD";
                        break;

or "Dolby TrueHD" if not abbreviated - but in RBJ formatting this was missing -

so I added it

                case "MLP FBA":                                                     // Added by RBJ
                    output = "Dolby THD " + ChannelOutput(channels);                // Added by RBJ
                    break;                                                          // Added by RBJ

and it now all works perfectly

@MagicDoubleM- Please can you try the version below (1.0.1.24) - but be advised, this version has a lot of my own modifications to the code - such as swapping around some formatting, adding tags for all Audio types, IMAX Update etc + this fix - so take a copy of the old DLL first. ;) If all ok, then I'll update the branch on github with the change and Dave can merge into the master.  btw - let me know if you like/prefer the other changes I made - and I may add those in a seperate update for review.

Emby.MediaInfo.dll

  • Like 1
Link to comment
Share on other sites

MagicDoubleM
3 hours ago, rbjtech said:

I've found the issue - i think - it only effected the 'RBJ' formatting.

As THD without Atmos is classed as a 'normal' codec, it needs to be processed in that code segment, as it then breaks out.  In the non-rbj formatting - you added it -

                    case "MLP FBA":
                        output = "Dolby THD";
                        break;

or "Dolby TrueHD" if not abbreviated - but in RBJ formatting this was missing -

so I added it

                case "MLP FBA":                                                     // Added by RBJ
                    output = "Dolby THD " + ChannelOutput(channels);                // Added by RBJ
                    break;                                                          // Added by RBJ

and it now all works perfectly

@MagicDoubleM- Please can you try the version below (1.0.1.24) - but be advised, this version has a lot of my own modifications to the code - such as swapping around some formatting, adding tags for all Audio types, IMAX Update etc + this fix - so take a copy of the old DLL first. ;) If all ok, then I'll update the branch on github with the change and Dave can merge into the master.  btw - let me know if you like/prefer the other changes I made - and I may add those in a seperate update for review.

Emby.MediaInfo.dll 457 kB · 1 download

Yes, works for me. Thank you very much.🙂👍

That additional stuff sounds interesting, especially the additional tags. 

Link to comment
Share on other sites

rbjtech

My own changes below (some only in RBJ Formatting option) -

1. If above a certain bitrate for a certain resolution, the plugin added an automatic 'Remux' to the Title - My change just adds this after the bitrate instead.  This is because on the AndroidTV client - the Title is limited to ~24 chars - and thus you lost the bitrate.  With it round the other way, you just lose the word Remux, which is less of an issue.

image.png.e5a806e650c247526626713fa94b3496.png

2. Some minor changes in terminology - I use Digital+ instead of Digital Plus for example.

3. All Audio Tags are included - previously the 'standard' emby codecs were excluded, but I re-added them - which makes filtering by Tag so much easier.

ie - I want to filter all my movies if they have a Dolby Digital+ and DTS audio tracks .. Now I can do that on the tags selection.

image.png.b9f30ff247432f174e674402b2c67783.png

image.png.9788def7a25ec0dbe8050d371096d424.png

4. DTS:X IMX has been added (needs the latest MediaInfo CLI to detect it)

image.png.5072401c3f26e8865a1df45746967051.png

 

 

  • Like 1
Link to comment
Share on other sites

Teddyknuddel

Would it be possible to display the audio bitrate as well? I think it's here that you can clearly see which audio track has decent power.

 

Screenshot_1.png

Link to comment
Share on other sites

rbjtech
2 hours ago, Teddyknuddel said:

Would it be possible to display the audio bitrate as well? I think it's here that you can clearly see which audio track has decent power.

 

Screenshot_1.png

Possibly .. just having a dabble myself to add this - the good news is because @Cheesegeezerwrote such an awsome structured Plugin to begin with - adding ANYTHING from the mediainfo JSON output can easily be added (it gets all the fields, not just those displayed in the Emby config) .. :)

I've got the Audio Bitrate value showing in the debug log and added the GUI (below), now just need to append the value if the checkbox is true..  brb ..

image.png.2284a55f5305c101b8f7fa3a03540ea5.png

image.png.1511d67af6773e6f7d59deff2521a4aa.png

edit ..

ok - so got there in the end - JavaScript is not nice ... 

image.png.079fd250a2ea19cdebddafc07fdf6770.png

Just need to do a little bit more testing - but there is now an option to add Audio Bitrate ;)   - I'll post the DLL shortly ...

Edited by rbjtech
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

rbjtech

Appears to be working a treat :)

image.png.9078c77fa6fb47c0fd5068fa02363287.png

DLL version is 1.0.1.25

Please take a copy of your old DLL before replacing with the attached - and clear your browser cache to re-load it.

Toggle on/off the Audio bitrate 

image.png.13696ba4ca288aa5b636d63c251d28e3.png

I don;t use the Sample/Bit depth myself - so feedback on formatting welcome - it's probably a bit much if you ticked them all ..

Enjoy..

.. and @Cheesegeezer.. I will learn how to do this in GitHub honest as this is all on my private fork .. 🤪

Emby.MediaInfo.dll

  • Haha 1
  • Thanks 2
Link to comment
Share on other sites

MagicDoubleM

I just noticed an unexpected behavior in regards to "Remove MediaInfo Tags". Basically, it's like this. I had a DV7 files, which I converted to DV8. Now, when I update the file it gets properly tagged with DV8, and the DV7 tag stays. No problem I thought, let's remove the tags and build them from ground. The task indeed removes the tags, but leaves the DV7 tag untouched. So, I guess the logic is, that "Remove MediaInfo Tags" only removes the tags that do match to the file. I see that this is a safety measure, but... Well yeah, it results in a few ghost tags here.

And one more thought, for the "remux" info, it wouldn't hurt to also check if the file-name has that string included, instead of solely relying on that bit-rate limit. I just saw a remux that didn't get marked as such (and it is a remux, I did it myself). 🙂

Link to comment
Share on other sites

MagicDoubleM
45 minutes ago, rbjtech said:

Appears to be working a treat :)

image.png.9078c77fa6fb47c0fd5068fa02363287.png

DLL version is 1.0.1.25

Please take a copy of your old DLL before replacing with the attached - and clear your browser cache to re-load it.

Toggle on/off the Audio bitrate 

image.png.13696ba4ca288aa5b636d63c251d28e3.png

I don;t use the Sample/Bit depth myself - so feedback on formatting welcome - it's probably a bit much if you ticked them all ..

Enjoy..

.. and @Cheesegeezer.. I will learn how to do this in GitHub honest as this is all on my private fork .. 🤪

Emby.MediaInfo.dll 458.5 kB · 1 download

Yes, works fine and I like. More geeky infos are always welcome. 😅

 

image.png.caf0d7046f75d96fee02ecbf90c508ba.png

  • Thanks 1
Link to comment
Share on other sites

rbjtech
56 minutes ago, MagicDoubleM said:

I just noticed an unexpected behavior in regards to "Remove MediaInfo Tags". Basically, it's like this. I had a DV7 files, which I converted to DV8. Now, when I update the file it gets properly tagged with DV8, and the DV7 tag stays. No problem I thought, let's remove the tags and build them from ground. The task indeed removes the tags, but leaves the DV7 tag untouched. So, I guess the logic is, that "Remove MediaInfo Tags" only removes the tags that do match to the file. I see that this is a safety measure, but... Well yeah, it results in a few ghost tags here.

Yea as you've gathered this is to avoid removing tags that the Plugin did not originally populate.  Let me give this some thought as I'm on the same journey actually, converting DV7 to DV8 ..

1 hour ago, MagicDoubleM said:

And one more thought, for the "remux" info, it wouldn't hurt to also check if the file-name has that string included, instead of solely relying on that bit-rate limit. I just saw a remux that didn't get marked as such (and it is a remux, I did it myself). 🙂

ok - that could be something to add - if it's in the JSON output, then even better.

  • Like 1
Link to comment
Share on other sites

rbjtech
3 minutes ago, Teddyknuddel said:

@rbjtechCan you possibly tell me where the path for the MediaInfo.dll is on the Synology?

I'm not 100% sure where that is on the Synology - but it's ..\programdata\plugins on Windows

Because you'll need to manually load the DLL (as it's not from the catalogue) then I think you'll need to SSH/SCP the file - or wait for it to be updated in the Catalogue ;)

The wiki may provide more info

https://github.com/Cheesegeezer/MediaInfoWiki/wiki

https://github.com/Cheesegeezer/MediaInfoWiki/wiki/Various-OS-Installation-Help

@FrostByte- Any help appreciated.

Link to comment
Share on other sites

MagicDoubleM
1 hour ago, rbjtech said:

Yea as you've gathered this is to avoid removing tags that the Plugin did not originally populate.  Let me give this some thought as I'm on the same journey actually, converting DV7 to DV8 ..

ok - that could be something to add - if it's in the JSON output, then even better.

Yup, it's in the JSON under "complete name" and "movie name".

BTW, tiny detail, there is a space between the number and "kb/s" for audio, but no space for video. If you ask me, I'd go without a space everywhere and whould get rid of the "-" inbetween the number for bitdepth and "Bit". I know thats extremely picky... lol 😅

Edited by MagicDoubleM
Link to comment
Share on other sites

Teddyknuddel

Thank you - worked.

But you still have to customize user and group under the synology. Goes with the MidnightCommander (mc) over SSH on the Synology quite well.

Screenshot_2.png.84c7011d80b9c4e5ec64f8fd3f2be6b3.png

This must all be set like this - otherwise the plugin is lost in Emby

Screenshot_3.png.114bb9cf299064b5ae610a9f88abc6f2.png

 

  • Thanks 1
Link to comment
Share on other sites

rbjtech

Hi All,

So I'm trying to add some logic to 'detect' commentary tracks.   Unfortunately it's pretty rare to get these tagged in the MKV and even if they are, MediaInfo does not report this is the JSON output.

So I've come up with a little logic that should automatically name these as such - and with a toggle to turn it on/off - may be another nice addition to the Plugin.

Logic is this

1. Track must not be 'Default'

2. Track must not be the first Audio Track (incase the Default is another track)

3. Track must have only 2 Channels

4. Track must be AC3 Format (of all the Commentary tracks I have, they are all AC3 2.0)

If all the above are true - then append [Commentary] after the channels - ie

English Dolby Digital 2.0 [Commentary]

What are peoples thoughts ?

                    if (typeInfo.Default != "Yes" && trackIndex != "1" && typeInfo.Channels == "2" && typeInfo.Format == "AC-3")
                    {
                        Log.Debug("Commentary track ?",trackIndex);
                    }

Debug below - just testing the logic - appears to work as these are indeed both commentary tracks .. 

image.png.e6c85c5ce73c49297ea06ee66876af34.png

  • Like 1
Link to comment
Share on other sites

MagicDoubleM

I like the idea, but would make that brute-force-algo optional, with a basic version only marking the tracks that are marked via mkv (if you find a way to get to that info). Additionally I'd look for strings in the naming of the track. Sometimes there is "commentary" to be found in there


For a brute-force-algo:

I'd also say there is always a track with the same language but a higher level of audio-quality to be found. So if there is an English AC3 2.0 track and an 5.1 track (AC3 or better), then it's highly possible the 2.0 is a commentary.

If there is a track marked as original language (again an MKV tag thats probably not in the json) and there is a second track with the same language but only 2.0 AC3, then yeah, that's probably a commentary.

Audio analyzing goes too far... and looking for subtitles (again maybe named) or even for keywords within the subtitles, are also ideas that will go way too far.

  • Thanks 1
Link to comment
Share on other sites

MagicDoubleM

Two more thoughts, relying on the codec might produce lots of miss-matches in cases, where a user has added additional audiotracks for streaming purposes (I did experiment myself with generating stereo counterparts to highres-audio).... It will miss commentary tracks that have been converted to another format (like AAC for example).

Yeah, it's best suited for clean remuxes, totally with you on that.

  • Thanks 1
Link to comment
Share on other sites

rbjtech

Some great thoughts there - thanks.  Yea homebrew stuff may screw things up, but language is a good call.   I strip everything non English which is why I hadn't thought of that scenerio ..

If it gets included, then Yes this is totally optional - I'll add it to a toggle switch now I know how to add them .. haha

btw - I've also added the 'Remux' from the filename now .. and also attempting to fix the multi-video track bug that just re-writes video track 0.  I can see the issue but I'm just working out how to pass the correct video track to mkvpropedit ... yes I know not many files have multi video but the pesky 'MJPEG' are classed as Video tracks and that screws things up occassionally (I should just delete them..) ...

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...