Solved Media Information from Iso Files
#46
As the current code stands, only the info from the currently playing stream is saved.  That means that if you don't turn on subs whilst playing an ISO then that info doesn't get saved.  As you rightly point out @brazen1, Kodi doesn't probe for all the subtitle/audio info when playing an ISO in the same way it does for say MKV or MP4 etc.  It might be possible to iterate over all the subs and save them but that would be a different PR.

With these changes, Kodi should do the same as Krypton did. Extending things (picking up all the subtitle languages, fixing the odd AR issues) might be possible in the future but this will need merging first as a starting point I think.  The (so far) mainly positive feedback can only help in that regard.

~~~EDIT~~~

Actually, having looked at the code, it turns out it's actually trivial to save all the audio stream and subtitle data.  Still need to play the main title, but all audio streams and all subtitles can be saved (without having to enable them).  Personally, I think it's a great improvement but I need to make sure that I haven't introduced any memory leaks or regressions.  If I can include it with the current PR and if it gets accepted then it would mean that playing the main title of an iso etc would save the same details as the background loader does for MKV's etc.
Learning Linux the hard way !!
Reply
#47
(2021-04-09, 20:16)black_eagle Wrote: As the current code stands, only the info from the currently playing stream is saved.  That means that if you don't turn on subs whilst playing an ISO then that info doesn't get saved.  As you rightly point out @brazen1, Kodi doesn't probe for all the subtitle/audio info when playing an ISO in the same way it does for say MKV or MP4 etc.  It might be possible to iterate over all the subs and save them but that would be a different PR.

With these changes, Kodi should do the same as Krypton did. Extending things (picking up all the subtitle languages, fixing the odd AR issues) might be possible in the future but this will need merging first as a starting point I think.  The (so far) mainly positive feedback can only help in that regard.

~~~EDIT~~~

Actually, having looked at the code, it turns out it's actually trivial to save all the audio stream and subtitle data.  Still need to play the main title, but all audio streams and all subtitles can be saved (without having to enable them).  Personally, I think it's a great improvement but I need to make sure that I haven't introduced any memory leaks or regressions.  If I can include it with the current PR and if it gets accepted then it would mean that playing the main title of an iso etc would save the same details as the background loader does for MKV's etc.
First of all, thank you for your work (it is annoying not to have those little tags), I am looking forward to have all languages and subtitles tags back where they belong to. I have a question about that issue and the process kodi determines the audio tracks, what is (coding-wise) the difference between showing the audio data on the movie page in the library and showing the audio data (the different audio tracks to select) when i press on the little speaker in the video player controls and then under "Audiostreams"? Because there I can see all availiable audio tracks and codecs. Can't you just take the information from there!? (Yes I have no plan about programming! and stuff!) I was just interested to know why I can see the information present there and in the library not, or just the one track it was on when I opened the movie. 
best regards, and sorry if this question might make no sense.
Reply
#48
(2021-04-11, 21:59)Cody Allen Wrote: First of all, thank you for your work (it is annoying not to have those little tags), I am looking forward to have all languages and subtitles tags back where they belong to. I have a question about that issue and the process kodi determines the audio tracks, what is (coding-wise) the difference between showing the audio data on the movie page in the library and showing the audio data (the different audio tracks to select) when i press on the little speaker in the video player controls and then under "Audiostreams"? Because there I can see all availiable audio tracks and codecs. Can't you just take the information from there!? (Yes I have no plan about programming! and stuff!) I was just interested to know why I can see the information present there and in the library not, or just the one track it was on when I opened the movie. 
best regards, and sorry if this question might make no sense.

Good question!

The short answer is that the info you see when browsing your library comes from the database and that the info you see on screen when you choose a subtitle or audio track whilst the video is playing comes from the video player itself.

Longer answer.

