From 834e2feff24a7b9344c5bc92c1bda8016aa37fec Mon Sep 17 00:00:00 2001 From: Rato Date: Sun, 11 Jun 2017 16:00:21 +0200 Subject: [PATCH] Move 8bit/10bit from 'video_profile' to 'color_depth' --- docs/migration2to3.rst | 3 +++ guessit/rules/properties/video_codec.py | 14 ++++++++------ guessit/test/episodes.yml | 24 ++++++++++++------------ guessit/test/movies.yml | 6 +++--- guessit/test/rules/video_codec.yml | 2 +- 5 files changed, 27 insertions(+), 22 deletions(-) diff --git a/docs/migration2to3.rst b/docs/migration2to3.rst index 726e32f..d372356 100644 --- a/docs/migration2to3.rst +++ b/docs/migration2to3.rst @@ -62,6 +62,9 @@ The following values were changed: - ``MP`` is now ``Main``. - ``Hi422P`` is now ``High 4:2:2``. - ``Hi444PP`` is now ``High 4:4:4 Predictive``. +- ``High 10`` was added. +- ``8bit`` was removed. ``8bit`` is detected as ``color_depth: 8-bit`` +- ``10bit`` was removed. ``10bit`` is detected as ``color_depth: 10-bit`` ``audio_codec`` ^^^^^^^^^^^^^^^ diff --git a/guessit/rules/properties/video_codec.py b/guessit/rules/properties/video_codec.py index e712673..02315d0 100644 --- a/guessit/rules/properties/video_codec.py +++ b/guessit/rules/properties/video_codec.py @@ -26,25 +26,27 @@ def video_codec(): rebulk.regex('XviD', value='Xvid') rebulk.regex('[hx]-?264(?:-?AVC(?:HD)?)?', 'MPEG-?4(?:-?AVC(?:HD)?)', 'AVC(?:HD)?', value='H.264') rebulk.regex('[hx]-?265(?:-?HEVC)?', 'HEVC', value='H.265') - rebulk.regex('(?Phevc)(?P10)', value={'video_codec': 'H.265', 'video_profile': '10bit'}, + rebulk.regex('(?Phevc)(?P10)', value={'video_codec': 'H.265', 'color_depth': '10-bit'}, tags=['video-codec-suffix'], children=True) # http://blog.mediacoderhq.com/h264-profiles-and-levels/ # http://fr.wikipedia.org/wiki/H.264 rebulk.defaults(name="video_profile", validator=seps_surround) - rebulk.regex('10.?bits?', 'Hi10P?', 'YUV420P10', value='10bit') - rebulk.regex('8.?bits?', value='8bit') - rebulk.string('BP', value='Baseline', tags='video_profile.rule') rebulk.string('XP', 'EP', value='Extended', tags='video_profile.rule') rebulk.string('MP', value='Main', tags='video_profile.rule') rebulk.string('HP', 'HiP', value='High', tags='video_profile.rule') - rebulk.regex('Hi422P', value='High 4:2:2', tags='video_profile.rule') - rebulk.regex('Hi444PP', value='High 4:4:4 Predictive', tags='video_profile.rule') + rebulk.regex('Hi422P', value='High 4:2:2') + rebulk.regex('Hi444PP', value='High 4:4:4 Predictive') + rebulk.regex('Hi10P?', value='High 10') # no profile validation is required rebulk.string('DXVA', value='DXVA', name='video_api') + rebulk.defaults(name='color_depth', validator=seps_surround) + rebulk.regex('10.?bits?', 'YUV420P10', 'Hi10P?', value='10-bit') + rebulk.regex('8.?bits?', value='8-bit') + rebulk.rules(ValidateVideoCodec, VideoProfileRule) return rebulk diff --git a/guessit/test/episodes.yml b/guessit/test/episodes.yml index 9d84e11..7c7bf63 100644 --- a/guessit/test/episodes.yml +++ b/guessit/test/episodes.yml @@ -693,7 +693,7 @@ release_group: Daisei screen_size: 720p title: Free!:Iwatobi Swim Club - video_profile: 10bit + color_depth: 10-bit ? '[Tsundere] Boku wa Tomodachi ga Sukunai - 03 [BDRip h264 1920x1080 10bit FLAC][AF0C22CC].mkv' : audio_codec: FLAC @@ -704,7 +704,7 @@ screen_size: 1080p title: Boku wa Tomodachi ga Sukunai video_codec: H.264 - video_profile: 10bit + color_depth: 10-bit ? '[t.3.3.d]_Mikakunin_de_Shinkoukei_-_12_[720p][5DDC1352].mkv' : crc32: 5DDC1352 @@ -768,7 +768,7 @@ release_group: NoobSubs screen_size: 720p title: Sword Art Online II - video_profile: 8bit + color_depth: 8-bit ? '[DeadFish] 01 - Tari Tari [BD][720p][AAC].mp4' : audio_codec: AAC @@ -784,7 +784,7 @@ release_group: NoobSubs screen_size: 720p title: Sword Art Online II - video_profile: 8bit + color_depth: 8-bit ? '[DeadFish] 12 - Tari Tari [BD][720p][AAC].mp4' : audio_codec: AAC @@ -1465,7 +1465,7 @@ screen_size: 720p title: One Piece subtitle_language: fr - video_profile: 8bit + color_depth: 8-bit version: 1 ? '[ISLAND]One_Piece_679_[VOSTFR]_[8bit]_[720p]_[EB7838FC].mp4' @@ -1476,7 +1476,7 @@ screen_size: 720p title: One Piece subtitle_language: fr - video_profile: 8bit + color_depth: 8-bit ? '[Kaerizaki-Fansub]_One_Piece_679_[VOSTFR][HD_1280x720].mp4' : options: -E @@ -1647,7 +1647,7 @@ release_group: Hatsuyuki-Kaitou screen_size: 720p title: Fairy Tail 2 - video_profile: 10bit + color_depth: 10-bit ? '[Hatsuyuki-Kaitou]_Fairy_Tail_2_-_16-20_(191-195)_[720p][10bit].torrent' : options: -E @@ -2198,7 +2198,7 @@ episode: 3 subtitle_language: fr other: HD - video_profile: 8bit + color_depth: 8-bit type: episode ? '[.www.site.com.].-.Snooze.and.Go.Sleep.S03E02.1080p.HEVC.x265-MeGusta' @@ -3608,7 +3608,7 @@ : title: Show Name episode: 6 screen_size: 720p - video_profile: 10bit + color_depth: 10-bit crc32: 1F5578AC release_group: SuperGroup type: episode @@ -3618,7 +3618,7 @@ : title: Show Name episode: 6 screen_size: 1080p - video_profile: 10bit + color_depth: 10-bit crc32: 1F5578AC release_group: SuperGroup type: episode @@ -3629,7 +3629,7 @@ title: Dimension W episode: 5 screen_size: 720p - video_profile: 10bit + color_depth: 10-bit other: Dual Audio source: TV language: und @@ -3701,7 +3701,7 @@ other: Rip screen_size: 1080p video_codec: H.265 - video_profile: 10bit + color_depth: 10-bit audio_codec: AAC container: mkv type: episode diff --git a/guessit/test/movies.yml b/guessit/test/movies.yml index d86006a..055098c 100644 --- a/guessit/test/movies.yml +++ b/guessit/test/movies.yml @@ -572,7 +572,7 @@ : title: REDLINE source: Blu-ray video_codec: H.264 - video_profile: 10bit + color_depth: 10-bit audio_codec: FLAC screen_size: 1080p @@ -905,7 +905,7 @@ other: Ultra HD source: Blu-ray video_codec: H.265 - video_profile: 10bit + color_depth: 10-bit audio_codec: [DTS-HD, Dolby Atmos] audio_channels: '7.1' release_group: DDR @@ -937,7 +937,7 @@ screen_size: 2160p source: Blu-ray video_codec: H.265 - video_profile: 10bit + color_depth: 10-bit audio_codec: Dolby Atmos audio_channels: '7.1' release_group: DDR diff --git a/guessit/test/rules/video_codec.yml b/guessit/test/rules/video_codec.yml index 8d5c6e0..1b81e08 100644 --- a/guessit/test/rules/video_codec.yml +++ b/guessit/test/rules/video_codec.yml @@ -52,7 +52,7 @@ ? hevc10 ? HEVC-YUV420P10 : video_codec: H.265 - video_profile: 10bit + color_depth: 10-bit ? h265-HP : video_codec: H.265