Medusa: Thoughts about new Quality implementation

Created on 14 Oct 2016  路  20Comments  路  Source: pymedusa/Medusa

Scene formats:
_TV:_

Show.Name.S04E13.iNTERNAL.720p.BluRay.x264-GROUP
Show.Name.S\d{2,}E\d{2,}.Extra*.File Resultion.Source Format.Encoder-GROUP

Required properties: File Resolution, Source Format, Encoder
Optional properties: Extra

P2P formats:
_TV:_

Show.Name.S02E04.Episode Name.UNRATED.720p.BluRay.DTS.x264-GROUP
Show.Name.S\d{2,}E\d{2,}.Episode Name.Extra*.File/Source Resultion.Source Format.Audio.Codec/Encoder-GROUP

Required properties: File/Source Resolution, Source Format, Audio, Codec/Encoder
Optional properties: Episode Name, Extra

_Proposed properties:_
Required: File/Source Resolution, Source Format, Audio, Codec/Encoder
Optional: Extra

@pymedusa/contributors @pymedusa/developers

Discussion Enhancement Help wanted

Most helpful comment

Here is the list that I gathered (not all values) from guessit, knowit and Medusa, probably the properties and values for a new quality design should take them into consideration:

- resolution:
  - 240i
  - 240p
  - 288i
  - 288p
  - 360i
  - 360p
  - 480i
  - 480p
  - 576i
  - 576p
  - 720p
  - 900p
  - 1080i
  - 1080p
  - 2160p
  - 4320p

- source:
  - AHDTV
  - BDRip
  - BluRay
  - BRRip
  - Cam
  - DVD
  - DVDRip
  - HDTV
  - HD-DVD
  - PDTV (DVB)
  - PPV
  - SATRip (DSRip)
  - Telecine
  - Telesync
  - TV (TVRip)
  - VHS
  - VOD
  - WEB-DL (WEB)
  - WEBRip (WEBCap)
  - Workprint

- video_codec:
  - DivX
  - h263
  - h264
  - h265 (HEVC)
  - Mpeg1
  - Mpeg2
  - Mpeg4
  - MsMpeg4v2
  - MsMpeg4v3
  - QuickTime
  - Real
  - VC1
  - VP6
  - VP7
  - VP9
  - Wmv1
  - Wmv2
  - Wmv3
  - XviD

- video_encoder:
  - x264
  - x265

- audio_codec:
  - AAC
  - AC3
  - DolbyAtmos
  - DTS
  - DTS-HD
  - EAC3
  - FLAC
  - MP2
  - MP3
  - Opus
  - PCM
  - TrueHD
  - Vorbis
  - WMAv1
  - WMAv2
  - WMAPro

- audio_channels:
  - 1.0
  - 2.0
  - 5.1
  - 7.1

Can you all take a look at this initial list and make comments. I can edit it as we go

And below a proposal for the quality profiles. The way it works is quite simple: it continues to snatch until it reaches the last item of the list:

# Existing presets:
SDTV:
  - resolution: {360i, 360p, 480i, 480p, 576i, 576p}
  - source: {AHDTV, PDTV, PPV, SATRip, TV, VOD, WEB, WEBRip}

SDDVD:
  - resolution: {480p, 576p}
  - source: {DVDRip, BDRip, BRRip}

HDTV:
  - resolution: {720p}
  - source: {AHDTV, HDTV}

RAWHD:
  - resolution: {720p, 1080i, 1080p}
  - source: {HDTV}
  - video_codec: {Mpeg2, h264}

FULLHDTV:
  - resolution: {1080p}
  - source: {HDTV}

HDWEBDL:
  - resolution: {720p}
  - source: {WEB, WEBRip}

FULLHDWEBDL:
  - resolution: {1080p}
  - source: {WEB, WEBRip}

HDBLURAY:
  - resolution: {720p}
  - source: {BluRay}

FULLHDBLURAY:
  - resolution: {1080p}
  - source: {BluRay}

UHD_4K_TV:
  - resolution: {2160p}
  - source: {HDTV}

UHD_4K_WEBDL:
  - resolution: {2160p}
  - source: {WEB, WEBRip}

UHD_4K_BLURAY:
  - resolution: {2160p}
  - source: {BluRay}

UHD_8K_TV:
  - resolution: {4320p}
  - source: {HDTV}

UHD_8K_WEBDL:
  - resolution: {4320p}
  - source: {WEB, WEBRip}

UHD_8K_BLURAY:
  - resolution: {4320p}
  - source: {BluRay}

UNKNOWN: {}
    # Anything that doesn't fit all others

# Other possibilities
Prefer HD Profile:
  # accept SD resolutions
  - resolution: {480p}
  # but stop at HD resolutions
  - resolution: {720p, 1080p, 1080i}

Only HD Profile:
  # only snatches HD
  - resolution: {720p, 1080p, 1080i}

Prefer 1080p x265 Profile:
  # accept x264 HD
  - resolution: {720p, 1080i, 1080p}
    video_encoder: {h264}
  # and stop when x265 1080p
  - resolution: {1080p}
    video_encoder: {h265}

Keep searching, Johnnie searcher Profile:
  # accept 720p x264
  - resolution: {720p}
    video_encoder: {h264}
  # but if possible, replace it with WEB-DL
  - resolution: {720p}
    source: {WEB-DL}
  # but if possible, replace it with 1080p
  - resolution: {1080p}
    source: {WEB-DL}
  # but if possible, replace it with 1080p x265
  - resolution: {1080p}
    source: {WEB-DL}
    video_encoder: {h265}
  # but if possible, replace it with bluray 1080p x265
  - resolution: {1080p}
    source: {BluRay}
    video_encoder: {h265}
  # but if possible, replace it with bluray 2160p or 4320p x265
  - resolution: {2160p, 4320p}
    source: {BluRay}
    video_encoder: {h265}

My Profile:
  # accept anything
  - {}
  # give preference to 720p
  - resolution: {720p}
  # stop searching when I have 1080p BluRay
  - resolution: {1080p}
    source: {BluRay}

All 20 comments

File size ranges as a propriety. So i could make like "1080p + BluRay + DivX + 100Mib-100000Gib" _*Note: not a realistic example, for gigles lol_

From Slack:

It'd be nice to have a basic and advanced selector, the basic would ask you a few questions and the give you a list of custom profiles setup for you. For example, "What resolution do you want? 480p, 720p, 1080p, 4k+", "Do you care about file size, if so select a wanted range. 100mb - 500mb, 501mb - 750mb, 751mb - 1.1gb", "Do you care where the files are sourced from? WEB-DL, recorded from cable", etc. then from there it'll show people their profiles it has made and they can fine tune them.

For me I like 1080p+ that's a WEB-DL around 1GB - 2.5GB other than that I honestly don't care. I don't even care that much if it's h264/h265 or how many channels of audio.

It'd also be great be to be able to select something like "I want a WEB-DL but if it's been 2+ hours after release and there still isn't one just get me the best 720p or 1080p copy there is and then replace it once the WEB-DL is out."

Here is the list that I gathered (not all values) from guessit, knowit and Medusa, probably the properties and values for a new quality design should take them into consideration:

- resolution:
  - 240i
  - 240p
  - 288i
  - 288p
  - 360i
  - 360p
  - 480i
  - 480p
  - 576i
  - 576p
  - 720p
  - 900p
  - 1080i
  - 1080p
  - 2160p
  - 4320p

- source:
  - AHDTV
  - BDRip
  - BluRay
  - BRRip
  - Cam
  - DVD
  - DVDRip
  - HDTV
  - HD-DVD
  - PDTV (DVB)
  - PPV
  - SATRip (DSRip)
  - Telecine
  - Telesync
  - TV (TVRip)
  - VHS
  - VOD
  - WEB-DL (WEB)
  - WEBRip (WEBCap)
  - Workprint