When I originally began looking at this, I pretty much took the old implementation from several years ago and re-added it to make it work again.  But then someone raised a point about the background loader (the part of Kodi that scans your media files in the background and pulls out all the codec info, thumbnails etc) and it occurred to me that it saves details about all the audio streams and all the subtitles.  As you rightly point out, the video player does have details of all the streams but the original implementation of the code simply saved the details of the currently playing stream rather than all of them.  So, I looked at how the background loader does it and implemented the much same thing for ISO's etc.

You will still have to play the main feature but it won't matter if you enable subtitles or not, or which audio track you listen to, all the details will be saved.  Quite why it wasn't written like that originally, I have no idea.  There could well have been good technical reasons at the time.  Video player is a very important part of Kodi and was written by people much cleverer than me.  Making changes to it is not something I take lightly at all, even if it is only a tiny corner of it.  That's why it needs careful reviewing and consideration given to any possible side-effects or regressions it might introduce before it can be accepted.

Saving all the stream details is still only local to my dev-machine at the moment and not in the current PR on github.  I've tested it here multiple times with no apparent issues but wider testing by the community is always desirable.  To do that I will need to update my PR with the new code and get a test build uploaded.
Learning Linux the hard way !!
Reply
#49
(2021-04-12, 08:27)black_eagle Wrote:
(2021-04-11, 21:59)Cody Allen Wrote: First of all, thank you for your work (it is annoying not to have those little tags), I am looking forward to have all languages and subtitles tags back where they belong to. I have a question about that issue and the process kodi determines the audio tracks, what is (coding-wise) the difference between showing the audio data on the movie page in the library and showing the audio data (the different audio tracks to select) when i press on the little speaker in the video player controls and then under "Audiostreams"? Because there I can see all availiable audio tracks and codecs. Can't you just take the information from there!? (Yes I have no plan about programming! and stuff!) I was just interested to know why I can see the information present there and in the library not, or just the one track it was on when I opened the movie. 
best regards, and sorry if this question might make no sense.

Good question!

The short answer is that the info you see when browsing your library comes from the database and that the info you see on screen when you choose a subtitle or audio track whilst the video is playing comes from the video player itself.

Longer answer.

When I originally began looking at this, I pretty much took the old implementation from several years ago and re-added it to make it work again.  But then someone raised a point about the background loader (the part of Kodi that scans your media files in the background and pulls out all the codec info, thumbnails etc) and it occurred to me that it saves details about all the audio streams and all the subtitles.  As you rightly point out, the video player does have details of all the streams but the original implementation of the code simply saved the details of the currently playing stream rather than all of them.  So, I looked at how the background loader does it and implemented the much same thing for ISO's etc.

You will still have to play the main feature but it won't matter if you enable subtitles or not, or which audio track you listen to, all the details will be saved.  Quite why it wasn't written like that originally, I have no idea.  There could well have been good technical reasons at the time.  Video player is a very important part of Kodi and was written by people much cleverer than me.  Making changes to it is not something I take lightly at all, even if it is only a tiny corner of it.  That's why it needs careful reviewing and consideration given to any possible side-effects or regressions it might introduce before it can be accepted.

Saving all the stream details is still only local to my dev-machine at the moment and not in the current PR on github.  I've tested it here multiple times with no apparent issues but wider testing by the community is always desirable.  To do that I will need to update my PR with the new code and get a test build uploaded.

Cool, thank you for the detailed answer! As soon as there is a test build i am happy to test, because my collection is UHDBD, BD, BD3D, DVD - .iso/BDMV/VIDEO_TS only!
best regards and thank you for your efforts!
Reply
#50
(2021-04-08, 21:13)brazen1 Wrote: ...
I have quite a few multi aspect ratio movies.   IMAX for example.  TRON: Legacy (2010).  The Dark Knight (2008).  Interstellar (2014).  Catch Me If You Can (2002).  Kill Bill: Vol. 2 (2004).  Etc.  No matter which aspect ratio is playing at the time, it reports as 1.78:1 for iso's.  Sort of the same for an mkv.  The Aeronauts (2019).  Reports as 1.85:1.  There is an aspect ratio change at 52:53 but it still reports as 1.85:1....
I must admit i did not pay too much intention on the aspect ratio information. If i remember correctly the ISO´s i had tested all showed 16:9. This is preceise enough for me. Could it be that Aspect Ratio Flagging is skin specific (I use Rapier)? Maybe not all skins display the full precission like 1,43:1, 1,85:1....?

