Jump to content

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


Cheesegeezer

Recommended Posts

cwills75

OK @Cheesegeezer, moving this from another thread to here as requested.  No new info with the part between the lines, same as before, just posting here for reference:
---------------------------------
Can't seem to find a way to get it to work.  If I manually download ffmpeg and biftool and run a command like this from Unraid command line:

ffmpeg -f matroska -skip_interval 10 -copyts -i file:"input.mkv" -an -sn -vf "zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=mobius:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p" -s 320x180 -vsync cfr -r 0.1 -f image2 bif/%08d.jpg

I get an error about skip_interval because it's not in that build.  If I remove the -skip_interval 10 part, ffmpeg/biftool runs, putting .jpg files in the bif folder.  It just doesn't work being referenced by the plugin.  So the biftool seems functional, it just throws up the NullReferenceException error with the plugin. 
----------------------------------
One thing tho that maybe somebody could help me with.  For testing purposes, I setup another Emby server on Windows and put a few movies in a local folder and installed this plugin.  I haven't done anything with the MediaInfo part of it yet, just wanted to try the bif creation.  It goes through the motions, and I can see the temporary .jpg files in plugins/configurations/BIFTempImages, but when it is done, the .jpgs disappear, and no resulting .bif file is being placed next to the media.  Any thoughts?

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

Cheesegeezer
24 minutes ago, cwills75 said:

OK @Cheesegeezer, moving this from another thread to here as requested.  No new info with the part between the lines, same as before, just posting here for reference:
---------------------------------
Can't seem to find a way to get it to work.  If I manually download ffmpeg and biftool and run a command like this from Unraid command line:

ffmpeg -f matroska -skip_interval 10 -copyts -i file:"input.mkv" -an -sn -vf "zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=mobius:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p" -s 320x180 -vsync cfr -r 0.1 -f image2 bif/%08d.jpg

I get an error about skip_interval because it's not in that build.  If I remove the -skip_interval 10 part, ffmpeg/biftool runs, putting .jpg files in the bif folder.  It just doesn't work being referenced by the plugin.  So the biftool seems functional, it just throws up the NullReferenceException error with the plugin. 
----------------------------------
One thing tho that maybe somebody could help me with.  For testing purposes, I setup another Emby server on Windows and put a few movies in a local folder and installed this plugin.  I haven't done anything with the MediaInfo part of it yet, just wanted to try the bif creation.  It goes through the motions, and I can see the temporary .jpg files in plugins/configurations/BIFTempImages, but when it is done, the .jpgs disappear, and no resulting .bif file is being placed next to the media.  Any thoughts?

bif tool should work with no issues.  that just gathers all the images created by ffmpeg and pops then into that container.

it's ffmpeg that is having the issues.  the skip interval is required i believe to create the 10s interval.

now i think someone else had issues with using Unraid, but can't remember who or what it was.

What system are you running on (linux, synology, windows, mac, etc)

 

Link to comment
Share on other sites

rbjtech

I believe you need to use emby's ffmpeg - as they have added some code for the speedy thumb extraction.

Just point your command line to the emby ffmpeg and it should work ..

edit - yea your same command as above works fine using emby's ffmpeg

C:\Users\richa>c:\emby-server\system\ffmpeg -f matroska -skip_interval 10 -copyts -i file:"input.mkv" -an -sn -vf "zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=mobius:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p" -s 320x180 -vsync cfr -r 0.1 -f image2 c:\bif\%08d.jpg

 

Edited by rbjtech
Link to comment
Share on other sites

cwills75
16 minutes ago, rbjtech said:

I believe you need to use emby's ffmpeg - as they have added some code for the speedy thumb extraction.

Just point your command line to the emby ffmpeg and it should work ..

edit - yea your same command as above works fine using emby's ffmpeg

C:\Users\richa>c:\emby-server\system\ffmpeg -f matroska -skip_interval 10 -copyts -i file:"input.mkv" -an -sn -vf "zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=mobius:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p" -s 320x180 -vsync cfr -r 0.1 -f image2 c:\bif\%08d.jpg

 

