Skip to content

Commit

Permalink
Merge pull request #473 from guessit-io/feature/media-profile
Browse files Browse the repository at this point in the history
HDR / SDR and color space detection
  • Loading branch information
ratoaq2 committed Jul 16, 2017
2 parents 35788b6 + 684c7c5 commit c8d3fac
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 11 deletions.
6 changes: 5 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ History
- `other` property `ReEncoded` is now `Reencoded`
- `other` property `WideScreen` is now `Widescreen`
- Added `Ultra HD Blu-ray` as new `source` possible value.

- Added `Standard Dynamic Range` as new `other` possible value.
- Added `HDR10` as new `other` possible value.
- Added `Dolby Vision` as new `other` possible value.
- Added `BT.2020` as new `other` possible value.
- Added `12-bit` as new `color_depth` possible value.

2.1.4 (2017-06-01)
------------------
Expand Down
15 changes: 8 additions & 7 deletions docs/properties.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Video properties
- **color_depth**

Bit depth used for video.
- ``8-bit``, ``10-bit``
- ``8-bit``, ``10-bit``, ``12-bit``


- **video_api**
Expand Down Expand Up @@ -289,11 +289,12 @@ Other properties

Other property will appear under this property.

- ``3D``, ``Audio Fixed``, ``Bonus``, ``Classic``, ``Colorized``, ``Complete``, ``Converted``, ``Documentary``,
``Dual Audio``, ``East Coast Feed``, ``Fan Subtitled``, ``Fast Subtitled``, ``Full HD``, ``Hardcoded Subtitles``,
``HD``, ``High Quality``, ``High Resolution``, ``Internal``, ``Line Dubbed``, ``Line Audio``, ``Mic Dubbed``,
``Micro HD``, ``Mux``, ``NTSC``, ``Open Matte``, ``Original Aspect Ratio``, ``Original Video``, ``PAL``, ``Preair``,
``Proper``, ``PS Vita``, ``Read NFO``, ``Region 5``, ``Region C``, ``Reencoded``, ``Remux``, ``Retail``, ``Rip``,
``Screener``, ``SECAM``, ``Straight to Video``, ``Sync Fixed``, ``Trailer``, ``Ultra HD``, ``West Coast Feed``,
- ``3D``, ``Audio Fixed``, ``Bonus``, ``BT.2020``, ``Classic``, ``Colorized``, ``Complete``, ``Converted``,
``Documentary``, ``Dolby Vision``, ``Dual Audio``, ``East Coast Feed``, ``Fan Subtitled``, ``Fast Subtitled``,
``Full HD``, ``Hardcoded Subtitles``, ``HD``, ``HDR10``, ``High Quality``, ``High Resolution``, ``Internal``,
``Line Dubbed``, ``Line Audio``, ``Mic Dubbed``, ``Micro HD``, ``Mux``, ``NTSC``, ``Open Matte``,
``Original Aspect Ratio``, ``Original Video``, ``PAL``, ``Preair``, ``Proper``, ``PS Vita``, ``Read NFO``,
``Region 5``, ``Region C``, ``Reencoded``, ``Remux``, ``Retail``, ``Rip``, ``Screener``, ``SECAM``,
``Standard Dynamic Range``, ``Straight to Video``, ``Sync Fixed``, ``Trailer``, ``Ultra HD``, ``West Coast Feed``,
``Widescreen``, ``XXX``

5 changes: 5 additions & 0 deletions guessit/rules/properties/other.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ def validate_complete(match):
tags=['other.validate.mux', 'video-codec-prefix', 'source-suffix'])
rebulk.string('HC', 'vost', value='Hardcoded Subtitles')

rebulk.string('SDR', value='Standard Dynamic Range', tags='uhdbluray-neighbor')
rebulk.regex('HDR(?:10)?', value='HDR10', tags='uhdbluray-neighbor')
rebulk.regex('Dolby-?Vision', value='Dolby Vision', tags='uhdbluray-neighbor')
rebulk.regex('BT-?2020', value='BT.2020', tags='uhdbluray-neighbor')

rebulk.rules(RenameAnotherToOther, ValidateHasNeighbor, ValidateHasNeighborAfter, ValidateHasNeighborBefore,
ValidateScreenerRule, ValidateMuxRule, ValidateHardcodedSubs, ValidateStreamingServiceNeighbor,
ProperCountRule)
Expand Down
1 change: 1 addition & 0 deletions guessit/rules/properties/video_codec.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def video_codec():
rebulk.string('DXVA', value='DXVA', name='video_api')

