Jump to content

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


Cheesegeezer

Recommended Posts

rbjtech
3 minutes ago, neik said:

I've seen such files as well but in this case the affected ones are do seem to have a "regular" order.
Example 1:

Format                                   : Matroska
Format version                           : Version 4
File size                                : 2.23 GiB
Duration                                 : 1 h 39 min
Overall bit rate                         : 3 210 kb/s
Encoded date                             : UTC 2020-08-29 10:25:44
Writing application                      : mkvmerge v19.0.0 ('Brave Captain') 64-bit
Writing library                          : libebml v1.3.5 + libmatroska v1.4.8

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L3.1
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Format settings, GOP                     : M=1, N=50
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 1 h 39 min
Bit rate mode                            : Constant
Bit rate                                 : 3 199 kb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 25.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.139
Stream size                              : 2.16 GiB (97%)
Title                                    : 720p AVC
Language                                 : German
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : A_AAC-2
Duration                                 : 1 h 39 min
Bit rate                                 : 96.0 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 44.1 kHz
Frame rate                               : 43.066 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 68.3 MiB (3%)
Title                                    : AAC LC 2.0
Language                                 : German
Default                                  : Yes
Forced                                   : No

Example 2:

Format                                   : Matroska
Format version                           : Version 4
File size                                : 911 MiB
Duration                                 : 50 min 21 s
Overall bit rate                         : 2 530 kb/s
Encoded date                             : UTC 2020-08-25 08:43:12
Writing application                      : mkvmerge v47.0.0 ('Black Flag') 64-bit
Writing library                          : libebml v1.3.10 + libmatroska v1.5.2

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L3.1
Format settings                          : CABAC / 3 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 3 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 50 min 21 s
Bit rate                                 : 2 402 kb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 25.000 FPS
Standard                                 : PAL
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.104
Stream size                              : 865 MiB (95%)
Title                                    : 720p AVC
Default                                  : Yes
Forced                                   : No
Color range                              : Limited

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : A_AAC-2
Duration                                 : 50 min 21 s
Bit rate                                 : 125 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -80 ms
Stream size                              : 45.2 MiB (5%)
Title                                    : AAC LC 2.0
Language                                 : German
Default                                  : Yes
Forced                                   : No

 

ok thanks - it's not that then.  

And the issue is it's not saving that the items have been 'processed' - and keeps re-trying them over and over correct ?

Does the XML have 'any' processed items ?

in ..\programdata\config\mediainfo.xml

 

Link to comment
Share on other sites

neik
1 minute ago, rbjtech said:

And the issue is it's not saving that the items have been 'processed' - and keeps re-trying them over and over correct ?

From what I see, yes that's correct.

1 minute ago, rbjtech said:

Does the XML have 'any' processed items ?

Yes, it does.

Link to comment
Share on other sites

rbjtech
3 minutes ago, neik said:

From what I see, yes that's correct.

Yes, it does.

ok - if you can PM me the XML - it doesn't contain anything other than the Id's of your media items - but that might give us some clues.

Cheese might wanna see the corresponding log as well - but lets see if the XML is formatted properly first.

I'll take a look at this tomorrow.

Link to comment
Share on other sites

MagicDoubleM
5 hours ago, Cheesegeezer said:

@MagicDoubleM @neik  @Mookdog

 

Version 3.0 is up on first post... I haven't had chance to create a wiki for the Convert to MKV, but the video above will help you out massively.

NOTHING WILL BE DELETED UNITL WE ARE HAPPY WITH THE CONVERSION. So please check your logs in DEBUG mode to keep an eye on this.

If you have any doubts about running the convert to mkv feature, just leave it alone.

Following fixes

  1. NFO tag writting and removal should be fixed
  2. Items remaining in cache should be fixed. 

Again, great work. I'm impressed.


Yep, tags are there and seem to stay now.
MP4/M4V to MKV worked flawless on the first two samples I've tried, more testing on that soon.

Link to comment
Share on other sites

rbjtech
27 minutes ago, rbjtech said:

ok - if you can PM me the XML - it doesn't contain anything other than the Id's of your media items - but that might give us some clues.

Cheese might wanna see the corresponding log as well - but lets see if the XML is formatted properly first.

I'll take a look at this tomorrow.

I've have a very quick look at this - and believe it's corruption in the dB / orphaned entries.

If I take the item out the dB (remove the item to an area not covered by the scan), then scan the media library.  Then put the item back and let emby re-detect it - it THEN gets added to the processed list just fine and doesn't get processed again.

If you get some time,  make a note of the item id - do what I have described above - and then see if it get processed (which on the first time it should), then run it again and it should not process the same item.  You can also just do a search for it in the XML - if it exists, then it's been processed ;)

Link to comment
Share on other sites

Mookdog
1 hour ago, MagicDoubleM said:

Again, great work. I'm impressed.


Yep, tags are there and seem to stay now.
MP4/M4V to MKV worked flawless on the first two samples I've tried, more testing on that soon.

Yeah I am trying 20 movies for now. My laptop is such a damn potato its taking awhile lol. Will report back to @Cheesegeezeronce all 20 convert.

 

Link to comment
Share on other sites

MagicDoubleM

Thinking out loud, and not going to verbalize that as feature request, but since hdr10plus_tool and dovi_tool exist and allow some fun-stuff, like converting hdr10+ to dolbyvision, utilizing their power could be an interesting addition in the future. 😅

 

  • Like 1
Link to comment
Share on other sites

FrostByte
2 minutes ago, MagicDoubleM said:

Thinking out loud, and not going to verbalize that as feature request, but since hdr10plus_tool and dovi_tool exist and allow some fun-stuff, like converting hdr10+ to dolbyvision, utilizing their power could be an interesting addition in the future. 😅

 

Ya, I was going to suggest a couple weeks ago to use dovi_tool to identify FEL and MEL DV7, but didn't want to be shot 😂

  • Haha 1
Link to comment
Share on other sites

Mookdog

Hey @Cheesegeezer

I tested it on various mp4 and avi files. 20 in total and it converted them all. On this potato of a laptop it took a bit but I am sure on my desktop it will work faster. Most files were HEVC X265 and they converted to mkv no problem. Some of them were also h264 which converted fine. The other 1 I tried was an xvid avi and it converted also. So its looking pretty solid on my end. Once auto delete is enabled this would save a huge headache lol

 

Thanks brother

Mook

Edited by Mookdog
Link to comment
Share on other sites

rbjtech

This project has basically grown using my initial bunch of 'scripts'/concepts to do these things coupled with Dave's ( @Cheesegeezer) skills using C# into an Emby Plugin MKV 'toolbox'  :)

Dave is trying to get tabs working (like the Introskip Plugin) so each 'function' has it's own tab - which will look a little nicer.

On the dovi_tool stuff - I've never really played with this - so if somebody else can provide script examples - the inputs and outputs required - the online tool location etc - then I'm sure it something which Dave may add.  Probably worth PMing those in this thread that you think can help on this rather than clutter this 'testing' thread - we'll have that as a 'design' thread - the same as we did for Introskip.  Please add @chef as he always have some amazing insight and ideas for plugins. 

I do know Dave wants to get on with Iridium (lol) but the toolbox just keeps getting bigger and better (now with his MKV Convert function added).

tbh - I think this is a long overdue plugin - and I can begin to retire a lot of my scripts that do this stuff and have it all integrated/logging into emby running on an emby schedule !

@Cheesegeezer - Another function to add to the list is a very simple script to 'insert' a compatible AAC/AC3 or EAC3 Default Audio Track for Media with only DTS Audio Tracks.    I know emby have finally caught up on some apps with live transcoding of the DTS, but it's always better to have a native track that can be relied upon now that DTS is not commonplace on low-mid range soundbars/TV's for example.   Any thoughts guys ?    Script is a single ffmpeg line - so it's very easy.

ffmpeg.exe -i "input.mkv -map 0:v -map 0:a:0 -map 0:a -c:v copy -c:a copy -c:a:0 (CHOSEN_AUDIO_CODEC - ie aac) -ac 2 (DOWNMIX OPTIONAL) -filter:a:0 "volume=1.3" (BOOST the convertion volume to keep the same as the original) -disposition:a:0 default -disposition:a:1 0 (THIS changes the track defaults) -metadata:s:a:0 title="NEW DEFAULT TRACK TITLE" -metadata:s:a:1 title="ORIGINAL TRACK TITLE" -f matroska output.mkv

 

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

