Jump to content

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


Cheesegeezer

Recommended Posts

sydlexius
3 hours ago, softworkz said:

1. Use a Statically Compiled Binary 

It's possible to compile a binary "fully static". This means that the binary does not need to load any libraries because all are compiled into the executable.

A plugin could include such binary, save it to some place on disk and execute it from there. Also, it wouldn't be required anymore for users to install it to the system.

In my mind, this is probably the best compromise.  You end up with slightly more bloated binaries, but you don't have to live off the land nor make modifications to it.  MediaInfo and ffmpeg-lib source code is easy enough to obtain and I suspect not difficult to compile (or cross compile, if that's what the Emby busybox docker image requires).  The only remaining question is how the linux version of biftool handles its dependence on ffmpeg-lib.  The source for it is unfortunately unavailable.  As you mentioned, you can export a modified library path when calling it.

Link to comment
Share on other sites

10 minutes ago, sydlexius said:
  3 hours ago, softworkz said:

1. Use a Statically Compiled Binary 

As it's not possible by default to just put the required libs/dlls in the same folder like on Windows, huge effort is required to deal with version conflicts, needing stores with millions of packages of different versions and dependency versions and eventually often needing to compile manually to accommodate to a certain system.

Nonetheless, it appears to be a rather uncommon practice in the Linux world to use static binaries. For a lab project, we needed to have a new command line executable compiled and we did a fully static compile. Now, it runs not only on every damn version of all Linux distributions, it even runs on Android (hands up who knew that this is possible 🙂).
(you still need one for each CPU architecture, of course)

Link to comment
Share on other sites

Interesting though: Derkington seems to have .25 of the lib in his Emby folder and I have .28 in my Emby folder.

@Derkington, what Emby version do you have installed? Mine is the latest beta...

Also interesting: My mediainfo works fine (I don't see the error Derkington sees) but it fails while editing the track header using mkvpropedit:
 

2022-09-08 22:32:18.770 Debug Media Info: VIDEO EXIT CODE 1: STD ERROR OUTPUT
2022-09-08 22:32:18.770 Debug Media Info: /usr/bin/mkvpropedit: /opt/emby-server/lib/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /lib/x86_64-linux-gnu/libQt5Core.so.5)
/usr/bin/mkvpropedit: /opt/emby-server/lib/libstdc++.so.6: version `CXXABI_1.3.13' not found (required by /lib/x86_64-linux-gnu/libQt5Core.so.5)

 

Link to comment
Share on other sites

Derkington
2 hours ago, neik said:

Interesting though: Derkington seems to have .25 of the lib in his Emby folder and I have .28 in my Emby folder.

@Derkington, what Emby version do you have installed? Mine is the latest beta...

Also interesting: My mediainfo works fine (I don't see the error Derkington sees) but it fails while editing the track header using mkvpropedit:
 

2022-09-08 22:32:18.770 Debug Media Info: VIDEO EXIT CODE 1: STD ERROR OUTPUT
2022-09-08 22:32:18.770 Debug Media Info: /usr/bin/mkvpropedit: /opt/emby-server/lib/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /lib/x86_64-linux-gnu/libQt5Core.so.5)
/usr/bin/mkvpropedit: /opt/emby-server/lib/libstdc++.so.6: version `CXXABI_1.3.13' not found (required by /lib/x86_64-linux-gnu/libQt5Core.so.5)

 

Emby Version    4.7.6.0
Paths
Programme Data    /var/lib/emby
Cache    /var/lib/emby/cache
Metadata    /var/lib/emby/metadata
Logs    /var/lib/emby/logs
Transcoding Temporary Files    /var/lib/emby/transcoding-temp

Running on
Distributor ID:    Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:    22.04
Codename:    jammy

I try to keep everything as stable and vanilla as I can, but I am happy  to test things that I can reverse easily and quickly.

Link to comment
Share on other sites

Derkington

I’ve had a few hours to use Emby over the weekend. Two things I have noticed as a result of re-pointing the libraries to get this plugin working.

1- There’s some random weirdness on the UI. One of the more noticeable ones for me is when I scrolled down via a web client, the ‘Movies, Suggestions, Trailers, Collections, Genres etc’ buttons/bar at the top of each library would hang about as you scrolled down.

On the Roku soundbar it seemed to cause some minor corruption of the buttons/bar as you scrolled down in a library intermittently.

