Jump to content

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


Cheesegeezer

Recommended Posts

Cheesegeezer
Just now, softworkz said:

@Andy2k The changes I had suggested to @Cheesegeezer were only applied to the execution of mediainfo. 

I some can confirm that it's working now for mediainfo execution, then the same changes need to be applied for execution of mkvpropedit.

Thanks SW i will get that sorted tomorrow.

Link to comment
Share on other sites

17 minutes ago, Cheesegeezer said:

I think this might be some configureAwait(falses) that may have been added I’ll take a look.

No.

You are calling ITaskManager.Execute() which will do nothing if the task is currently running.

Calling  ITaskManager.QueueScheduledTask() is not a good choice either because you might end up queuing countless executions one after another.

After you have run your stuff you can't know whether the (running) task has already picked up those changes or whether it will pick them up or whether it has already gone past those files.  This means that it's pointless to even let this task run to the end.
So what you probably really want is ITaskManager.CancelIfRunningAndQueue(). 

Edited by softworkz
Link to comment
Share on other sites

15 minutes ago, Cheesegeezer said:

 

i don’t follow, this only edits audio and video track titles 

 

Yes i know, but if there a segment information title exists in an mkv container, emby will display this one prior the (wanted) video information. Thats why i asked about a option to clear this field on a media info plugin run.

I will prepare a test file and show it to you.

Link to comment
Share on other sites

Cheesegeezer
10 minutes ago, softworkz said:

No.

You are calling ITaskManager.Execute() which will do nothing if the task is currently running.

Calling  ITaskManager.QueueScheduledTask() is not a good choice either because you might end up queuing countless executions one after another.

After you have run your stuff you can't know whether the (running) task has already picked up those changes or whether it will pick them up or whether it has already gone past those files.  This means that it's pointless to even let this task run to the end.
So what you probably really want is ITaskManager.CancelIfRunningAndQueue(). 

Ok,

but i do know whats been completed and what hasn’t because an item is added to a processed list. If the item fails at any stage its added to a failed list and removed from the processed list incase it gets thru before each item has completed.

and the 3minute sleep that is added to the task if it sees a change in the added or removed or changed RTM event and enabled to to this is sufficient. 
 

running the core library scan and metadata refresh has no bearing with the plugin as far as I’m concerned and i run them in parallel without issues on my system.

i could well be wrong, but it has worked well with all the buffs in testing.

Link to comment
Share on other sites

Cheesegeezer

Edit above, we are talking about the actual task that is running which I don’t have control off such as core tasks. 
 

so 99% of the time they are picked up. If they haven’t the user can run it manually 

Edited by Cheesegeezer
Link to comment
Share on other sites

30 minutes ago, Cheesegeezer said:
1 hour ago, Andy2k said:

Hi,

thx for the new version. Nice to see a "scan media library" is triggert after running the mediainfo plugin. Unfortunaly a "scan metadata folder" is triggert at the same time. would it not be better to chain both tasks instead doing it parallel?

i don’t honestly think this is an issue.

Maybe i misunderstood the difference beween a library scan and a metadata folder scan, but in my opinion the library scan should be finished (and fille the metadata folder with uptodate data) before the metadata folder scan. If both runs a the same time, there is a chance the folder scan catch outdated data because the library scan is still running and not all metadata is up to date.

 

But maybe im totaly wrong. 

  • Thanks 1
Link to comment
Share on other sites

@Cheesegeezer I was not talking about running your own tasks. 

The user said this:

1 hour ago, Andy2k said:

In this case the plugin started and finished BEFORE the initial library scan was done (~98% in my case). 

So a scan metadata folder was initiated, but not the scan library task, cause the initial scan was still running.

Maybe the plugin need to check if a library scan (still) running, before it start the own task.

And that's why I was talking about the code you have to run the Emby library scan task after yours has completed and why it doesn't work in the case like @Andy2k noted.

Edited by softworkz
  • Thanks 1
