Taxel / PlexTraktSync

A python script that syncs the movies, shows and ratings between trakt and Plex (without needing a PlexPass or Trakt VIP subscription)
MIT License
1.61k stars 105 forks source link

1080p video incorrectly identified as 720p #650

Closed agneevX closed 2 years ago

agneevX commented 2 years ago

The problem

PTS has scrobbled a media item as 720p, when it should be 1080p.

Here's a part of the relevant Plex XML:

<Stream id="750472" streamType="1" default="1" codec="h264" index="0" bitrate="8542" language="English" languageTag="en" languageCode="eng" bitDepth="8" chromaLocation="left" chromaSubsampling="4:2:0" codedHeight="1088" codedWidth="1792" frameRate="23.976" hasScalingMatrix="0" height="1080" level="41" profile="high" refFrames="4" scanType="progressive" width="1792" displayTitle="1080p (H.264)" extendedDisplayTitle="1080p (H.264)"> </Stream>

Error trace

No response

Expected behavior

Identified as 1080p

Steps to reproduce the behavior

No response

Inspect of problematic items

Inspecting 95874: <tmdb:399019:<Movie:95874:The-Beguiled>>
URL: https://app.plex.tv/desktop/#!/server/a66d15c58163562fa2534867d9b0c2a9915d46cc/details?key=/library/metadata/95874
Media.Type: movie
Media.Guid: 'plex://movie/5d776c4396b655001fe2b601'
Media.Guids: [<Guid:imdb://tt5592248>, <Guid:tmdb://399019>, <Guid:tvdb://1675>]
Audio: '5.1(side)', 'English (DTS 5.1)'
Video: 'h264'
Guids:
  Guid: tmdb://399019, Id: 399019, Provider: tmdb
  Guid: tvdb://1675, Id: 1675, Provider: tvdb
  Guid: imdb://tt5592248, Id: tt5592248, Provider: imdb
Metadata: {'collected_at': '2021-12-16:T16:04:38.000Z', 'media_type': 'digital', 'resolution': 'hd_720p', 'audio': 'dts', 'audio_channels': '5.1'}
Trakt: https://trakt.tv/movies/242199
Watched on Plex: False
Watched on Trakt: False

Workarounds

Unsure.

Install method

docker-compose

Version

0.17.0

Python Version

3.10.0

Operating System and Version

Ubuntu 20.04

agneevX commented 2 years ago

Some more examples...

Audio: 'mono', 'English (FLAC Mono)'
Video: 'h264'
Guids:
  Guid: tmdb://289, Id: 289, Provider: tmdb
  Guid: tvdb://1762, Id: 1762, Provider: tvdb
  Guid: imdb://tt0034583, Id: tt0034583, Provider: imdb
Metadata: {'collected_at': '2021-11-27:T08:47:55.000Z', 'media_type': 'digital', 'resolution': 'hd_720p', 'audio_channels': '1.0'}
Trakt: https://trakt.tv/movies/243

<Stream id="749337" streamType="1" default="1" codec="h264" index="0" bitrate="12190" bitDepth="8" chromaLocation="left" chromaSubsampling="4:2:0" codedHeight="1088" codedWidth="1488" frameRate="23.976" hasScalingMatrix="0" height="1080" level="41" profile="high" refFrames="5" scanType="progressive" width="1488" displayTitle="1080p (H.264)" extendedDisplayTitle="1080p (H.264)"> </Stream>

Here also, the audio should be Flac 1.0, not just 1.0.

<Stream id="749338" streamType="2" selected="1" default="1" codec="flac" index="1" channels="1" bitrate="229" language="English" languageTag="en" languageCode="eng" audioChannelLayout="mono" bitDepth="24" samplingRate="48000" displayTitle="English (FLAC Mono)" extendedDisplayTitle="English (FLAC Mono)"> </Stream>


Audio: '5.1(side)', 'English (EAC3 5.1)'
Video: 'h264'
Guids:
  Guid: tmdb://716612, Id: 716612, Provider: tmdb
  Guid: tvdb://148838, Id: 148838, Provider: tvdb
  Guid: imdb://tt12536294, Id: tt12536294, Provider: imdb
Metadata: {'collected_at': '2021-11-23:T07:40:25.000Z', 'media_type': 'digital', 'resolution': 'hd_720p', 'audio': 'dolby_digital_plus', 'audio_channels': '5.1'}
Trakt: https://trakt.tv/movies/559480

<Stream id="663017" streamType="1" default="1" codec="h264" index="0" bitrate="9898" anamorphic="0" bitDepth="8" chromaLocation="left" chromaSubsampling="4:2:0" codedHeight="1088" codedWidth="1792" colorPrimaries="bt709" colorRange="tv" colorSpace="bt709" colorTrc="bt709" frameRate="23.976" hasScalingMatrix="0" height="1080" level="40" pixelAspectRatio="225:224" profile="high" refFrames="4" scanType="progressive" width="1792" displayTitle="1080p (H.264)" extendedDisplayTitle="1080p (H.264)"> </Stream>


Audio: '5.1(side)', 'English (AC3 5.1)'
Video: 'h264'
Guids:
  Guid: tmdb://818192, Id: 818192, Provider: tmdb
  Guid: tvdb://139575, Id: 139575, Provider: tvdb
  Guid: imdb://tt11388416, Id: tt11388416, Provider: imdb
Metadata: {'collected_at': '2021-10-16:T11:12:11.000Z', 'media_type': 'digital', 'resolution': 'hd_720p', 'audio': 'dolby_digital', 'audio_channels': '5.1'}
Trakt: https://trakt.tv/movies/651459

<Stream id="639050" streamType="1" default="1" codec="h264" index="0" bitrate="10088" language="English" languageTag="en" languageCode="eng" bitDepth="8" chromaLocation="topleft" chromaSubsampling="4:2:0" codedHeight="800" codedWidth="1920" colorPrimaries="bt709" colorRange="tv" colorSpace="bt709" colorTrc="bt709" frameRate="23.976" hasScalingMatrix="0" height="800" level="40" profile="high" refFrames="5" scanType="progressive" width="1918" displayTitle="1080p (H.264)" extendedDisplayTitle="1080p (H.264)"> </Stream>

glensc commented 2 years ago

The logic to detect it is here:

glensc commented 2 years ago

Can you try:

agneevX commented 2 years ago

Ok, building image now.

agneevX commented 2 years ago

Still seems to scrobble 720p. Could it be the cache DB?

glensc commented 2 years ago

Still seems to scrobble 720p. Could it be the cache DB?

Run inspect without the cache then.

agneevX commented 2 years ago

Is there a command to skip the cache?

glensc commented 2 years ago

Is there a command to skip the cache?

No. It's not that difficult to rename cache file for single run. or use different cache.path in config.json

agneevX commented 2 years ago

Well, it takes a few hours to recreate the cache for a single library.

EDIT: Oh you mean, for a single inspect command?

agneevX commented 2 years ago

This works just fine.

This is for the initial example.

Audio: '5.1(side)', 'English (DTS 5.1)'
Video: 'h264'
Guids:
  Guid: tmdb://399019, Id: 399019, Provider: tmdb
  Guid: tvdb://1675, Id: 1675, Provider: tvdb
  Guid: imdb://tt5592248, Id: tt5592248, Provider: imdb
Metadata: {'collected_at': '2021-12-16:T16:04:38.000Z', 'media_type': 'digital', 'resolution': 'hd_1080p', 'audio': 'dts', 'audio_channels': '5.1'}
Trakt: https://trakt.tv/movies/242199