rebulk.defaults(name='color_depth', validator=seps_surround)
rebulk.regex('12.?bits?', value='12-bit')
rebulk.regex('10.?bits?', 'YUV420P10', 'Hi10P?', value='10-bit')
rebulk.regex('8.?bits?', value='8-bit')

Expand Down
2 changes: 1 addition & 1 deletion guessit/test/episodes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4046,7 +4046,7 @@
season: 1
screen_size: 2160p
source: Ultra HD Blu-ray
# other: High Dynamic Range
other: HDR10
audio_codec: DTS-HD
audio_profile: Master Audio
audio_channels: '5.1'
Expand Down
68 changes: 67 additions & 1 deletion guessit/test/movies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1191,6 +1191,7 @@
source: Ultra HD Blu-ray
video_codec: H.265
color_depth: 10-bit
other: Standard Dynamic Range
audio_codec: DTS-HD
audio_channels: '7.1'
release_group: Zeus
Expand All @@ -1203,6 +1204,7 @@
screen_size: 2160p
source: Ultra HD Blu-ray
video_codec: H.265
other: HDR10
audio_codec: Dolby Atmos
audio_channels: '7.1'
release_group: DDR
Expand All @@ -1212,4 +1214,68 @@
: title: Life of Pi
year: 2012
screen_size: 2160p
source: Ultra HD Blu-ray
source: Ultra HD Blu-ray
other: [HDR10, BT.2020]
subtitle_language: und
release_group: DDR

? Captain.America.Civil.War.HDR.1080p.HEVC.10bit.BT.2020.DTS-HD.MA.7.1-VISIONPLUSHDR
: title: Captain America Civil War
other: [HDR10, BT.2020]
screen_size: 1080p
video_codec: H.265
color_depth: 10-bit
audio_codec: DTS-HD
audio_profile: Master Audio
audio_channels: '7.1'
release_group: VISIONPLUSHDR
type: movie

? Deadpool.2016.4K.2160p.UHD.HQ.8bit.BluRay.8CH.x265.HEVC-MZABI.mkv
: title: Deadpool
year: 2016
screen_size: 2160p
source: Ultra HD Blu-ray
other: High Quality
color_depth: 8-bit
audio_channels: '7.1'
video_codec: H.265
release_group: MZABI
type: movie

? Fantastic.Beasts.and.Where.to.Find.Them.2016.2160p.4K.UHD.10bit.HDR.BluRay.7.1.x265.HEVC-MZABI.mkv
: title: Fantastic Beasts and Where to Find Them
year: 2016
screen_size: 2160p
source: Ultra HD Blu-ray
color_depth: 10-bit
other: HDR10
audio_channels: '7.1'
video_codec: H.265
release_group: MZABI
container: mkv
type: movie

? The.Arrival.4K.HDR.HEVC.10bit.BT2020.DTS.HD-MA-MadVR.HDR10.Dolby.Vision-VISIONPLUSHDR1000
: title: The Arrival
screen_size: 2160p
other: [HDR10, BT.2020, Dolby Vision]
video_codec: H.265
color_depth: 10-bit
audio_codec: DTS-HD
audio_profile: Master Audio
release_group: VISIONPLUSHDR1000
type: movie

? How To Steal A Dog.2014.BluRay.1080p.12bit.HEVC.OPUS 5.1-Hn1Dr2.mkv
: title: How To Steal A Dog
year: 2014
source: Blu-ray
screen_size: 1080p
color_depth: 12-bit
video_codec: H.265
# audio_codec: Opus
audio_channels: '5.1'
release_group: Hn1Dr2
container: mkv
type: movie
16 changes: 15 additions & 1 deletion guessit/test/rules/other.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,18 @@
: other: Converted

? +HDRIP # it's a Rip from non specified HD source
: other: [HD, Rip]
: other: [HD, Rip]

? SDR
: other: Standard Dynamic Range

? HDR
? HDR10
? -HDR100
: other: HDR10

? BT2020
? BT.2020
? -BT.20200
? -BT.2021
: other: BT.2020
2 changes: 2 additions & 0 deletions guessit/test/rules/source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@
? Bluray UHD
? 4K Bluray
? 2160p Bluray
? UHD 10bit HDR Bluray
? UHD HDR10 Bluray
? -HD Bluray
? -AMERICAN ULTRA (2015) 1080p Bluray
? -American.Ultra.2015.BRRip
Expand Down

0 comments on commit c8d3fac

Please sign in to comment.