Link to comment
Share on other sites

Ignore my question about clearing the segmet information title, it looks like the latest emby-server beta ignore this field now and show always the video track information.

So clearing the segment title during a mediainfo run would be only a QoL improvement for some user. But as other player (eg. VLC) use and show this field,  this would be a nice playground in my eyes (clear, keep title, use filename,...)

 

Andy

Link to comment
Share on other sites

Cheesegeezer
56 minutes ago, Andy2k said:

Ignore my question about clearing the segmet information title, it looks like the latest emby-server beta ignore this field now and show always the video track information.

So clearing the segment title during a mediainfo run would be only a QoL improvement for some user. But as other player (eg. VLC) use and show this field,  this would be a nice playground in my eyes (clear, keep title, use filename,...)

 

Andy

Can you explain what a “Segment” Title is. Is this the actual title if the film which would be the General Title or what is a segment title(chapter title) 

none of the testing we have done before has ever changed the item’s title.

EDIT can you show me field your are referring to in the JSON output from mediaInfo please

Edited by Cheesegeezer
Link to comment
Share on other sites

FrostByte

The header portion of a mkv container.   Contains the Title of the overall file, whereas you've been modifying the Title of the individual tracks (video and audio)

"@type": "General",
"UniqueID": "13870290593152255279847636107866962999",
"VideoCount": "1",
"AudioCount": "2",
"TextCount": "2",
"MenuCount": "1",
"FileExtension": "mkv",
"Format": "Matroska",
"Format_Version": "4",
"FileSize": "50436379891",
"Duration": "8177.184",
"OverallBitRate_Mode": "VBR",
"OverallBitRate": "49343520",
"FrameRate": "23.976",
"FrameCount": "196056",
"StreamSize": "71539918",
"IsStreamable": "Yes",
"Title": "The Amazing Spider-Man",
"Movie": "The Amazing Spider-Man",
"Released_Date": "2012-06-23",
"Encoded_Date": "UTC 2022-09-27 21:43:37",
"File_Created_Date": "UTC 2022-09-27 21:43:37.228",
"File_Created_Date_Local": "2022-09-27 17:43:37.228",
"File_Modified_Date": "UTC 2022-09-27 23:03:34.743",
"File_Modified_Date_Local": "2022-09-27 19:03:34.743",
"Encoded_Application": "mkvmerge v70.0.0 ('Caught A Lite Sneeze') 64-bit",
"Encoded_Library": "libebml v1.4.2 + libmatroska v1.6.4",
"extra": {
"ACTOR": "Michael Papajohn",
"DIRECTOR": "Marc Webb",
"GENRE": "Fantasy",
"IMDB": "tt0948470",
"SUBTITLE": "The untold story begins.",
"SUMMARY": "Peter Parker is an outcast high schooler abandoned by his parents as a boy, leaving him to be raised by his Uncle Ben and Aunt May. Like most teenagers, Peter is trying to figure out who he is and how he got to be the person he is today. As Peter discovers a mysterious briefcase that belonged to his father, he begins a quest to understand his parents' disappearance – leading him directly to Oscorp and the lab of Dr. Curt Connors, his father's former partner. As Spider-Man is set on a collision course with Connors' alter ego, The Lizard, Peter will make life-altering choices to use his powers and shape his destiny to become a hero.",
"TMDB": "movie/1930"

 

Link to comment
Share on other sites

FrostByte

I'm not sure I want you to wipe that field though.  As you see I add a lot of tagging including title, ImDB, TmDB, etc.  It should be an option if you did clear the Title unless you want to populate it with the movie title again for me ;)

.

Edited by FrostByte
Link to comment
Share on other sites

Just to confirm what Andy is seeing, I am running into the same issue with mkvpropedit asking for a newer version of the library.
Cheese, once this is sorted out I will give the DV5 file a go and see if it's fixed.

Edited by neik
Link to comment
Share on other sites

On 9/16/2022 at 5:08 AM, rbjtech said:

The MediaInfo part only takes a few minutes for a large library - so something is not right.

Ensure you have used the mediainfo CLI executable in the path and not the normal mediainfo.

Turn on debug logging as it has comprehensive logging and will tell you exactly what it is attempting to do.

Share if you like and we can try and help. (PM or post here ..)

I have my files in the right place, and the correct versions.

I'm looking at the log and first off I see "Reset Embedded Titles = False", but I set "Refresh All Items" to true so it would do my entire collection.

I see it working, looks like it's taking 1000-1400ms per file.  If it does all movies and shows that's about 37k files.  Should take 10-12hrs.

Looks like Captain America, The Winter Soldier has some issues with the audio.

2022-09-28 00:32:29.113 Debug Media Info: AUDIO INFO
2022-09-28 00:32:29.113 Debug Media Info: Track Format = DTS
2022-09-28 00:32:29.113 Debug Media Info: No of Channels = 6
2022-09-28 00:32:29.113 Debug Media Info: Track Index = 2
2022-09-28 00:32:29.113 Debug Media Info: Track Additional Features = XLL
2022-09-28 00:32:29.113 Debug Media Info: *********************
2022-09-28 00:32:29.113 Debug Media Info: Adding Audio Tags
2022-09-28 00:32:29.113 Debug Media Info: Adding Audio Tag DTS-HD MA to Captain America: The Winter Soldier
2022-09-28 00:32:29.239 Info Server: http/1.1 POST http://emby_remote_ip:8096/emby/Sessions/Playing/Progress?X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome Windows&X-Emby-Device-Id=798c13ed-9a73-4b87-836d-850b1a37c27a&X-Emby-Client-Version=4.7.6.0&reqformat=json. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
2022-09-28 00:32:29.239 Debug SessionManager: OnPlaybackProgress TimeUpdate b3e535f735174e53908bc9d496da0316
2022-09-28 00:32:29.240 Info Server: http/1.1 Response 204 to host3. Time: 1ms. http://emby_remote_ip:8096/emby/Sessions/Playing/Progress?X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome Windows&X-Emby-Device-Id=798c13ed-9a73-4b87-836d-850b1a37c27a&X-Emby-Client-Version=4.7.6.0&reqformat=json
2022-09-28 00:32:29.440 Debug Media Info: AUDIO EXIT CODE 2: STD ERROR OUTPUT
2022-09-28 00:32:29.440 Debug Media Info: 
2022-09-28 00:32:29.440 Debug Media Info: AUDIO EXIT CODE 2: STD OUTPUT
2022-09-28 00:32:29.440 Debug Media Info: The file is being analyzed.
Error: No track corresponding to the edit specification 'a2' was found. The file has not been modified.

2022-09-28 00:32:29.440 Info Media Info: Audio Track successfully Written & Exited with Code 2
2022-09-28 00:32:29.440 Info Media Info: Audio Stream #2 Updated to: DTS-HD MA 5.1
2022-09-28 00:32:29.442 Debug App: Saving nfo metadata for D:\Video\Movies\Marvel Collection\Captain America, The Winter Soldier (2014) [PG-13]\Captain America, The Winter Soldier (2014) [PG-13] [1080p].mkv to D:\Video\Movies\Marvel Collection\Captain America, The Winter Soldier (2014) [PG-13]\Captain America, The Winter Soldier (2014) [PG-13] [1080p].nfo.
2022-09-28 00:32:29.445 Info Media Info: Item Tags found =  duringcreditsstinger - based on comic book - marvel cinematic universe - marvel comics - marvel - shield - cyborg - comics - fugitives - DTS-HD MA
2022-09-28 00:32:29.445 Info Media Info: PROCESSING OF Captain America: The Winter Soldier HAS COMPLETED

 

The plugin updated TWICE today, and for the first time it's actually showing progress!  So hopefully it's working now.  I will report back.

MediaInfo1.png

  • Like 1
Link to comment
Share on other sites

rbjtech
8 hours ago, Cheesegeezer said:

Can you explain what a “Segment” Title is. Is this the actual title if the film which would be the General Title or what is a segment title(chapter title) 

none of the testing we have done before has ever changed the item’s title.

EDIT can you show me field your are referring to in the JSON output from mediaInfo please

So this function has never been included in the toolbox - but could easily be added via mkvpropedit - but we need to be careful here because as Frosty says, people may have modified this themselves.

There are two options - 

1.  Simply remove it - and emby will then use the Metadata Title

or

2. Replace it with the metadata Title from the emby dB.   This doesn't benefit emby - but the likes of other players (VLC etc) will then display this at the start of playback.

Both of these options should definitely default to 'off' ..

:)

