Skip to content

Instantly share code, notes, and snippets.

@rlaphoenix
Created October 27, 2025 05:40
Show Gist options
  • Save rlaphoenix/a51a996485b08d42fa05baab96e1304b to your computer and use it in GitHub Desktop.
Save rlaphoenix/a51a996485b08d42fa05baab96e1304b to your computer and use it in GitHub Desktop.
Bewitched S01E01 PoC of BD with DVD color -- Not realistic because theres an enormous amount of framing and scan distortion differences between the BD and DVD
# Example: https://slow.pics/c/VdkBeiWx
import vapoursynth as vs
core = vs.core
dvd = core.lsmas.LWLibavSource(r"Bewitched.S01.Color.NTSC.DVD.DD2.0.MPEG-2.REMUX-MiU\Bewitched.S01E01.Color.NTSC.DVD.DD2.0.MPEG-2.REMUX-MiU.mkv", repeat=False, fpsnum=24000, fpsden=1001)
#core.lsmas.LWLibavSource(source, stream_index, cache, cachefile, threads, seek_mode, seek_threshold, dr, fpsnum, fpsden, variable, format, decoder, prefer_hw, repeat, dominance, ff_loglevel, cachedir, ff_options)
bd = core.lsmas.LWLibavSource(r"Season 1\Bewitched.S01E01.1080p.BluRay.Remux.FLAC2.0.H.264-BTN.mkv")
dvd = dvd[47+17:]
bd = core.std.Crop(bd, left=240, right=240)
dvd = core.resize.Spline16(dvd, width=bd.width, height=bd.height)
clip = core.std.StackHorizontal([dvd, bd])
# match bd to dvd framing
left_adj = 13
right_adj = -5
top_adj = 40
bot_adj = -15
bd_framed = core.resize.Spline16(
bd, bd.width, bd.height,
src_left=left_adj, src_top=top_adj,
src_width=bd.width-left_adj-right_adj, src_height=bd.height-top_adj-bot_adj
)
# merge bd and dvd, taking luma from bd and chroma from dvd
merged = core.std.ShufflePlanes([bd_framed, dvd, dvd], planes=[0, 1, 2], colorfamily=vs.YUV)
clip = merged
clip = core.resize.Spline16(
bd, bd.width, bd.height,
src_left=left_adj, src_top=top_adj,
src_width=bd.width-left_adj-right_adj, src_height=bd.height-top_adj-bot_adj
)
clip.set_output()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment