Original Aspect Ratio
#16
(2024-12-04, 03:34)CrystalP Wrote: I wanted to see what this was about and tested.

Created .nfo with wrong AR values (did not match the video width and height), scanned a movie and episode .mkv paired with said .nfo into the library.
Went to the movie library, then tv shows library. The AR flag displayed in the library view matched the nfo value (ie wrong, not overriden by extraction from the file).
The AR didn't change after playing and stopping the videos. Restarting Kodi didn't change anything either. Checking in the database also still showed the value from nfo.

That was with a v22 brand new portable install, nothing changed from default settings except for the source to the videos. So maybe that request was implemented already.
Or there are specific settings that break what I saw. Or a different way to play the videos maybe.

.nfo file: a tag <aspect>999</aspect> inside the <movie> <streamdetails> <video> tags, in addition to the usual tags.
Displays as 2.76:1 AR in Estuary, but remains 999 in the database.
Thank you very much for investigating this!

I have a few questions if you don't mind...
  1. If the database is storing 999 for the aspect ratio, where is the 2.76:1 AR shown in Estuary coming from?
  2. Do you know if there is a way to retrieve the 999 aspect ratio via the API such that it could be used for screen masking / projector lens shift at time of playback?
  3. Did you select "The Movie Database Python" or "Local Information Only" as your library's Information Provider?
    1. If "Local Information Only", is it possible to use 3rd Party metadata and override only the aspect ratio via the .nfo?
Given the .nfo aspect ratio override is now working, do you agree that it may still be useful to store the file aspect ratio (Aspect Ratio) and content aspect ratio (Original Aspect Ratio) separately?  It seems to me that both pieces of information might be useful for different purposes.
Reply
#17
1. I'm not a skinner, my guess is that it's the value of the highest AR bucket for Esturary
2. don't know, the standard answer is "try json-rpc". Maybe it's mapped.
3. that was with tmdb python as scraper, but the nfo took precedence in the library scan.
3.1 it doesn't matter how the .nfo is generated (by hand, 3rd party tool, library export/import, ...). However a "partial" nfo is not possible.

The file aspect ratio is always calculated when starting playback, it doesn't have to be stored. Unless there is a use case (and a motivated dev), one field for the displayed value is enough.
Always read the Kodi online-manual, the FAQ and search the forum before posting.
Do not e-mail Kodi Team members directly asking for support. Read/follow the forum rules (wiki).
For troubleshooting and bug reporting please make sure you read this first.
Reply
#18
(2024-12-04, 07:21)CrystalP Wrote: ...

The file aspect ratio is always calculated when starting playback, it doesn't have to be stored. Unless there is a use case (and a motivated dev), one field for the displayed value is enough.

Perhaps it isn't a matter of storing both values but rather determining the file's aspect ratio from the video stream resolution and changing the aspect ratio stored in the database to Original Aspect Ratio.  It would be nice to be able to utilize OAR without having to forego scrapers and commit entirely to .nfo based metadata.  Ideally, it seems to me that OAR should exposed as an editable (if not also a scraper-fillable) metadata field in Kodi.  I'd imagine the file resolution is still important for things like auto resolution switching and perhaps determining media source type and could still be used as a fallback to calculate the aspect ratio on demand if an OAR isn't populated in the database.
Reply
#19
what you call oar is the ar field we have today. Anybody can code an addon to edit it, but I don't see that happening in core Kodi.
Edit is not available for the other fields of the nfo either. The library manager that generates nfo is the place to inject the oar. Or edit the files after they're generated.
If metadata sites were to provide the info then the scrapers could be modified, though the aspect ratio may be different in the original movie release and home releases or between different releases.
When the aspect tag is not provided, the ar is extracted from the file.
Always read the Kodi online-manual, the FAQ and search the forum before posting.
Do not e-mail Kodi Team members directly asking for support. Read/follow the forum rules (wiki).
For troubleshooting and bug reporting please make sure you read this first.
Reply
#20
I guess I'm not understanding the distinction between Aspect Ratio and other metadata fields like Tags, Tagline, Sort title, Original title, etc. that may not come from a scraper yet are editable via Kodi and do not require the use of nfo based metadata.  Is the idea that those other fields are not related to the specific file (which could change) but rather to the movie/show itself?

I suppose as things stand with the aspect ratio being stored in the db I could create a tool / addon for Kodi (like the plugin I created for Jellyfin) that would analyze video files with ffmpeg and would then update the AR stored in the Kodi database.  Unfortunately, from what I can tell [1][2][3] that data would be lost if/when a user refreshed video info.  As I understand it, the only way to persist that AR data through a video refresh would be to move entirely to .nfo files as the source for all metadata which seems like a pretty huge caveat.

It also still seems odd to me that the UI (at least Estuary) displays an AR based on the video resolution rather than the stored AR.  It is surprising that the UI would to be doing runtime AR calculations based on the returned video file resolution.

Would you be willing to confirm whether the JSON RPC Video.Streams endpoint contains the custom AR that you set via the nfo file?
Reply
#21
[2] indicates it deletes stream details when a user forces refresh, as in opening info dialog and clicking refresh, not when library is refreshed
look at the changes https://github.com/xbmc/xbmc/pull/16342/files

[3] only removes stream details when a movie/episode/music video is removed from the database
you can see this if you zoom out to the entire file and look for the calls for DeleteStreamDetails https://github.com/xbmc/xbmc/blob/master...tabase.cpp
Reply
#22
(2024-12-04, 23:41)izprtxqkft Wrote: [2] indicates it deletes stream details when a user forces refresh, as in opening info dialog and clicking refresh, not when library is refreshed
look at the changes https://github.com/xbmc/xbmc/pull/16342/files

[3] only removes stream details when a movie/episode/music video is removed from the database
you can see this if you zoom out to the entire file and look for the calls for DeleteStreamDetails https://github.com/xbmc/xbmc/blob/master...tabase.cpp

Just to clarify, if I were to figure out how to update the aspect ratio in the Kodi database for an existing video (either via addon or an external tool), the value that I set would be overwritten if the user performed the "info dialog -> refresh" operation you are referring to though, correct?
Reply
#23
(2024-12-04, 23:46)iolaus Wrote: Just to clarify, if I were to figure out how to update the aspect ratio in the Kodi database for an existing video (either via addon or an external tool), the value that I set would be overwritten if the user performed the "info dialog -> refresh" operation you are referring to though, correct?

based on the links you provided alone yes
my response was a clarification of those links, do keep in mind i am not a team kodi member nor am i versed in the spaghetti code that makes up kodi so it is possibly in more locations

easiest way is to just test it out, create an nfo for a fictional movie you dont own and pair it with an empty .mp4 file then scan it in and mess around with the functions

sqlitebrowser can be useful here
Reply
#24
The data can be persisted with Export Library, which will create/overwrite the .nfo. Then it will be reimported on movie refresh (though maybe not if you select to use internet sources in the refresh popup).

Of course nothing beats testing, I didn't do anything special earlier.

I haven't used a library manager in a long while (like ember or media companion) but since the aspect tag is not exactly new, there is a possibility that they already have a UI for that.
Always read the Kodi online-manual, the FAQ and search the forum before posting.
Do not e-mail Kodi Team members directly asking for support. Read/follow the forum rules (wiki).
For troubleshooting and bug reporting please make sure you read this first.
Reply

Logout Mark Read Team Forum Stats Members Help
Original Aspect Ratio0
This forum uses Lukasz Tkacz MyBB addons.