I was more interested in the Audio Format Information as this triggers the selection of the corresponding Audio Bumper when playing a movie with CinemaVision.
Reply
#51
(2021-04-04, 18:24)black_eagle Wrote:
(2021-04-04, 17:42)Reelyator Wrote: I am not very familiar with the workflows on Github, could somebode pls explain, whaT a "PR" is??

Sure.  PR = Pull Request.  It is a request to change some of the code and shows what will be added/removed.  That then gets reviewed by other team members and if the PR gets approval it is then 'merged' which means the changes are made to the core code.
....so what would be the next steps here? Assuming that the PR receives Approval from the other team members?

Would this fix be corrected with 19.1 or do we need to wait for 20...?
Reply
#52
(2021-04-12, 11:49)Reelyator Wrote:
(2021-04-08, 21:13)brazen1 Wrote: ...
I have quite a few multi aspect ratio movies.   IMAX for example.  TRON: Legacy (2010).  The Dark Knight (2008).  Interstellar (2014).  Catch Me If You Can (2002).  Kill Bill: Vol. 2 (2004).  Etc.  No matter which aspect ratio is playing at the time, it reports as 1.78:1 for iso's.  Sort of the same for an mkv.  The Aeronauts (2019).  Reports as 1.85:1.  There is an aspect ratio change at 52:53 but it still reports as 1.85:1....
Could it be that Aspect Ratio Flagging is skin specific (I use Rapier)? Maybe not all skins display the full precission like 1,43:1, 1,85:1....?
No.  As I replied earlier, the skin I use shows all the various AR's for mkv's but not iso's.  I also checked using the default Estuary skin.
HOW TO - Kodi 2D - 3D - UHD (4k) HDR Guide Internal & External Players iso menus
DIY HOME THEATER WIND EFFECT

W11 Pro 24H2 MPC-BE\HC madVR KODI 22 GTX960-4GB/RGB 4:4:4/Desktop 60Hz 8bit Video Matched Refresh rates 23,24,50,60Hz 8/10/12bit/Samsung 82" Q90R Denon S720W
Reply
#53
(2021-04-09, 20:16)black_eagle Wrote: Still need to play the main title, but all audio streams and all subtitles can be saved (without having to enable them).

I ask again.  Are you putting an mkv in an iso... and calling it the same full fledged iso we're all dealing with here?  If so, it isn't.  If not, and you are testing with complete 1:1 rips, with complete folder structure and ALL the files in these folder structures (and not just one lone main movie file containing multi languages and subtitles), then your testing vs our testing are two completely different results for some unknown reason.  A full ripped iso contains many, many folders and dozens if not hundreds of files fwiw.

When I play an iso to flag the streams, if I don't enable a subtitle, no subtitle gets flagged at all.  Nothing.  If I do enable a sub, ONLY that sub gets flagged.  Same with audio languages.  Whichever one I use when I play is the only one that gets flagged and commonly, there are quite a few different languages and subs and AR's in an iso.  One thing is for sure, there is no way all the different subs, AR's, audio languages, audio types, etc. are flagging.  With an mkv, they do.  Even an mkv in an iso container because all the streams are contained in the one single main movie file.  Again, thank you for helping us.

*oh wait, I reread your post a couple more times*  Are you saying you have another new test build that addresses this but you haven't released it for us to test yet until you check it out more?
HOW TO - Kodi 2D - 3D - UHD (4k) HDR Guide Internal & External Players iso menus
DIY HOME THEATER WIND EFFECT