- video_codec:
  - DivX
  - h263
  - h264
  - h265 (HEVC)
  - Mpeg1
  - Mpeg2
  - Mpeg4
  - MsMpeg4v2
  - MsMpeg4v3
  - QuickTime
  - Real
  - VC1
  - VP6
  - VP7
  - VP9
  - Wmv1
  - Wmv2
  - Wmv3
  - XviD

- video_encoder:
  - x264
  - x265

- audio_codec:
  - AAC
  - AC3
  - DolbyAtmos
  - DTS
  - DTS-HD
  - EAC3
  - FLAC
  - MP2
  - MP3
  - Opus
  - PCM
  - TrueHD
  - Vorbis
  - WMAv1
  - WMAv2
  - WMAPro

- audio_channels:
  - 1.0
  - 2.0
  - 5.1
  - 7.1

Can you all take a look at this initial list and make comments. I can edit it as we go

And below a proposal for the quality profiles. The way it works is quite simple: it continues to snatch until it reaches the last item of the list:

# Existing presets:
SDTV:
  - resolution: {360i, 360p, 480i, 480p, 576i, 576p}
  - source: {AHDTV, PDTV, PPV, SATRip, TV, VOD, WEB, WEBRip}

SDDVD:
  - resolution: {480p, 576p}
  - source: {DVDRip, BDRip, BRRip}

HDTV:
  - resolution: {720p}
  - source: {AHDTV, HDTV}

RAWHD:
  - resolution: {720p, 1080i, 1080p}
  - source: {HDTV}
  - video_codec: {Mpeg2, h264}

FULLHDTV:
  - resolution: {1080p}
  - source: {HDTV}

HDWEBDL:
  - resolution: {720p}
  - source: {WEB, WEBRip}

FULLHDWEBDL:
  - resolution: {1080p}
  - source: {WEB, WEBRip}

HDBLURAY:
  - resolution: {720p}
  - source: {BluRay}

FULLHDBLURAY:
  - resolution: {1080p}
  - source: {BluRay}

UHD_4K_TV:
  - resolution: {2160p}
  - source: {HDTV}

UHD_4K_WEBDL:
  - resolution: {2160p}
  - source: {WEB, WEBRip}

UHD_4K_BLURAY:
  - resolution: {2160p}
  - source: {BluRay}

UHD_8K_TV:
  - resolution: {4320p}
  - source: {HDTV}

UHD_8K_WEBDL:
  - resolution: {4320p}
  - source: {WEB, WEBRip}

UHD_8K_BLURAY:
  - resolution: {4320p}
  - source: {BluRay}

UNKNOWN: {}
    # Anything that doesn't fit all others

# Other possibilities
Prefer HD Profile:
  # accept SD resolutions
  - resolution: {480p}
  # but stop at HD resolutions
  - resolution: {720p, 1080p, 1080i}

Only HD Profile:
  # only snatches HD
  - resolution: {720p, 1080p, 1080i}

Prefer 1080p x265 Profile:
  # accept x264 HD
  - resolution: {720p, 1080i, 1080p}
    video_encoder: {h264}
  # and stop when x265 1080p
  - resolution: {1080p}
    video_encoder: {h265}

Keep searching, Johnnie searcher Profile:
  # accept 720p x264
  - resolution: {720p}
    video_encoder: {h264}
  # but if possible, replace it with WEB-DL
  - resolution: {720p}
    source: {WEB-DL}
  # but if possible, replace it with 1080p
  - resolution: {1080p}
    source: {WEB-DL}
  # but if possible, replace it with 1080p x265
  - resolution: {1080p}
    source: {WEB-DL}
    video_encoder: {h265}
  # but if possible, replace it with bluray 1080p x265
  - resolution: {1080p}
    source: {BluRay}
    video_encoder: {h265}
  # but if possible, replace it with bluray 2160p or 4320p x265
  - resolution: {2160p, 4320p}
    source: {BluRay}
    video_encoder: {h265}