2- I noticed that some media buffered when it did not do so before. When I looked into it the trans-coding was super slow. CPU was sitting at around 94-100% rather than the usual 50-60%. Switching the libraries back and restating emby stopped the buffering as well as the transcendent buffer was able to fill a a sensible rate and the CPU utilization became much lower.

Looks like mediainfo does not support Linux desktop well enough yet, so I will disable it for now. Happy to test stuff out if anything changes with the plug-in in the future.

Cheers.

Link to comment
Share on other sites

Cheese, any chance you can point explicitly to the system libraries (/usr/lib/x86_64-linux-gnu) instead of Emby's libraries (opt/emby-server/lib)?

Frosty, it is working on your Synology, right? Would you mind checking the version of the lib within your Emby install?

Link to comment
Share on other sites

rbjtech
3 hours ago, Derkington said:

I’ve had a few hours to use Emby over the weekend. Two things I have noticed as a result of re-pointing the libraries to get this plugin working.

1- There’s some random weirdness on the UI. One of the more noticeable ones for me is when I scrolled down via a web client, the ‘Movies, Suggestions, Trailers, Collections, Genres etc’ buttons/bar at the top of each library would hang about as you scrolled down.

On the Roku soundbar it seemed to cause some minor corruption of the buttons/bar as you scrolled down in a library intermittently.

2- I noticed that some media buffered when it did not do so before. When I looked into it the trans-coding was super slow. CPU was sitting at around 94-100% rather than the usual 50-60%. Switching the libraries back and restating emby stopped the buffering as well as the transcendent buffer was able to fill a a sensible rate and the CPU utilization became much lower.

Looks like mediainfo does not support Linux desktop well enough yet, so I will disable it for now. Happy to test stuff out if anything changes with the plug-in in the future.

Cheers.

None of that makes any sense - MediaInfo is simply writing the title to the tracks of the MKV - it has no impact on the emby system what-so-ever once it has make the change.

You can do the same change yourself manually via mkvtoolnix - and it would also make no difference.

You must have other factors coming into play here - this plugin would not cause these issues.

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

13 minutes ago, rbjtech said:

None of that makes any sense - MediaInfo is simply writing the title to the tracks of the MKV - it has no impact on the emby system what-so-ever once it has make the change.

You can do the same change yourself manually via mkvtoolnix - and it would also make no difference.

You must have other factors coming into play here - this plugin would not cause these issues.

If I got it right he is saying that it is happening after you replace Emby's lib by the system lib.
 

  • Like 1
Link to comment
Share on other sites

Derkington
42 minutes ago, neik said:

If I got it right he is saying that it is happening after you replace Emby's lib by the system lib.
 

@niek That is correct. I have only seen this behavior after changing Emby's libraries. I have not seen these issues since reverting the changes. I know it is not the plugin itself that has caused this. @rbjtechsorry for any misunderstanding.  Switching the libraries is the only way I have found which makes the plugin work as it should. But those changes causes problems (described above) with Emby.

Link to comment
Share on other sites

Cheesegeezer
9 hours ago, Derkington said:

@niek That is correct. I have only seen this behavior after changing Emby's libraries. I have not seen these issues since reverting the changes. I know it is not the plugin itself that has caused this. @rbjtechsorry for any misunderstanding.  Switching the libraries is the only way I have found which makes the plugin work as it should. But those changes causes problems (described above) with Emby.

Thanks for the info, i hope you get this sorted, unfortunately the plugin can do anything to help you. You probably need to start a new thread in Linux server section and raise the issue to emby admin.

10 hours ago, neik said:

Cheese, any chance you can point explicitly to the system libraries (/usr/lib/x86_64-linux-gnu) instead of Emby's libraries (opt/emby-server/lib)?

Frosty, it is working on your Synology, right? Would you mind checking the version of the lib within your Emby install?

i don’t have that power, in the plugin the user can select the location for mediaInfo and mkvtoolnix 

Link to comment
Share on other sites

rbjtech
11 hours ago, Derkington said:

@niek That is correct. I have only seen this behavior after changing Emby's libraries. I have not seen these issues since reverting the changes. I know it is not the plugin itself that has caused this. @rbjtechsorry for any misunderstanding.  Switching the libraries is the only way I have found which makes the plugin work as it should. But those changes causes problems (described above) with Emby.