W11 Pro 24H2 MPC-BE\HC madVR KODI 22 GTX960-4GB/RGB 4:4:4/Desktop 60Hz 8bit Video Matched Refresh rates 23,24,50,60Hz 8/10/12bit/Samsung 82" Q90R Denon S720W
Reply
#54
@Cody Allen , @brazen1 , @Reelyator  There is a new test build here for you to test with. This version should save multiple audio streams and multiple subtitles where they are available.

On the subject of AR, I have a BR disc that contains fullscreen widescreen video, letterboxed video and some 4:3 (720x480) content. Kodi correctly shows the AR for the 16:9 stuff and the 4:3. However, it also shows 16:9 (1.78:1) for the letterboxed videos. This would appear at first glance to be wrong, but examination of the m2ts files reveals that they are actually 1920x1088 or 1920x1080. If I crop one of them to remove the letterboxing I get dimensions of 1920x818 which is 2.35:1. Handbrake, vlc and mediainfo all show the same dimensions as Kodi for these files. My conclusion therefore is that the letterboxing is encoded along with the video and therefore the AR is always going to be 1.78:1 for these.

~~Edit~~

To be clear, these tests are done with both BDMV directory structures and proper untouched ISO files.  Example of the contents of one of the ISO's when mounted.

Image
Learning Linux the hard way !!
Reply
#55
The exported nfo files contains all audio and subtitles, videos with correct codec and aspect 1.777778. Bitrate is missing. Tested with one BD and UHD. Looks imho good for me.
HTPC: Windows 10 Pro 22H2, Zalman HD135, Intel i3-7100, GTX 1070, UHD ASUS BW-16D1HT
NAS: Xpenology 7.2 Update 1, Intel i5-6600
Reply
#56
I don`t know if it belongs to this thead but is it possible to also read and write the <multiview_count> argument for 3D iso`s content?
HTPC: Windows 10 Pro 22H2, Zalman HD135, Intel i3-7100, GTX 1070, UHD ASUS BW-16D1HT
NAS: Xpenology 7.2 Update 1, Intel i5-6600
Reply
#57
Using the new test build, here is some feedback:

Upon playing a title, Kodi hung, crashed to the desktop, and crashed NVidia drivers.  I rebooted.  All was well and hasn't happened since.  I'm going to double check this problem by reverting an 'image' and see if it happens again.  I've rebooted a few times between these tests too.  No idea why that happened?  Never has before.
After playing just the menu portion of an iso, Kodi flags as PCM 2.0 blah blah.  It should.  After playing the main movie a bit, it flagged correctly except AR still shows 1.78:1.  The nfo stream detail is 1.777778.  I had no subs enabled but it flagged an English sub and an English Audio.  It also flagged a German Audio.  So I see two flags for audio - One English, one German.  I see one flag for an English sub.

However, this iso contains 10 different audio languages and few different English audio types.  It also contains 15 different language subs.  It appears Kodi core is limited to two flags per audio and subs although only one flag shows for subs.  It gets interesting because scanning my library I have another iso with multi audio and subs.  I haven't refreshed or played this one yet so it is flagged from a long time ago.  It shows 2 audios and 2 subs flagged so I know it was possible in the past.  

Nevertheless, this is great progress.  I didn't have to select anything before playing and at least got some flags to show that didn't in the last test build without selecting them prior to playback.  Fwiw, my nfo's never had file info stream details.  Now they have complete details including ALL the audio languages and types and ALL the subtitles available as well as other info.  

Fwiw, the obscure title I first reported not flagging completely now does.  Haven't tested enough for any side affects other than the initial crash (which I will reconfirm) but this looks promising and is better than the first test build.  THANK YOU for this.

I almost forgot.  When I switch to Estuary, there are no flags for audio language or subs at all.  Using Nox Silvo, there is.  I guess it's skin dependent and Estuary simply isn't capable.  Is this correct?
HOW TO - Kodi 2D - 3D - UHD (4k) HDR Guide Internal & External Players iso menus
DIY HOME THEATER WIND EFFECT

