Log in

View Full Version : interlaced animation: keep it interlaced?


brett
6th May 2004, 02:34
What I'm currently in the process of doing is putting the 2nd season of Family Guy (21 episodes, about 22:30 each) on a single DVD-R. My source is the 3 DVD set, so the video is good quality and I've got the original 192k AC3 audio. This gives me room for about 185 MB of video for each episode. That's an average bitrate of 1050kbps.

So, I've tried encoding a few different ways. I've done 352x240, and it comes out pretty well, but obviously 352x480 would be better.

Looking around, there are tons of threads about encoding anime, but almost every one is talking about deinterlacing. Seeing as I'm making MPEG-2 to be put on a DVD-R, it should be better to leave it interlaced.

I tried using a QMF script that I use for most live action video, but it lost way too much sharpness.

I'm using pretty much standard settings, CCE 2.66, Bach matrix. The D2S script I'm using right now is:


0=Import(!qmf15b1mod.avs)
1=BlindPP(iPP=true).Crop(8,30,-8,-34)
2=f=SelectEven(SeparateFields()).HorizontalReduceBy2().PostFilter()
3=ff=SelectOdd(SeparateFields()).HorizontalReduceBy2().PostFilter()
4=Interleave(f,ff).Weave().AddBorders(0,32,0,32)
!qmf15b1mod.avs=C:\DVD\DVD2SVCD\qmf15b1mod.avs

function PostFilter(clip c) { c = UnDot(c) c = Temporalsoften(c,2,3,3,mode=2,scenechange=6) return c }


All I'm really doing is BlindPP,UnDot,Temporalsoften. I'm adding 32px black bars on the top and bottom to make it compress a little better. Still, I'm having to use a Q of 70-75 to get the 1050kbps I need. My output is nice and sharp, but the Q is just too high. The noise/artifacts/whatever around peoples lips is annoying, and fast scenes are pretty bad.

http://home.woh.rr.com/brettland/pics/familyguy-ep213-07.17.jpg

http://home.woh.rr.com/brettland/pics/familyguy-ep217-10.11.jpg

Does anybody have any good ideas? Obviously the big tradeoff is losing sharpness if you want to lose the artifacts, but since so many people do anime around here I thought someone would have a brilliant idea.

I could deinterlace it and encode at 24 FPS, which should compress better, but that would probably introduce ghosting.

Full-frame interlaced animation needs so much more bitrate than what I'm used to encoding. Is this the best I can do with 1050kbps MPEG-2?

DDogg
6th May 2004, 03:29
Let's first find out what kind of bitrate hog this source is.

Do a OPV Q40 1% sample and derive the bitrate.

But, do me a favor and pull all the fancy stuff and just use a mpeg2source line followed by undot().Deen(). Yeah, I know you are not supposed to do interlaced like that, but for the heck of it let's break some rules.

Do a OPV Q40 1% sample with and without the filters, derive the bitrate from the sample size, and post the results. Should not take you more than 15 minutes. See the cce dumbness thread in my sig, if you do not know how to do the sample and derive the bitrate. There is a spreadsheet there to use for doing it. See the footnotes.

You can also do the same two tests above, but just add a 1/2D1 resize like:
Undot().Deen() # with and without
BilinearResize(352,480)
ConvertToYUY2(interlaced=true)
AudioDub(BlankClip())

Oh, you are using CCE, right?

brett
6th May 2004, 10:25
OK, here are some test runs.

Family Guy Season 2 episode 1
22:35:08 (1355 sec)
interlaced NTSC

CCE SP 2.66
MPEG-2 (ES, One-pass VBR)
Min 300, Max 8,000
M=3, N/M=5
Luminance level 16-235
Frame rate 29.97

I didn't bother saving the ECL to edit the bias.



Original script

mpeg2source("E:\EP201\DVD2AV~1.D2V")
BlindPP(iPP=true).Crop(8,30,-8,-34)
f=SelectEven(SeparateFields()).HorizontalReduceBy2().UnDot().Temporalsoften(2,3,3,mode=2,scenechange=6)
ff=SelectOdd(SeparateFields()).HorizontalReduceBy2().UnDot().Temporalsoften(2,3,3,mode=2,scenechange=6)
Interleave(f,ff).Weave().AddBorders(0,32,0,32)
ConvertToYUY2(interlaced=true)
AudioDub(BlankClip())

Q40 = 280,397 KB video = 1655 kbps
Q75 = 183,443 KB video = 1083 kbps



DDogg (no filtering)

LoadPlugin("C:\DVD\DVD2SVCD\AVISYN~1.5PL\Mpeg2dec\MPEG2D~1.DLL")
mpeg2source("E:\EP201\DVD2AV~1.D2V")
BilinearResize(352,480)
ConvertToYUY2(interlaced=true)
AudioDub(BlankClip())

Q40 = 304,406 KB video = 1797 kbps



DDogg Deen

LoadPlugin("C:\DVD\DVD2SVCD\AVISYN~1.5PL\Mpeg2dec\MPEG2D~1.DLL")
mpeg2source("E:\EP201\DVD2AV~1.D2V")
UnDot().Deen()
BilinearResize(352,480)
ConvertToYUY2(interlaced=true)
AudioDub(BlankClip())

Q40 = 300,940 KB video = 1777 kbps



Deen

LoadPlugin("C:\DVD\DVD2SVCD\AVISYN~1.5PL\Mpeg2dec\MPEG2D~1.DLL")
mpeg2source("E:\EP201\DVD2AV~1.D2V")
BlindPP(iPP=true).Crop(8,30,-8,-34)
f=SelectEven(SeparateFields()).UnDot().Deen().HorizontalReduceBy2()
ff=SelectOdd(SeparateFields()).UnDot().Deen().HorizontalReduceBy2()
Interleave(f,ff).Weave().AddBorders(0,32,0,32)
ConvertToYUY2()
AudioDub(BlankClip())