Right with you - sorry, my misunderstanding.  In that case, as cheese has said above, this is unfortunately out of our hands unless there is a way to force the executable under linux to use a specified library path for it's support files  ?   

Link to comment
Share on other sites

48 minutes ago, rbjtech said:

unless there is a way to force the executable under linux to use a specified library path for it's support files  ?   

That's what I meant in one of my last posts.

I'll have a look and try to do some research. Will feedback. 🙂

Link to comment
Share on other sites

I couldn't find a way to set a custom path for libraries but I am by no means a Linux expert.

@Derkington, I just added the missing versions (GLIBCXX_3.4.29 & CXXABI_1.3.13) to Emby's library in "/opt/emby-server/lib/libstdc++.so.6" and it seems already to do the trick.
Maybe the problems go away if you give it a try with this workaround?

  • Like 1
Link to comment
Share on other sites

FrostByte
16 hours ago, neik said:

Cheese, any chance you can point explicitly to the system libraries (/usr/lib/x86_64-linux-gnu) instead of Emby's libraries (opt/emby-server/lib)?

Frosty, it is working on your Synology, right? Would you mind checking the version of the lib within your Emby install?

I see version .28 in my Emby library.  Running 4.8.0.8

 

Link to comment
Share on other sites

Hi,

after i messed around with the library versions / passes i also think it would be nice to have an option to tell especialy mediainfo to use the system librabries instead of the emby libraries.

In addition i have a feature request;)

 

Is it possible to get a setup option to clear embedded title before the new ones will be written on newly added files?

Some movie files (releases;)) come with an embedded title in the segment information title fild. This will cause emby will show this title instead of the embedded info on the video track.

image.thumb.jpeg.82a9908f7f0569ebc2fd5160764c6b6f.jpeg

 

Only way right now is to edit every single file from hand, or do a reset embedded title run (and a normal run after) on the whole library.

In addition i want to thank you for this nice addone:)

 

Andreas

 

  • Like 1
  • Agree 1
Link to comment
Share on other sites

rbjtech
1 hour ago, Andy2k said:

Hi,

after i messed around with the library versions / passes i also think it would be nice to have an option to tell especialy mediainfo to use the system librabries instead of the emby libraries.

In addition i have a feature request;)

 

Is it possible to get a setup option to clear embedded title before the new ones will be written on newly added files?

Some movie files (releases;)) come with an embedded title in the segment information title fild. This will cause emby will show this title instead of the embedded info on the video track.

image.thumb.jpeg.82a9908f7f0569ebc2fd5160764c6b6f.jpeg

 

Only way right now is to edit every single file from hand, or do a reset embedded title run (and a normal run after) on the whole library.

In addition i want to thank you for this nice addone:)

 

Andreas

 