Yeah, I use Emby's ffmpeg in Windows for my manual bif creation with that command.  I figured it would work in Unraid also, but it's a PITA to get inside the Unraid docker to get at the ffmpeg file, so I just used the static build without the skip interval to see if the biftool would work or not with there being so many versions of linux available.

  • Like 1
Link to comment
Share on other sites

cwills75
20 minutes ago, Cheesegeezer said:

bif tool should work with no issues.  that just gathers all the images created by ffmpeg and pops then into that container.

it's ffmpeg that is having the issues.  the skip interval is required i believe to create the 10s interval.

now i think someone else had issues with using Unraid, but can't remember who or what it was.

What system are you running on (linux, synology, windows, mac, etc)

 

My main system is a PC running Unraid.  The test system is Windows 10, I'm going to see if I can figure out why it's not creating bifs on there if I can see anything obvious.

Link to comment
Share on other sites

Cheesegeezer
1 hour ago, cwills75 said:
ffmpeg -f matroska -skip_interval 10 -copyts -i file:"input.mkv" -an -sn -vf "zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=mobius:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p" -s 320x180 -vsync cfr -r 0.1 -f image2 bif/%08d.jpg

 

I think i've found your issue actually.

bif tool just wants the    "%08d.jpg"

or possibly the folder bif/%08d.jpg

should be bif\%08d.jpg  with the back slash going the other way

 

Link to comment
Share on other sites

cwills75
Just now, Cheesegeezer said:

I think i've found your issue actually.

bif tool just wants the    "%08d.jpg"

or possibly the folder bif/%08d.jpg

should be bif\%08d.jpg  with the back slash going the other way

 

I'm confused.  I don't have any issues with that command manually creating bifs in Windows.  I downloaded static ffmpeg and biftool on Unraid and ran it with the command line and everything works (besides skip interval because of static build).  That was just done for me to make sure that the linux biftool I downloaded is binary executable on Unraid, which it is and works.  My issue with Unraid/this plugin is when the plugin is trying to use biftool and creating bifs I'm getting this error in Emby logs:

2022-09-01 11:50:18.398 Info Media Info: New Item Added --- Running BIF Generator Task for Oxygen (2021)
2022-09-01 11:50:18.398 Error Media Info: Error in Starting BIF Generator Task for newly added item Oxygen (2021)
2022-09-01 11:50:18.398 Error Media Info: System.NullReferenceException: Object reference not set to an instance of an object.
   at Emby.Server.Implementations.ScheduledTasks.TaskManager.Execute(IScheduledTaskWorker task, TaskOptions options)
   at Emby.MediaInfo.MediaInfoPluginEntryPoint.LibraryManagerItemAdded(Object sender, ItemChangeEventArgs e)

In Unraid I have the biftool on a drive share that the Emby docker has access to, and it is pointed to in the plugin config, but it just shows that error.  That's why I downloaded ffmpeg later on (in Unraid) to see if the biftool itself was the problem or not, but that seems to be working.  I just don't know how to get around that NullReferenceException error with Emby/plugin.

Link to comment
Share on other sites

Cheesegeezer
7 minutes ago, cwills75 said:

I'm confused.  I don't have any issues with that command manually creating bifs in Windows.  I downloaded static ffmpeg and biftool on Unraid and ran it with the command line and everything works (besides skip interval because of static build).  That was just done for me to make sure that the linux biftool I downloaded is binary executable on Unraid, which it is and works.  My issue with Unraid/this plugin is when the plugin is trying to use biftool and creating bifs I'm getting this error in Emby logs:

2022-09-01 11:50:18.398 Info Media Info: New Item Added --- Running BIF Generator Task for Oxygen (2021)
2022-09-01 11:50:18.398 Error Media Info: Error in Starting BIF Generator Task for newly added item Oxygen (2021)
2022-09-01 11:50:18.398 Error Media Info: System.NullReferenceException: Object reference not set to an instance of an object.
   at Emby.Server.Implementations.ScheduledTasks.TaskManager.Execute(IScheduledTaskWorker task, TaskOptions options)
   at Emby.MediaInfo.MediaInfoPluginEntryPoint.LibraryManagerItemAdded(Object sender, ItemChangeEventArgs e)

In Unraid I have the biftool on a drive share that the Emby docker has access to, and it is pointed to in the plugin config, but it just shows that error.  That's why I downloaded ffmpeg later on (in Unraid) to see if the biftool itself was the problem or not, but that seems to be working.  I just don't know how to get around that NullReferenceException error with Emby/plugin.

Ok gotchya.

let me add in some extra logging, do you wanna come over and join our Dev thread to help with testing. 
no pressure, its upto you entirely mate

Link to comment
Share on other sites

cwills75
2 minutes ago, Cheesegeezer said:

Ok gotchya.

let me add in some extra logging, do you wanna come over and join our Dev thread to help with testing. 
no pressure, its upto you entirely mate

Sure, I can try and provide feedback for Unraid systems.

Link to comment
Share on other sites

rbjtech

To add - on my post above when testing the syntax - I also turned around the / to backslash.  It's a file location - so Windows is not gonna like a \ but of course that is what is used on linux ... hmmm

This has been working on other linux systems fine hasn't it @Cheesegeezer ?

Link to comment
Share on other sites

Cheesegeezer
11 minutes ago, rbjtech said:

To add - on my post above when testing the syntax - I also turned around the / to backslash.  It's a file location - so Windows is not gonna like a \ but of course that is what is used on linux ... hmmm

This has been working on other linux systems fine hasn't it @Cheesegeezer ?

Yeah frosty is on a synology which I believe is a version of linux, neik also is on linux

Link to comment
Share on other sites

Dizzy49

So... WHat if I do not have any existing BIF images.  Do I need to have Emby create them so that this can update them?

Link to comment
Share on other sites

Cheesegeezer
1 hour ago, Dizzy49 said:

I'm running the mediainfo process on 50k videos, so we'll see just how fast it is :D

Sweet. Yeah good luck. 

Link to comment
Share on other sites

Dizzy49
1 hour ago, Cheesegeezer said:

Sweet. Yeah good luck. 

It's been running for 2hrs and it's at 0.0%, so I'm not sure if it's actually running...

Any idea on my question on what to do if I had no bif files to begin with?

 

Link to comment
Share on other sites

Cheesegeezer
1 hour ago, Dizzy49 said:

It's been running for 2hrs and it's at 0.0%, so I'm not sure if it's actually running...

You can check the config file, Emby.MediaInfo.xml found in \Emby-Server\programdata\plugins\configurations to see if it's populating the processed list

Can you share the emby log? What system are you running on?

1 hour ago, Dizzy49 said:

Any idea on my question on what to do if I had no bif files to begin with?

 

so have you read the wiki? All the info to get it up and running is in there 👍

image.png.6de723cb5891fff8c5c7e22324b160fd.png

Link to comment
Share on other sites

rbjtech

You need existing BIF's as the code looks it when replacing.  if you don't have the existing BIF - it will fail (but still generate the temp files).

@Cheesegeezer - this is probably a 'bug' and it probably should a) check first, before extracting the files or b) write the bif file anyway if successfully created (even if it does not exist) - but the user then needs to ensure the feature is turned on in emby (afterwards) or it will never use the newly created BIF's ...

 

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

Cheesegeezer
15 minutes ago, rbjtech said:

You need existing BIF's as the code looks it when replacing.  if you don't have the existing BIF - it will fail (but still generate the temp files).

@Cheesegeezer - this is probably a 'bug' and it probably should a) check first, before extracting the files or b) write the bif file anyway if successfully created (even if it does not exist) - but the user then needs to ensure the feature is turned on in emby (afterwards) or it will never use the newly created BIF's ...

 