The other point to make - is this function is starting to slip outside the original scope of just updating the Video and Audio track details to include codecs which emby does not yet recognise.

If we are expanding the 'toolbox' :) - then maybe this needs to go into another tab ?

This then opens up possibilities for other 'mkv preperation' tools - such as adding a default 'AAC' audio track for DTS only tracks as an example.

 

Edited by rbjtech
Link to comment
Share on other sites

8 hours ago, Cheesegeezer said:

Can you explain what a “Segment” Title is. Is this the actual title if the film which would be the General Title or what is a segment title(chapter title) 

none of the testing we have done before has ever changed the item’s title.

EDIT can you show me field your are referring to in the JSON output from mediaInfo please

Hi,

i never said the addon did change this field;) Just some movies and episodes came with information in this field, and at least emby-server 4.8.0.7 beta used this field instead of the video track information. So in Emby it was shown instead of eg "HD 1080p AVC [10,1Mb/s]" the title "This is a test".

Only the plugin option "Reset all Embedded titles to Empty" has touched this field and cleared it too;)

image.thumb.jpeg.5a2aaa01a4c56285c0280b8084b684ed.jpeg

 

VLC and some other player use it as embedded title.

image.thumb.jpeg.1a88037d253e32cec6bd957fb1b2819b.jpeg

 