FrostByte
2 hours ago, rbjtech said:

an Emby Plugin MKV 'toolbox'  :)

 

Might need to change the name of the plugin to that soon.  It's becoming much more than just mediainfo.  Or, split it.

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

Cheesegeezer
2 hours ago, FrostByte said:

Might need to change the name of the plugin to that soon.  It's becoming much more than just mediainfo.  Or, split it.

Coz it’s frickin amazing 🤩 hahahah

sorry I can’t look at a laptop screen just yet, got a hangover that would kill a civvy!

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

MagicDoubleM
13 hours ago, rbjtech said:

On the dovi_tool stuff - I've never really played with this - so if somebody else can provide script examples - the inputs and outputs required - the online tool location etc - then I'm sure it something which Dave may add.  Probably worth PMing those in this thread that you think can help on this rather than clutter this 'testing' thread - we'll have that as a 'design' thread - the same as we did for Introskip.  Please add @chef as he always have some amazing insight and ideas for plugins. 

It's not THAT complicated, one of the major use-cases would be to generate DV from HDR10plus sources (it doesn't work the other way around, so Samsung TV-users have no luck here). And this works as follows:

1. demux the videostream
2. extract HDR10plus metadata: "hdr10plus_tool.exe extract --input test.h265 -o hdr10plus_metadata.json"
3. generate DV-rpu: "dovi_tool.exe generate -j default_cmv40.json --hdr10plus-json hdr10plus_metadata.json -o RPU_from_hdr10plus.bin"
4. inject DV-rpu to h265: "dovi_tool.exe inject-rpu -i test.h265 --rpu-in RPU_from_hdr10plus.bin -o test_with_dv.h265"
5. remux to mkv

This will produce a file that has DV and HDR10plus meta-data and works on my LG-TV through emby on shield and a firestick.

sources are: https://github.com/quietvoid/hdr10plus_tool and https://github.com/quietvoid/dovi_tool

Make sure to grab the repository from dovi-tool, as you need the the default_cmv40.json from the assets-folder, which isn't included in the distributed zip-file of the binary.

  • Thanks 1
Link to comment
Share on other sites

MagicDoubleM
14 hours ago, rbjtech said:

@Cheesegeezer - Another function to add to the list is a very simple script to 'insert' a compatible AAC/AC3 or EAC3 Default Audio Track for Media with only DTS Audio Tracks.    I know emby have finally caught up on some apps with live transcoding of the DTS, but it's always better to have a native track that can be relied upon now that DTS is not commonplace on low-mid range soundbars/TV's for example.   Any thoughts guys ?    Script is a single ffmpeg line - so it's very easy.

ffmpeg.exe -i "input.mkv -map 0:v -map 0:a:0 -map 0:a -c:v copy -c:a copy -c:a:0 (CHOSEN_AUDIO_CODEC - ie aac) -ac 2 (DOWNMIX OPTIONAL) -filter:a:0 "volume=1.3" (BOOST the convertion volume to keep the same as the original) -disposition:a:0 default -disposition:a:1 0 (THIS changes the track defaults) -metadata:s:a:0 title="NEW DEFAULT TRACK TITLE" -metadata:s:a:1 title="ORIGINAL TRACK TITLE" -f matroska output.mkv

 

Yes, you got my vote for that. Maybe even optinally generate an additional track for each DTS-track?

Link to comment
Share on other sites

FrostByte

Samsung users would need a HDfury and an EDID file in order for the TV to understand LLDV.

  • Like 1
Link to comment
Share on other sites

FrostByte

Similarly in order to add MEL or FEL to the mediainfo DV7 string you would need to extract the HEVC and run the following two commands using dovi_tool to extract the RPU and then examine the metadata for one frame.

dovi_tool.exe extract-rpu input.hevc
dovi_tool.exe info -i RPU.bin -f 123