I've done the fix for this.

image.png.59dd0010c98f2ea25f427e540503875a.png

let me have a think about the new created images and make sure that we do this right

  • Like 1
Link to comment
Share on other sites

FrostByte

Just curious why is there a time setting in the options if it can't actually create bifs.  Emby can only create 10 seconds bifs now.  But, even if you created your own bifs at 5 seconds the plugin could just take whatever bif file is present and add tone mapping to it.  

The Powershell script I use creates bifs at set intervals and the tone maps them.  I guess I thought that's where it was going eventually with the setting.  If not, shouldn't that setting be removed?

Link to comment
Share on other sites

rbjtech
14 minutes ago, FrostByte said:

Just curious why is there a time setting in the options if it can't actually create bifs.  Emby can only create 10 seconds bifs now.  But, even if you created your own bifs at 5 seconds the plugin could just take whatever bif file is present and add tone mapping to it.  

The Powershell script I use creates bifs at set intervals and the tone maps them.  I guess I thought that's where it was going eventually with the setting.  If not, shouldn't that setting be removed?

Little confused by what you wrote.

It does create the BIF's - only from a HDR source and you can specify the interval if you wish - default to 10 seconds.

The issue is (or was) that the final biftool write checked for the existence of an existing BIF file (with no tonemapping) - it then replaced it.  If it didn't exist - then this likely means that the Thumbnail previews is not turned on for that library (nothing to do with the plugin).   Thus even if the plugin did create them, emby would not use them - until that feature is turned on.

Edited by rbjtech
Link to comment
Share on other sites

Cheesegeezer
33 minutes ago, FrostByte said:

Just curious why is there a time setting in the options if it can't actually create bifs.

the plugin creates their own bif images. It doesn’t edit existing emby created ones. Its also a feature you asked for lol

 

Link to comment
Share on other sites

rbjtech
5 minutes ago, Cheesegeezer said:

the plugin creates their own bif images. It doesn’t edit existing emby created ones. Its also a feature you asked for lol

 

I think I asked for it - rather than run a script manually.  It works fantastic,  but a few issues have cropped up in testing (for others) because people did not have the 'thumbnail preview' turned on - which is odd, because how did they know the (non-tonemapped) thumbnails looked like crap ? 🤣

Anyway - I think it's a minor thing to catch that condition - but I don't think it's up to the Plugin to ensure emby is using them - that is up to the user to turn it on imo.

The other new feature of re-processing BIF's/MediaInfo is for those of us that 'upgrade' the quality of existing media - because the plugin tracks via ItemId,  it doesn't catch that the source media has changed.  The BIF part is done and hopefully @Cheesegeezer will do the same for the MediaInfo part - but there is no rush - nothing has broken, it's a feature enhancement.  👍

Edited by rbjtech
Link to comment
Share on other sites

FrostByte
46 minutes ago, Cheesegeezer said:

the plugin creates their own bif images. It doesn’t edit existing emby created ones. Its also a feature you asked for lol

 

Yes, I believe I asked for that setting.  I'm just kind of confused on why it NEEDS existing bifs to work if it's creating new ones.  Can't it just look to see if there are bifs in the folder and remove the old one if there is one?

Link to comment
Share on other sites

Cheesegeezer

Its to make sure the user is using the correct setting in Emby. Ie. That have the 10sec thumbs created and that they have the option ticked to store that file in folder.

if not then they will never see the new bif, i think i will just override the server settings if bif in plugin is enabled…. What you think?

Link to comment
Share on other sites

FrostByte

Ok.  Currently I don't let Emby create bifs for any of my HDR movies.  I use a PS script that creates 5 second bifs and tone maps them.  Then I throw them in the folder and a scan sees them and I can use them in clients.   

I'm not sure the plugin would be any different other than you would need to know where to place the bifs if there were none.

You could either check the current setting for location in Emby and/or let the user change that setting within the plugin.

Just a thought.  That way we aren't creating bifs twice.

 

 

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