View Full Version : Animaniacs NTSC DVDs - Chroma is blended/luma is not
Stereodude
15th February 2025, 21:24
I'm in the process of ripping all my physical media starting with the DVDs of movies and TV shows, and I've generally been converting the DVD to H264 to get rid of deinterlacing, pulldowns, etc. as well as some noise reduction / cleanup. I got to the Animaniacs DVDs and found the chroma is messed up. It looks like the chroma is blended across frames/fields while the luma is not.
MPEG2Source("VTS_01_1.d2v", info=0)
tfm(pp=1, mode=1, display=false)
After TFM I get artifacts like this:
https://i.imgur.com/QzrsL4h.png
I tried to IVTC the chroma separately from the Luma and put them back together which gets rid of the interlaced chroma in the output, but it's still not what I want.
source=MPEG2Source("VTS_01_1.d2v", info=0)
U=source.PlaneToY(plane = "U" ).tfm(pp=1, mode=1, display=false)
V=source.PlaneToY(plane = "V" ).tfm(pp=1, mode=1, display=false)
Y=source.PlaneToY(plane = "Y" ).tfm(pp=1, mode=1, display=false)
CombinePlanes(Y, U, V, planes="YUV", source_planes="YYY", sample_clip=source)
https://i.imgur.com/yS9rlTF.png
Here's a source sample: link removed
Is there any way to fix/improve this, or am I basically stuck?
wonkey_monkey
15th February 2025, 21:37
This looks very similar to the problem with the original release of the Doctor Who 2008-2010 Specials: https://horman.net/doctorwho/specials.php
The interlacing pattern seems to be simple and steady, at least from the sample you've supplied. I'll come up with something that should fix it.
poisondeathray
15th February 2025, 22:01
This script from feisty2 looks mostly ok (plus decimation)
http://forum.doom9.org/showthread.php?p=1692414#post1692414
Also consider filtering the dotcrawl, rainbow
Stereodude
15th February 2025, 22:12
This looks very similar to the problem with the original release of the Doctor Who 2008-2010 Specials: https://horman.net/doctorwho/specials.php
The interlacing pattern seems to be simple and steady, at least from the sample you've supplied. I'll come up with something that should fix it.
Thanks, I'll try why you come up with.
This script from feisty2 looks mostly ok (plus decimation)
http://forum.doom9.org/showthread.php?p=1692414#post1692414
Thanks, I will give it a try.
Also consider filtering the dotcrawl, rainbow
What filter or script do you recommend?
real.finder
15th February 2025, 22:20
similar to https://forum.doom9.org/showthread.php?t=173822 I think, but I still interest in wonkey_monkey upcoming fix
poisondeathray
15th February 2025, 22:22
Also consider filtering the dotcrawl, rainbow
What filter or script do you recommend?
I didn't get a chance to play with it, but it's something you have to test out on each specific source
I'd also try out machine learning models such as dotzilla
https://openmodeldb.info/models/1x-Dotzilla-Compact
wonkey_monkey
15th February 2025, 22:30
This script from feisty2 looks mostly ok (plus decimation)
http://forum.doom9.org/showthread.php?p=1692414#post1692414
That seems like overkil to me.
This fixes the sample almost perfectly (one scene changes falls on what should be an interlaced frame, but isn't). Whether it'll work on the full episode, or other episodes, is another matter, of course:
function ChromaFix(clip in) {
a = in
b = in.trim(1,0)
c = in.trim(2,0)
d = in.trim(3,0)
corrected = Expr(a,b,c,d, "y z + x a + 0.5 * -")
Interleave(in, corrected)
return SelectEvery(10, 0,2,3,8)
}
LWLibAVVideoSource("sample.m2v") # Don't use FFmpegSource2, not frame accurate
y = ExtractY().SeparateFields().selectevery(10, 0,1, 2,3, 5,6, 8,9).Weave()
#Edit: minor tweak above resolves that one interlaced frame and just leaves one frame of blended chroma
u = ExtractU().ChromaFix()
v = ExtractV().ChromaFix()
CombinePlanes(y, u, v, "YUV", "YYY", "yuv420")
Stereodude
15th February 2025, 23:27
I didn't get a chance to play with it, but it's something you have to test out on each specific source
I'd also try out machine learning models such as dotzilla
https://openmodeldb.info/models/1x-Dotzilla-Compact
I meant in general what plugins you recommend for those tasks.
On the second part, how do I apply a machine learning model on a video in AVIsynth+?
Edit: I figured it out how to run Dotzilla on it.
Stereodude
15th February 2025, 23:31
That seems like overkil to me.
This fixes the sample almost perfectly (one scene changes falls on what should be an interlaced frame, but isn't). Whether it'll work on the full episode, or other episodes, is another matter, of course:
function ChromaFix(clip in) {
a = in
b = in.trim(1,0)
c = in.trim(2,0)
d = in.trim(3,0)
corrected = Expr(a,b,c,d, "y z + x a + 0.5 * -")
Interleave(in, corrected)
return SelectEvery(10, 0,2,3,8)
}
LWLibAVVideoSource("sample.m2v") # Don't use FFmpegSource2, not frame accurate
y = ExtractY().SeparateFields().selectevery(10, 0,1, 2,3, 5,6, 7,8).Weave()
u = ExtractU().ChromaFix()
v = ExtractV().ChromaFix()
CombinePlanes(y, u, v, "YUV", "YYY", "yuv420")
Thanks! I will give this a shot later.
poisondeathray
16th February 2025, 01:49
I meant in general what plugins you recommend for those tasks.
I use the typical general plugins and scripts, and adjust them to the source
http://avisynth.nl/index.php/Category:Rainbow_%26_Dot_Crawl_Removal
On the second part, how do I apply a machine learning model on a video in AVIsynth+?
Edit: I figured it out how to run Dotzilla on it.
Yes avs-mlrt in avsisynth
https://github.com/Asd-g/avs-mlrt
There are various models converted to onnx in this thread, or you can use chainner to convert them
http://forum.doom9.org/showthread.php?t=184768
Stereodude
16th February 2025, 20:58
I use the typical general plugins and scripts, and adjust them to the source
http://avisynth.nl/index.php/Category:Rainbow_%26_Dot_Crawl_Removal
Thanks. I tried a few of them. Some of them broke Feisty2's script or had other visual anomalies.
Yes avs-mlrt in avsisynth
https://github.com/Asd-g/avs-mlrt
There are various models converted to onnx in this thread, or you can use chainner to convert them
http://forum.doom9.org/showthread.php?t=184768
I decided to use Dotzilla, but it's very processing intensive. Using a GTX1080 + R9-5950X the best I could get was ~9.5fps encoding on a 720x480 image. The GPU is the bottleneck. I swapped in a RTX3070Ti in place of the GTX1080 and now I can get ~16fps.
Stereodude
16th February 2025, 21:08
That seems like overkil to me.
This fixes the sample almost perfectly (one scene changes falls on what should be an interlaced frame, but isn't). Whether it'll work on the full episode, or other episodes, is another matter, of course:
function ChromaFix(clip in) {
a = in
b = in.trim(1,0)
c = in.trim(2,0)
d = in.trim(3,0)
corrected = Expr(a,b,c,d, "y z + x a + 0.5 * -")
Interleave(in, corrected)
return SelectEvery(10, 0,2,3,8)
}
LWLibAVVideoSource("sample.m2v") # Don't use FFmpegSource2, not frame accurate
y = ExtractY().SeparateFields().selectevery(10, 0,1, 2,3, 5,6, 8,9).Weave()
#Edit: minor tweak above resolves that one interlaced frame and just leaves one frame of blended chroma
u = ExtractU().ChromaFix()
v = ExtractV().ChromaFix()
CombinePlanes(y, u, v, "YUV", "YYY", "yuv420")
I appreciate your efforts. I tried this on a full episode and it didn't work right. The sample I provided was not the very start of the video so the pattern in your script aligns with the sample I posted, but not with the full episode. I'm trying to automate the conversion and not have to adjust a script manually per episode, Feisty2's script lets me do that with minimal errors.
I have a powershell script that I can drop a bunch of .mkv files on (created from the DVDs using MakeMKV using lossless packing of the original DVD streams. It will demux the .m2v, run it through DGIndex creating the .d2v, extract the chapters from the .mkv, generate a chapter file for x264 from the chapters, run .x264 with my encoding settings, mux the new H.264 video track into a new .mkv in place of the original MPEG-2 stream, and repeat the process for each additional .mkv without any involvement from me. I just have to make a single avs file per series or maybe season if they DVDs are not consistent.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.