rbjtech 4324 Posted May 27, 2023 Share Posted May 27, 2023 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... 1 Link to comment Share on other sites More sharing options...
rbjtech 4324 Posted May 27, 2023 Share Posted May 27, 2023 (edited) 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. 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 May 27, 2023 by rbjtech 1 Link to comment Share on other sites More sharing options...
MagicDoubleM 94 Posted May 27, 2023 Share Posted May 27, 2023 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. 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 More sharing options...
rbjtech 4324 Posted May 29, 2023 Share Posted May 29, 2023 (edited) 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 May 29, 2023 by rbjtech 1 Link to comment Share on other sites More sharing options...
Cheesegeezer 3089 Posted May 30, 2023 Author Share Posted May 30, 2023 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. 1 Link to comment Share on other sites More sharing options...
rbjtech 4324 Posted May 30, 2023 Share Posted May 30, 2023 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 1 Link to comment Share on other sites More sharing options...
MagicDoubleM 94 Posted May 30, 2023 Share Posted May 30, 2023 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 More sharing options...
rbjtech 4324 Posted May 30, 2023 Share Posted May 30, 2023 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. 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. 4. DTS:X IMX has been added (needs the latest MediaInfo CLI to detect it) 1 Link to comment Share on other sites More sharing options...
MagicDoubleM 94 Posted May 30, 2023 Share Posted May 30, 2023 These changes make sense to me, I'll use your build for now. Link to comment Share on other sites More sharing options...
Teddyknuddel 74 Posted May 31, 2023 Share Posted May 31, 2023 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. Link to comment Share on other sites More sharing options...
rbjtech 4324 Posted May 31, 2023 Share Posted May 31, 2023 (edited) 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. 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 .. edit .. ok - so got there in the end - JavaScript is not nice ... 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 May 31, 2023 by rbjtech 2 1 Link to comment Share on other sites More sharing options...
MagicDoubleM 94 Posted May 31, 2023 Share Posted May 31, 2023 Cool! Link to comment Share on other sites More sharing options...
rbjtech 4324 Posted May 31, 2023 Share Posted May 31, 2023 Appears to be working a treat 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 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 1 2 Link to comment Share on other sites More sharing options...
MagicDoubleM 94 Posted May 31, 2023 Share Posted May 31, 2023 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 More sharing options...
MagicDoubleM 94 Posted May 31, 2023 Share Posted May 31, 2023 45 minutes ago, rbjtech said: Appears to be working a treat 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 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. 1 Link to comment Share on other sites More sharing options...
Teddyknuddel 74 Posted May 31, 2023 Share Posted May 31, 2023 @rbjtechCan you possibly tell me where the path for the MediaInfo.dll is on the Synology? Link to comment Share on other sites More sharing options...
rbjtech 4324 Posted May 31, 2023 Share Posted May 31, 2023 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. 1 Link to comment Share on other sites More sharing options...
rbjtech 4324 Posted May 31, 2023 Share Posted May 31, 2023 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 More sharing options...
Luke 37233 Posted May 31, 2023 Share Posted May 31, 2023 Emby Server Data Folder 2 Link to comment Share on other sites More sharing options...
MagicDoubleM 94 Posted May 31, 2023 Share Posted May 31, 2023 (edited) 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 May 31, 2023 by MagicDoubleM Link to comment Share on other sites More sharing options...
Teddyknuddel 74 Posted May 31, 2023 Share Posted May 31, 2023 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. This must all be set like this - otherwise the plugin is lost in Emby 1 Link to comment Share on other sites More sharing options...
rbjtech 4324 Posted June 1, 2023 Share Posted June 1, 2023 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 .. 1 Link to comment Share on other sites More sharing options...
MagicDoubleM 94 Posted June 1, 2023 Share Posted June 1, 2023 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. 1 Link to comment Share on other sites More sharing options...
MagicDoubleM 94 Posted June 1, 2023 Share Posted June 1, 2023 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. 1 Link to comment Share on other sites More sharing options...
rbjtech 4324 Posted June 1, 2023 Share Posted June 1, 2023 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..) ... 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now