As emby-server 4.8.0.9 now show (correctly) the embedded video-track information, changing this title (or maybe more fields) would be a QoL improvment for some user, or just a playground. At least changing things here should be optional and not as default.

 

 

Link to comment
Share on other sites

Cheesegeezer
2 hours ago, Andy2k said:

Hi,

i never said the addon did change this field;) Just some movies and episodes came with information in this field, and at least emby-server 4.8.0.7 beta used this field instead of the video track information. So in Emby it was shown instead of eg "HD 1080p AVC [10,1Mb/s]" the title "This is a test".

Only the plugin option "Reset all Embedded titles to Empty" has touched this field and cleared it too;)

image.thumb.jpeg.5a2aaa01a4c56285c0280b8084b684ed.jpeg

As emby-server 4.8.0.9 now show (correctly) the embedded video-track information, changing this title (or maybe more fields) would be a QoL improvment for some user, or just a playground. At least changing things here should be optional and not as default.

Hi Andy, 

I'm still a little confused by this request.  Please forgive me.  I've just done some testing on a movie.  And i also have this field populated.  However it is never shown as the title in Emby for any track titles or Movie Title.  I fear you may have a setting in emby that uses this title

image.thumb.png.197e0284e5c86680e21e82dc0dff2217.png

 

image.png.078df44cc0a571b3c6b5c7e10a1802d5.png

And even the metadata doesn't reflect the embedded "Segment" Title

image.png.2b60f174d07e0316cc81ce9f34b0dd6f.png

 

So my logic is you probably have the setting to use Filename or something rather than let emby use the metaproviders title that emby imports.

I think that you may have this enabled in each library advanced settings, but i don't know if this forces embedded titles

image.png.db2860cae59afc949f2773c94f098c89.png

 

Anyways, appreciate your feedback and i will get on with making an update today for the Linux user base.