Q40 = 274,365 KB video = 1620 kbps



Deen + Postfilter

LoadPlugin("C:\DVD\DVD2SVCD\AVISYN~1.5PL\Mpeg2dec\MPEG2D~1.DLL")
mpeg2source("E:\EP201\DVD2AV~1.D2V")
BlindPP(iPP=true).Crop(8,30,-8,-34)
f=SelectEven(SeparateFields()).UnDot().Deen().HorizontalReduceBy2().UnDot().Temporalsoften(2,3,3,mode=2,scenechange=6)
ff=SelectOdd(SeparateFields()).UnDot().Deen().HorizontalReduceBy2().UnDot().Temporalsoften(2,3,3,mode=2,scenechange=6)
Interleave(f,ff).Weave().AddBorders(0,32,0,32)
ConvertToYUY2()
AudioDub(BlankClip())

Q40 = 270,997 KB video = 1600 kbps
Q60 = 202,966 KB video = 1198 kbps
Q65 = 194,787 KB video = 1150 kbps
Q70 = 187,545 KB video = 1107 kbps



I did compare the same frame with/without Deen(), and there's not much of a difference. Not worth re-encoding.

Q75, Original script, no Deen (1083 kbps)
http://home.woh.rr.com/brettland/pics/familyguy-ep213-fr13116-light.bmp

Q70, Deen + Postfilter (1107 kbps)
http://home.woh.rr.com/brettland/pics/familyguy-ep213-fr13116-deen.bmp

brett
6th May 2004, 13:46
Applying the Deen after resizing seems to make things significantly more blurry without really making it compress any better.

Post-Deen, 3X UnDot

LoadPlugin("C:\DVD\DVD2SVCD\AVISYN~1.5PL\Mpeg2dec\MPEG2D~1.DLL")
mpeg2source("E:\EP201\DVD2AV~1.D2V")
BlindPP(iPP=true).Crop(8,30,-8,-34)
f=SelectEven(SeparateFields()).UnDot().HorizontalReduceBy2().UnDot().Deen().UnDot().Temporalsoften(2,3,3,mode=2,scenechange=6)
ff=SelectOdd(SeparateFields()).UnDot().HorizontalReduceBy2().UnDot().Deen().UnDot().Temporalsoften(2,3,3,mode=2,scenechange=6)
Interleave(f,ff).Weave().AddBorders(0,32,0,32)
ConvertToYUY2()
AudioDub(BlankClip())

Q40 = 249,008 KB video = 1470 kbps
Q60 = 202,882 KB video = 1198 kbps
Q70 = 187,464 KB video = 1106 kbps

What would be nice would be a Dup filter that worked well. Every one I've tried, though, either doesn't do anything or it screws up the characters talking depending on where you set the threshold.

DDogg
6th May 2004, 16:02
Well you have a real bitrate hog and to mix my barn animal metaphors, you may have milked the compression cow for all it is worth. Have you tried HybridFuPP? It does deliver a bit more compression that a straight KISS, but of course it is very slow. Using a preset of low may be worth trying. Anim is not an area I have any expertise in. Maybe the Anim gurus in the avisynth forum can offer suggestions, but since you said that was pure NTSC interlaced, I'm not even sure you can convert it to 24 fps.

I did play around (http://forum.doom9.org/showthread.php?s=&threadid=60393&perpage=30&highlight=ddogg%20svcd&pagenumber=3) once with doing this for some DV footage I had to cram down one time.

If you do mess around with either, it would be most appreciated if you would post the D-Abrs like you did for the other. That is good data to have as a reference for others.

brett
6th May 2004, 23:10
I'm currently trying to run it through mfToon, but that filter is SLOW. I'm using the simplest script I could come up with:

0=#SetMemoryMax(128)
1=Import(!mfToon.avs)
2=LoadPlugin(!WarpSharp)
3=Crop(8,30,-8,-34).SeparateFields().HorizontalReduceBy2()
4=Interleave(SelectEven().mfToon(),SelectOdd().mfToon()).Weave().AddBorders(0,32,0,32)

and it's still only running 0.15X realtime, which is almost 3 hours per episode.

DDogg
6th May 2004, 23:13
Maybe you ought to try sampling. Doing the whole encode is too time consuming. You should be able to sample it in like 5 minutes or so and get a pretty good prediction unless the script you are using is motion adaptive.

brett
7th May 2004, 04:38
mfToon

Q40 = 280,906 KB video = 1658 kbps



Looks like that really didn't improve compressability at all.

FuPP
8th May 2004, 19:14
New HybridFuPP 0.881b has an 'anime' preset. Though it is very new, you may want to give it a try. All feedback will be appreciated !

Regards,
FuPP

brett
14th May 2004, 04:00
I just ended up doing everything at Q75 with minimal filtering, seeing as no matter how much I filtered it, it never really improved compressability very much. I fit all 22 episodes from Season 3 on one disc, and it came out very sharp and the artifacts are tolerable. I really don't think I can expect anymore when fitting a little over 8 hours of full-frame interlaced animation on a DVD.

It's amazing how much more space it takes to encode stuff as interlaced.

I just encoded Raiders of the Lost Ark in CCE 2.66 at Q40 with light filtering (720x480). The first encode I accidentally did interlaced.

Video = 2,186,075,416 bytes 30 FPS interlaced
Video = 1,624,319,008 bytes 24 FPS progressive

Interlaced is 35% larger.