DVD-specific Magic


Automatically fixes chroma shifts, at the very least by approximation.

Functions written specifically for issues common or exclusive to DVDs.

DVDs, ancient as the specs and carriers are, come with their fair share of typical issues. Some of the more well-known problems are things like getting telecined before editing, chroma shifts that change from scene to scene and other grievances that stem from processing the things in several steps or by several subcontractors. They’re generally a pain in the ass and this module exists to alleviate some of that pain.

rvsfunc.dvd.chromashifter(clip, wthresh=31, vertical=False, maskfunc=eoe_convolution, mask_kwargs={}, shifter=core.resize.Bicubic)

Automatically fixes chroma shifts, at the very least by approximation.

This function takes in a clip and scales it to a 4x larger YUV444P clip. It then generates edgemasks over all of the planes to be used in distance calculations to figure out the proper value to shift chroma with. The shift is applied to the otherwise untouched input clip. Assumes the shift is the same for the U and V planes. Actually fast now thanks to EoE :eoehead:

  • clip (VideoNode) – vs.VideoNode: The clip to process. This may take a while.

  • wthresh (int) – int: The threshold for white values to use in the calculations for proper shifting. Valid values are 1 through 255.

  • vertical (bool) – bool: Whether or not to perform the shift vertically. This internally calls core.std.Transpose so that horizontal logic can be applied for speed.

  • maskfunc (Callable[[VideoNode], VideoNode]) – Callable A custom function or plugin to call for the edgemask. Default core.std.Prewitt.

  • mask_kwargs (Dict) – Dict A dictionary of kwargs to be expanded for mask_func. If defaults are used, this will be padded with Prewitt’s planes arg to ensure all planes get a mask generated over them.

  • shifter (Callable[[VideoNode, Any], VideoNode]) – Callable: The function to perform the chromashift with, defaults to core.resize.Point. This MUST take the clip as its first positional argument and a kwarg named src_left. Wrap your callable if it doesn’t meet these requirements to prevent errors.

Return type



vs.VideoNode: The input clip, but without chroma shift.