Link to comment
Share on other sites

Lol, now you confuse me;)

59 minutes ago, Cheesegeezer said:

So my logic is you probably have the setting to use Filename or something rather than let emby use the metaproviders title that emby imports.

I think that you may have this enabled in each library advanced settings, but i don't know if this forces embedded titles

Sure i have enabled the option to tell emby to prefer embedded title over filenames, cause the mediainfo plugin set this option to "on" on library base.

From wiki:

9. Getting the titles to Display in Emby UI Clients

If MediaInfo Plugin global Enabled is set to on. The below setting is automatically set to ON (To mainly help simplify the input requirement from the user).

 

At least emby-server 4.8.0.7 beta has shown the segment title (in your example "Top Gun: Maverik (2002) [2160p]" instead of the videotrack metadata "UHD DV8..."

Not sure about 4.8.0.8, but 4.8.0.9 will show the wanted embedded videotrack data. In the past im not really cared about this, because Kodi dont use this information. Just in my first testruns with emby (instead of using a SQL database) and your great plugin i saw most files show the wanted video information, but some the original filename like "Top.Gun.Maverik.2022.German.DL.1080p.AMZN.H264-ZeroTwo.mkv". Finaly i did a "reset embedded title" run to clear this field on all of my files...

Shown this in 4.8.0.7 was the reason for the feature request to reset the title information...4.8.0.9 will not show this anymore, so my feature request ist almost obsolete, it would be just a QoL improvement or a playground for much more feature in the toolbox like rjbtech said:)

4 hours ago, rbjtech said:

The other point to make - is this function is starting to slip outside the original scope of just updating the Video and Audio track details to include codecs which emby does not yet recognise.

If we are expanding the 'toolbox' :) - then maybe this needs to go into another tab ?

This then opens up possibilities for other 'mkv preperation' tools - such as adding a default 'AAC' audio track for DTS only tracks as an example.

 

But maybe my bad english causes we talked past each other;)

I really i appreciate your (and all other involed people's!) work on this addon!

Andy

 

Edited by Andy2k
  • Thanks 1
Link to comment
Share on other sites

FrostByte
3 minutes ago, Andy2k said:

Lol, now you confuse me;)

Sure i have enabled the option to tell emby to prefer embedded title over filenames, cause the mediainfo plugin set this option to "on" on library base.

From wiki:

9. Getting the titles to Display in Emby UI Clients

If MediaInfo Plugin global Enabled is set to on. The below setting is automatically set to ON (To mainly help simplify the input requirement from the user).

 

At least emby-server 4.8.0.7 beta has shown the segment title (in your example "Top Gun: Maverik (2002) [2160p]" instead of the videotrack metadata "UHD DV8..."

Not sure about 4.8.0.8, but 4.8.0.9 will show the wanted embedded videotrack data. In the past im not really cared about this, because Kodi dont use this information. Just in my first testruns with emby (instead of using a SQL database) and your great plugin i saw most files show the wanted video information, but some the original filename like "Top.Gun.Maverik.2022.German.DL.1080p.AMZN.H264-ZeroTwo.mkv". Finaly i did a "reset embedded title" run to clear this field on all of my files...

Shown this in 4.8.0.7 was the reason for the feature request to reset the title information...4.8.0.9 will not show this anymore, so my feature request ist almost obsolete, it would be just a QoL improvement or a playground for much more feature in the toolbox like rjbtech said:)

 

But maybe my bad english causes we talked past each other;)

I really i appreciate your (and all other involed people's!) work on this addon!

Andy

 

Were you disconnected from the Internet when you tested under .09?  

Link to comment
Share on other sites

Cheesegeezer
9 minutes ago, Andy2k said:

Lol, now you confuse me;)

Sure i have enabled the option to tell emby to prefer embedded title over filenames, cause the mediainfo plugin set this option to "on" on library base.

From wiki:

9. Getting the titles to Display in Emby UI Clients