This is what the first few lines will look like

  "dovi_profile": 7,
  "subprofile": "FEL",
  "header": {

Then you could use the subprofile line to change the video Title to "4K DV7 FEL HDR10"

 

Edited by FrostByte
Link to comment
Share on other sites

Cheesegeezer
29 minutes ago, MagicDoubleM said:

It's not THAT complicated

and everyone is an expert in their own field. 

29 minutes ago, MagicDoubleM said:

 

one of the major use-cases would be to generate DV from HDR10plus sources (it doesn't work the other way around, so Samsung TV-users have no luck here).

DV has way more color information than HDR and uses dynamic images rather than stills. 

so a lot of interpolation and algorithms are being used to falsely inject more color range. Which is like upscaling a 480i video to 1080p

my question is… is the movie actually significantly better quality or is it just a feel good that you now have a DV tag on it. Does it seriously resemble a shot and edited sequence that has DV built into the final product? 
 

i have an idea of adding in a custom process generator that would then create a schedule task from your command line that could used on each library 

 

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

MagicDoubleM
17 minutes ago, Cheesegeezer said:

my question is… is the movie actually significantly better quality or is it just a feel good that you now have a DV tag on it. Does it seriously resemble a shot and edited sequence that has DV built into the final product? 

i have an idea of adding in a custom process generator that would then create a schedule task from your command line that could used on each library 

 

This sounds very interesting.


In regard to your question, no the result isn't a proper DV file utilizing all the benefits of what DV has to offer, but you end up with a file that should be close to what the HDR10+ version looks. Comparing to a standard HDR10-file (which you usually have to fall back to with most HDR10plus releases) this indeed brings visual advantages, since the brightness-level will be adjusted dynamically.

That's the one use-case I can imagine being a part of this, others are more enhanced and involve multiple versions to build one (DV5+HDR10 to DV8 for example)

Link to comment
Share on other sites

Mookdog

@Cheesegeezer

When can we expect the updated dll to automatically delete our mkv files ? Im ready to get started. 20 movies down and so far no problems in converting them

 

Mook

Link to comment
Share on other sites

rbjtech
13 hours ago, Cheesegeezer said:

my question is… is the movie actually significantly better quality or is it just a feel good that you now have a DV tag on it. Does it seriously resemble a shot and edited sequence that has DV built into the final product? 

I would have to agree on this.  There is a definite picture improvement on SOME films when using DV vs HDR10 - films with either very light/daylight or very dark/night scenes get the most benefit - but for the 'average' film - you really would need to see them side by side to 'identify' what DV was bringing to the party for that particular scene.

I have also questioned the 'overlay' of titles streamed with DV vs their UHD HDR10 only counterparts - maybe it's a licensing thing (and it's just tagged on - as you say, to avoid complaints that their TV is not bringing up the DV label..) or maybe all titles have the potential to have 'real' DV and it's just added as the streaming provider has paid for the license to use that 'version'.

Link to comment
Share on other sites

Cheesegeezer
10 hours ago, Mookdog said:

@Cheesegeezer

When can we expect the updated dll to automatically delete our mkv files ? Im ready to get started. 20 movies down and so far no problems in converting them

 

Mook

Check your PM's Chief

 

Link to comment
Share on other sites

FrostByte
33 minutes ago, rbjtech said:

I would have to agree on this.  There is a definite picture improvement on SOME films when using DV vs HDR10 - films with either very light/daylight or very dark/night scenes get the most benefit - but for the 'average' film - you really would need to see them side by side to 'identify' what DV was bringing to the party for that particular scene.

I have also questioned the 'overlay' of titles streamed with DV vs their UHD HDR10 only counterparts - maybe it's a licensing thing (and it's just tagged on - as you say, to avoid complaints that their TV is not bringing up the DV label..) or maybe all titles have the potential to have 'real' DV and it's just added as the streaming provider has paid for the license to use that 'version'.

Maybe in a couple years there will be something other than an OPPO or UHD player which can actually play the full enhanced layer of DV.  That's where you should really see the difference when using the 12-bit color space of FEL.  All you can get now is the RPU metadata changes which you described.

Link to comment
Share on other sites

Cheesegeezer

So what we saying fellas?? Is it worthy adding this or not? 

Link to comment
Share on other sites

FrostByte

Not for me, I prefer to do that type of stuff outside of Emby.  Besides, that would be a long flight just to hunt you down if all my stuff suddenly disappeared :)

Link to comment
Share on other sites

Cheesegeezer
4 minutes ago, FrostByte said:

Not for me, I prefer to do that type of stuff outside of Emby.  Besides, that would be a long flight just to hunt you down if all my stuff suddenly disappeared :)

On about the DV stuff not the conversion lol 😂 

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