W11 Pro 24H2 MPC-BE\HC madVR KODI 22 GTX960-4GB/RGB 4:4:4/Desktop 60Hz 8bit Video Matched Refresh rates 23,24,50,60Hz 8/10/12bit/Samsung 82" Q90R Denon S720W
Reply
#58
(2021-04-12, 16:59)black_eagle Wrote: @Cody Allen , @brazen1 , @Reelyator  There is a new test build here for you to test with. This version should save multiple audio streams and multiple subtitles where they are available.

On the subject of AR, I have a BR disc that contains fullscreen widescreen video, letterboxed video and some 4:3 (720x480) content. Kodi correctly shows the AR for the 16:9 stuff and the 4:3. However, it also shows 16:9 (1.78:1) for the letterboxed videos. This would appear at first glance to be wrong, but examination of the m2ts files reveals that they are actually 1920x1088 or 1920x1080. If I crop one of them to remove the letterboxing I get dimensions of 1920x818 which is 2.35:1. Handbrake, vlc and mediainfo all show the same dimensions as Kodi for these files. My conclusion therefore is that the letterboxing is encoded along with the video and therefore the AR is always going to be 1.78:1 for these.

~~Edit~~

To be clear, these tests are done with both BDMV directory structures and proper untouched ISO files.  Example of the contents of one of the ISO's when mounted.

Image
Ok, I tested it a little bit, it's cool, the languages are set right, all of them (unfortunatly my skin is just showing first 4 of them), subtitles are all present and set correctly (unfortunatly my skin doesn't show all of them neither). The AR is always 1.78:1, even on movies with different ones stated on the BD cover. I tried with UHDBD and BD so far, both BDMV folders and .iso, it works, except for the AR, what is for me not too much of tragedy because the only information that I am really intersted in are languages and subtitles. Tomorrow I will try out BD3D and DVD and will let you know. Thank you for your work!
Reply
#59
OK, to try and clear up the AR confusion, the Blu-ray spec says that the AR will ALWAYS be 1.78.  So no matter what aspect ratio your movie was originally shot in, it will be hard letterboxed to make it 1.78 when it is mastered to blu-ray.  Specs can be checked here (page 18, Section 3.3.1).

For those that don't want to wade through a load of technical jargon, the relevant table is reproduced below.

Image

This is why people use things like handbrake, to crop the movie out of the letterboxing to get back to the original AR.
Learning Linux the hard way !!
Reply
#60
(2021-04-12, 19:29)brazen1 Wrote: I almost forgot.  When I switch to Estuary, there are no flags for audio language or subs at all.  Using Nox Silvo, there is.  I guess it's skin dependent and Estuary simply isn't capable.  Is this correct?

Yes.  Estuary doesn't show that information.
(2021-04-12, 19:29)brazen1 Wrote: It appears Kodi core is limited to two flags per audio and subs although only one flag shows for subs.

Shouldn't be.  I have an ISO here with 26 subs and they all show correctly after it was played.
(2021-04-12, 17:47)tehax Wrote: Bitrate is missing.

As far as I know, bitrate for videos has never been saved in the db.
(2021-04-12, 12:02)Reelyator Wrote: ....so what would be the next steps here? Assuming that the PR receives Approval from the other team members?

Would this fix be corrected with 19.1 or do we need to wait for 20...?

Ho, if it gets approval then it will go in the v20 nightly builds.  For v19.1 I'm honestly not sure.  Features cannot be added to the current stable branch (v19.x right now) but fixes can be.  This is kind of both so I'd need to ask the relevant people if/when it gets accepted.

Thanks to everyone so far for all the feedback and contributions to the thread, I do appreciate it.
Learning Linux the hard way !!
Reply

Logout Mark Read Team Forum Stats Members Help
Media Information from Iso Files0