My Profile:
  # accept anything
  - {}
  # give preference to 720p
  - resolution: {720p}
  # stop searching when I have 1080p BluRay
  - resolution: {1080p}
    source: {BluRay}

Would probably probably be more advantageous to have the video encoder rather than the codec

can you put a list of the video encoders?

I think we should also allow users to set the allowed range for resolutions in an advanced page.
For example 1270x720 as 720 but not 1255x720.

Should we add the interlace versions of the resolutions? Can any tools we use right now detect that?

Afaik the only encoders used or tagged as such are x264 and x265. The rest we can happily forget about.

@medariox what about people that don't want DivX for example but they're getting an old show that was mainly released with that codec?

@OmgImAlexis
See rato's list from above.

- video_codec:
  - Real
  - Mpeg2
  - DivX
  - XviD
  - h264
  - h265 (HEVC)

DivX is there (it's a codec, not an encoder).

Ah, read your comment wrong.

Hi,
can we take the opportunity to also change the way qualities are downloaded?
now we can only choose 2 groups : allowed and prefered

for example, I'd like to have 720p HDTV replaced by 1080p HDTV and then by 1080p webdl and then 1080p bluray.

I think it was done like this befor, nearly 2 years ago.

Yeah it'll be nice to have the qualities weighted so we have to I'd like this one, then this and then this but if any of them are found just grab the highest in the list first and then replace.

I think right now it's too complicated and doesn't really make much sense even for myself who's been using it for years and years.

Hi, is there a Prefer 1080p x265 Profile avaiable in Medusa?
I currently use Sickrage and I can get x265 releases with the required word option. But I'd like it to automatically fall back to x264 once it does not find x265 releases and later try again for x265.

@trohnjavolta
You can use Preferred Words to achieve that.

@medariox ok, thx. in sickrage I just see ignored and required words.

@medariox Ok, I put x265, hevc in preferred words but what's the purpose of this? Medusa dl's a x264 file anyways and it doesn't show up in backlog.
I'd like it to be searched again until a x265 release is found.

@trohnjavolta please move this to another issue.

All the information that we have (before downloading and investigating closer) only states something about the source, the codec and/or the resolution.

I can get a 1080p that is compressed harder than a 720p so I also need to look at the file-size in order to infer something about quality.

CouchPotato has an excellent file-size filter, but one that can be improved upon:
CP makes it possible to specify a MIN and MAX file-size requirement for each (what they refer to as) QUALITY.
CP defined their QUALITY list to be a mixture of resolution and source, and this works well before downloading and for the intended purpose (their current list is 2160p, BR-Disk, 1080p, 720p, BR-Rip, DVD-R, DVD-Rip, Screener, R5, TeleCine, TeleSync, Cam).

The problem with the current CP implementation is that it does not work with different codecs, e.g. h264 vs h265, so in reality we need such a table for each codec (or just a default, common table and the option to add new tables in order to override for specific codecs, e.g. h265 vs everything else).

Such a filter would be an immense enhancement to Medusa.

CouchPotato builds on the file-size filter by allowing us to configure Quality Profiles.
In short, a Quality Profile does what @ratoaq2 asked for above.

You configure a Quality Profile by providing a name, e.g. "BestQ".
Then you add any number of qualities (here, as CP defines them, look at my previous post above), e.g. 1080p, 710p, BR-Rip, DBD-Rip.
For each quality you specify if it is a final quality, and this allows CP to know when it should stop looking for better qualities.

As with the CP file-size filter, this feature was not designed with codecs in mind, so it would require some thought in order to get to something that works better for Medusa

Was this page helpful?
0 / 5 - 0 ratings

Related issues

elpedriyo picture elpedriyo  路  4Comments

fernandog picture fernandog  路  4Comments

Rouzax picture Rouzax  路  4Comments

Rouzax picture Rouzax  路  3Comments

lamplis picture lamplis  路  3Comments