Skip to content

Commit

Permalink
Merge pull request #475 from guessit-io/feature/additional-audio-dete…
Browse files Browse the repository at this point in the history
…ction

Enhance audio detection
  • Loading branch information
ratoaq2 committed Jul 16, 2017
2 parents 08bdc0e + 102708e commit b73d30e
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 3 deletions.
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ History
- Added `Upscaled` as new `other` possible value.
- Added `Ultimate` as new `edition` possible value.
- Added `Fan` as new `edition` possible value.
- Added `High Resolution Audio` as new `audio_profile` possible value.
- Added `Extended Surround` as new `audio_profile` possible value.
- Added `EX` as new `audio_profile` possible value
- Added `Opus` as new `audio_codec` possible value

2.1.4 (2017-06-01)
------------------
Expand Down
6 changes: 4 additions & 2 deletions docs/properties.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,16 @@ Audio properties

Codec used for audio.

- ``AAC``, ``Dolby Atmos``, ``Dolby Digital``, ``Dolby Digital Plus``, ``Dolby TrueHD``, ``DTS``, ``FLAC``, ``MP3``
- ``AAC``, ``Dolby Atmos``, ``Dolby Digital``, ``Dolby Digital Plus``, ``Dolby TrueHD``, ``DTS``, ``FLAC``, ``MP3``,
``Opus``


- **audio_profile**

The codec profile used for audio.

- ``High Efficiency``, ``High Quality``, ``Low Complexity``, ``Master Audio``
- ``Extended Surround``, ``EX``, ``High Efficiency``, ``High Quality``, ``High Resolution Audio``, ``Low Complexity``,
``Master Audio``


Localization properties
Expand Down
4 changes: 4 additions & 0 deletions guessit/rules/properties/audio_codec.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,16 @@ def audio_codec_priority(match1, match2):
rebulk.string("DTS", value="DTS")
rebulk.regex('DTS-?HD', value='DTS-HD')
rebulk.regex('True-?HD', value='Dolby TrueHD')
rebulk.string('Opus', value='Opus')

rebulk.defaults(name='audio_profile')
rebulk.string('MA', value='Master Audio', tags='DTS-HD')
rebulk.string('HR', 'HRA', value='High Resolution Audio', tags='DTS-HD')
rebulk.string('ES', value='Extended Surround', tags='DTS')
rebulk.string('HE', value='High Efficiency', tags='AAC')
rebulk.string('LC', value='Low Complexity', tags='AAC')
rebulk.string('HQ', value='High Quality', tags='Dolby Digital')
rebulk.string('EX', value='EX', tags='Dolby Digital')

rebulk.defaults(name="audio_channels")
rebulk.regex(r'(7[\W_][01](?:ch)?)(?:[^\d]|$)', value='7.1', children=True)
Expand Down
81 changes: 80 additions & 1 deletion guessit/test/movies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@
screen_size: 1080p
color_depth: 12-bit
video_codec: H.265
# audio_codec: Opus
audio_codec: Opus
audio_channels: '5.1'
release_group: Hn1Dr2
container: mkv
Expand Down Expand Up @@ -1346,4 +1346,83 @@
? Stargate SG1 Ultimate Fan Collection
: title: Stargate SG1
edition: [Ultimate, Fan]

? The.Jungle.Book.2016.MULTi.1080p.BluRay.x264.DTS-HD.MA.7.1.DTS-HD.HRA.5.1-LeRalou
: title: The Jungle Book
year: 2016
language: mul
screen_size: 1080p
source: Blu-ray
video_codec: H.264
audio_codec: DTS-HD
audio_profile: [Master Audio, High Resolution Audio]
audio_channels: ['7.1', '5.1']
release_group: LeRalou
type: movie

? Terminus.2015.BluRay.1080p.x264.DTS-HD.HRA.5.1-LTT
: title: Terminus
year: 2015
source: Blu-ray
screen_size: 1080p
video_codec: H.264
audio_codec: DTS-HD
audio_profile: High Resolution Audio
audio_channels: '5.1'
release_group: LTT
type: movie

? Ghost.in.the.Shell.1995.1080p.Bluray.DTSES.x264-SHiTSoNy
: title: Ghost in the Shell
year: 1995
screen_size: 1080p
source: Blu-ray
audio_codec: DTS
audio_profile: Extended Surround

? The.Boss.Baby.2017.BluRay.1080p.DTS-ES.x264-PRoDJi
: title: The Boss Baby
year: 2017
source: Blu-ray
screen_size: 1080p
audio_codec: DTS
audio_profile: Extended Surround
video_codec: H.264
release_group: PRoDJi
type: movie

? Title.2000.720p.BluRay.DDEX.x264-HDClub.mkv
: title: Title
year: 2000
screen_size: 720p
source: Blu-ray
audio_codec: Dolby Digital
audio_profile: EX
video_codec: H.264
release_group: HDClub
container: mkv
type: movie

? Jack Reacher Never Go Back 2016 720p Bluray DD-EX x264-BluPanther
: title: Jack Reacher Never Go Back
year: 2016
screen_size: 720p
source: Blu-ray
audio_codec: Dolby Digital
audio_profile: EX
video_codec: H.264
release_group: BluPanther
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
24 changes: 24 additions & 0 deletions guessit/test/rules/audio_codec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,27 @@

? -51
: audio_channels: '5.1'

? DTS-HD.HRA
? DTSHD.HRA
? DTS-HD.HR
? DTSHD.HR
? -HRA
? -HR
: audio_codec: DTS-HD
audio_profile: High Resolution Audio

? DTSES
? DTS-ES
? -ES
: audio_codec: DTS
audio_profile: Extended Surround

? DD-EX
? DDEX
? -EX
: audio_codec: Dolby Digital
audio_profile: EX

? OPUS
: audio_codec: Opus

0 comments on commit b73d30e

Please sign in to comment.