This is a great catch - I do this myself as part of my pre-processing - clear any FILE mkv titles, so I've not noticed it being an issue - but if you do not clear it - as @Andy2k says, emby will use this as the title of the item as opposed to it's metadata (as that's what you have told emby to do ..).  If there is no embedded title, THEN it falls back to the metadata title.

Note, this is not related to any TRACK titles - they will be overwritten regardless.

 

Link to comment
Share on other sites

FrostByte

Here's the json if you need.

"@type": "General",
"UniqueID": "4575615746736797294897156026288235107",
"VideoCount": "1",
"AudioCount": "2",
"TextCount": "1",
"MenuCount": "1",
"FileExtension": "mkv",
"Format": "Matroska",
"Format_Version": "4",
"FileSize": "72316062438",
"Duration": "7786.848",
"OverallBitRate_Mode": "VBR",
"OverallBitRate": "74295594",
"FrameRate": "23.976",
"FrameCount": "186696",
"StreamSize": "68650501",
"IsStreamable": "Yes",
"Title": "The Green Knight",
"Movie": "The Green Knight",
"Released_Date": "2021-07-29",
"Encoded_Date": "UTC 2022-09-12 14:46:30",
"File_Created_Date": "UTC 2022-09-12 14:46:30.467",
"File_Created_Date_Local": "2022-09-12 10:46:30.467",
"File_Modified_Date": "UTC 2022-09-12 14:57:09.685",
"File_Modified_Date_Local": "2022-09-12 10:57:09.685",
"Encoded_Application": "mkvmerge v70.0.0 ('Caught A Lite Sneeze') 64-bit",
"Encoded_Library": "libebml v1.4.2 + libmatroska v1.6.4",
"extra": {
"IMDB": "tt9243804",
"TMDB": "movie/559907"
}

I think you have to wipe out both the Title and Movie fields as both get populated when using MKVtoolnix.

My script adds title, release date, IMDB, and TMDB numbers so I never see the problem myself.

  • Like 1
Link to comment
Share on other sites

9 hours ago, Cheesegeezer said:

Thanks for the info, i hope you get this sorted, unfortunately the plugin can do anything to help you.

You can fix this in your plugin. As mentioned above:

On 9/9/2022 at 2:19 AM, softworkz said:

Possible Solutions

1. Use a Statically Compiled Binary 

It's possible to compile a binary "fully static". This means that the binary does not need to load any libraries because all are compiled into the executable.

A plugin could include such binary, save it to some place on disk and execute it from there. Also, it wouldn't be required anymore for users to install it to the system.

2. Adjust the Environment Variables

It's also possible to adjust the environment variables for the child process execution.

I can help you with this if you wish.
(but I can't access your project anymore).

softworkz

  • Like 1
Link to comment
Share on other sites

Derkington
On 12/09/2022 at 08:17, Cheesegeezer said:

Thanks for the info, i hope you get this sorted, unfortunately the plugin can do anything to help you. You probably need to start a new thread in Linux server section and raise the issue to emby admin.

i don’t have that power, in the plugin the user can select the location for mediaInfo and mkvtoolnix 

Somewhere LD_LIBRAY_PATH is being set to /opt/emby-server/lib because that is not a standard path in a Linux distribution. It's probably set for the emby user that emby runs under.  There must be away to append to this path or for the plugin to  set the path and set alternatives in someway.  I do not see how a user can do this unless the software provides the option in some way. If the plugin was  a standalone application then maybe.  This is about setting an environment variable not the binary path.

Link to comment
Share on other sites

Derkington
On 12/09/2022 at 11:49, neik said:

I couldn't find a way to set a custom path for libraries but I am by no means a Linux expert.

@Derkington, I just added the missing versions (GLIBCXX_3.4.29 & CXXABI_1.3.13) to Emby's library in "/opt/emby-server/lib/libstdc++.so.6" and it seems already to do the trick.
Maybe the problems go away if you give it a try with this workaround?

Happy try this work around if there is no otherway. How did you add the missing versions? Or rather  where did you find them and did you just copy them to /opt/emby-server/lib/?

Link to comment
Share on other sites

2 minutes ago, Derkington said:

Happy try this work around if there is no otherway. How did you add the missing versions? Or rather  where did you find them and did you just copy them to /opt/emby-server/lib/?

Just open the libstd(...) with an editor search for GLIBC & CXXABI then you will find some entries within the library, there I just added the version that the log showed me as missing..

I know, it's quite a dirty workaround but if it works I won't complain.

Maybe Cheese will figure out what softworkz pointed out, let's give them some time.. 🙂

 

  • Thanks 1
Link to comment
Share on other sites

Derkington
On 12/09/2022 at 17:41, softworkz said:

You can fix this in your plugin. As mentioned above:

I can help you with this if you wish.
(but I can't access your project anymore).

softworkz

If this is possible to address @Cheesegeezer and @softworkzplease let me know and I will wait for an update. If its not possible for some reason then that would be good to know as well. 

Thanks for offering your assistance @softworkz, I have just seen that you're an embydev, My fingers are crossed!

Link to comment
Share on other sites

26 minutes ago, Derkington said:

Somewhere LD_LIBRAY_PATH is being set to /opt/emby-server/lib because that is not a standard path in a Linux distribution

All explained above already.. 

Link to comment
Share on other sites

Cheesegeezer
2 hours ago, softworkz said:

All explained above already.. 

I’m not sure why you don’t have access anymore. Is there a time limit on GitHub? 
 

i will need to update it, but will add you tomorrow at some point so we can get this resolved for the guys 👍

thanks for your support chief 😉

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

Hi,

i have another "feature" request (or found a bug).

It looks like the media info plugin processes only files with (lowercase!) .mkv extension. I had for some reason some files with a uppercase .MKV extension. This isent a problem on windows systems, but for linux this result in an completeley different file, and the plugin ignores it.

 

Maybe the plugin should look for .mkv, .MKV and all variations ( case-insensitive) of this;)

 

Andreas

 

 

  • Like 2
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...