If MediaInfo Plugin global Enabled is set to on. The below setting is automatically set to ON (To mainly help simplify the input requirement from the user).

 

At least emby-server 4.8.0.7 beta has shown the segment title (in your example "Top Gun: Maverik (2002) [2160p]" instead of the videotrack metadata "UHD DV8..."

Not sure about 4.8.0.8, but 4.8.0.9 will show the wanted embedded videotrack data. In the past im not really cared about this, because Kodi dont use this information. Just in my first testruns with emby (instead of using a SQL database) and your great plugin i saw most files show the wanted video information, but some the original filename like "Top.Gun.Maverik.2022.German.DL.1080p.AMZN.H264-ZeroTwo.mkv". Finaly i did a "reset embedded title" run to clear this field on all of my files...

Shown this in 4.8.0.7 was the reason for the feature request to reset the title information...4.8.0.9 will not show this anymore, so my feature request ist almost obsolete, it would be just a QoL improvement or a playground for much more feature in the toolbox like rjbtech said:)

 

But maybe its my bad english causes we talked past each other;)

I really i appreciate your (and all other involed people's!) work on this addon!

Andy

 

Lets not get confused here.  There are 2 completely seperate options.

#1 -  "To prefer to use embedded TITLE over filenames" - this is the option found in each library (and you have to enable advanced options to see it) - MEDIAINFO DOES NOT SET THIS OPTION

  1. image.thumb.png.5f3a8abc5f89cbd91ab7ede838f7dd45.png

 

 

#2 - "Embedded TRACK Title Display" - this only refers to audio, subtitle and video nothing to do with the Movie Title.  THIS IS THE SETTING MEDIAINFO ENABLES TO ON

  1. image.thumb.png.b690c9d5ef65a60d170b97b4f7e230b9.png

 

Edited by Cheesegeezer
Link to comment
Share on other sites

No, but i prepare my files with Tinymediamanager and use local .nfo files. With .09 i prepared 2 files and also i added a pre-prepared completely new file to the database, but i could not ajust the behavior i saw under .07 anymore.

 

Link to comment
Share on other sites

Cheesegeezer

@Andy2k

I am gonna send you a PM.  I have a new version for you to test which should help with the Linux fixes and also the MKV/mKv/mKV extensions.  

 

Link to comment
Share on other sites

6 hours ago, Cheesegeezer said:

Lets not get confused here.  There are 2 completely seperate options.

#1 -  "To prefer to use embedded TITLE over filenames" - this is the option found in each library (and you have to enable advanced options to see it) - MEDIAINFO DOES NOT SET THIS OPTION

#2 - "Embedded TRACK Title Display" - this only refers to audio, subtitle and video nothing to do with the Movie Title.  THIS IS THE SETTING MEDIAINFO ENABLES TO ON

 

 

Ahh ok...so it is possible this option  (#1.) was "on" during my first tries....

Edited by Andy2k
  • Agree 1
Link to comment
Share on other sites

1971camaroguy

Just curious, what are the chances we can have it change the files that show Und (undetermined) at the beginning of the audio track name to remove the Und? I have a some files like this.  I could always remux them, just wanted to ask.

Screen Shot 2022-09-28 at 11.13.30 AM.png

Edited by 1971camaroguy
Link to comment
Share on other sites

Cheesegeezer
6 minutes ago, 1971camaroguy said:

Just curious, what are the chances we can have it change the files that show Und (undetermined) at the beginning of the audio track name to remove the Und? I have a some files like this.  I could always remux them, just wanted to ask.

Screen Shot 2022-09-28 at 11.13.30 AM.png

I don’t put that infront at all in the plugin, thats a thing emby does.  They always put the language infront of audio and subtle tracks. Out of my control unfortunately.

we did have a chat a long time ago about dealing with this and writing the correct language in, but other than making an assumption that the default track was your local language there is no solid method to define that language. So we scrapped the idea.

 

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...