Aliasing, artifacts and moire?

Comments

DGates wrote on 4/10/2011, 5:59 PM
I think the government should intervene and just outlaw DVD players. Make it mandatory for everyone to replace their stupid low-rez units with Blu-ray players. Then we wouldn't have to worry about all this crap.
PeterDuke wrote on 4/10/2011, 7:26 PM
Don't stop there. Outlaw interlacing and make 50p/60p compulsory.
Rory Cooper wrote on 4/11/2011, 3:04 AM
Peter …Interlace is the name of an old war horse, went proudly into battle and served it master well. But now just looks sad like an old nag full of flies with artifacts drooling from teethless gums, it is forced into continued service by old knights who hang onto old sabers’ who reminiscence around the camp fire, noisily clanging shields and swords, quite harmless really.
farss wrote on 4/11/2011, 5:19 AM
John,
Yes I hear you. Without question there are other areas where the basics need more attention.

" do you think that the deinterlace settings (None - Blend - Interpolate) are NOT in need of improvement?"

They're fine but very limited, what is needed is some form of "intelligent" de-interlacing. I use Mike's Smart De-interlacer, others use different means outside of Vegas. Whatever floats your boat but there should be something better in the box than what we have now.

Bob.

ushere wrote on 4/11/2011, 6:31 AM
frankly i prefer panning whilst shooting 50i than i do 25p. and as much as i've played with 25p, i still prefer 50i for general, everyday shoots.
Jerry K wrote on 4/11/2011, 1:37 PM
I just emailed a friend that edits with CS-5 with AVCHD footage and asked him about down converting with CS-5 to sd for a DVD and here's what he wrote back.

By default, Premiere hates 60i, so it automatically converts it to
30P... that may help it look better anyway.

Can anyone comment on this?

Jerry K
amendegw wrote on 4/11/2011, 2:13 PM
30p DVD?

...Jerry

System Model:     Alienware M18 R1
System:           Windows 11 Pro
Processor:        13th Gen Intel(R) Core(TM) i9-13980HX, 2200 Mhz, 24 Core(s), 32 Logical Processor(s)

Installed Memory: 64.0 GB
Display Adapter:  NVIDIA GeForce RTX 4090 Laptop GPU (16GB), Nvidia Studio Driver 566.14 Nov 2024
Overclock Off

Display:          1920x1200 240 hertz
Storage (8TB Total):
    OS Drive:       NVMe KIOXIA 4096GB
        Data Drive:     NVMe Samsung SSD 990 PRO 4TB
        Data Drive:     Glyph Blackbox Pro 14TB

Vegas Pro 22 Build 239

Cameras:
Canon R5 Mark II
Canon R3
Sony A9

farss wrote on 4/11/2011, 3:14 PM
I don't know about CS5 and 60i but I do know about CS3 and 50i.
Ppro handles it much the same as Vegas.
For preview it does do things differently. Vegas only uses the GPU for preview on the secondary display whereas Ppro uses it for internal preview and that is always de-interlaced and colour calibrated. As a result your footage does look quite different in Ppro compared to Vegas.

Bob.

johnmeyer wrote on 4/11/2011, 6:15 PM
I just spent about four hours trying to improve on how Vegas produces 29.97 interlaced widescreen SD (720x480) DV AVI (I could have used MPEG-2) using 1440x1080 interlaced HDV footage from my Sony FX1 camcorder.

My conclusion?

Vegas does a better job than any other alternative I was able to devise. I don't have access to Sorensen or any other expensive options, so I cannot state how they might have done. All my work was with AVISynth, using various plugins and built-in functions available for that shareware tool.

What I found is that if I looked at the results, one field at a time, the Sony results did in fact result in staircasing on some diagonal fast-moving "objects." However, that staircasing was along the pixel lines, and therefore would not be noticed during actual movement. What was far more apparent was the fact that Vegas did a much better job than any other resizer (LanczosResize, BicubicResize, BilinearResize, Spline36Resize, etc.) at preserving detail. This was especially true of subtle detail in areas of low contrast, such as slight wrinkles in a shirt.

So, I think I will stay with an all-Vegas workflow when down-sizing HD to SD.

Now, the AVC encoders are another matter entirely, and I will stick with Nick Hope's workflow for that.

Here's a very small portion of one field from the resulting 720x480 file, created in Vegas:



and here's the same thing using the AVISynth script shown below:



I just looked at the size of these images in my browser, and they show up pretty small. You can right-click and download them if you want to study the differences.

#Re-size function
#ConvertToYV12 function has problems depending on version of AVISynth used.
source=AVISource("e:\frameserver.avi").converttoyv12(interlaced=true).assumetff()
IResize(source,720,480).swapfields().assumebff().separatefields()

function IResize(clip Clip, int NewWidth, int NewHeight) {
Clip
SeparateFields()
Shift=(GetParity() ? -0.25 : 0.25) * (Height()/Float(NewHeight/2)-1.0)
E = SelectEven().Spline36resize(NewWidth, NewHeight/2, 0, Shift)
O = SelectOdd( ).Spline36resize(NewWidth, NewHeight/2, 0, -Shift)
Ec = SelectEven().Spline36Resize(NewWidth, NewHeight/2, 0, 2*Shift)
Oc = SelectOdd( ).Spline36Resize(NewWidth, NewHeight/2, 0, -2*shift)
Interleave(E, O)
IsYV12() ? MergeChroma(Interleave(Ec, Oc)) : Last
Weave()
}




farss wrote on 4/11/2011, 6:45 PM
Your results come as no suprise. Vegas uses a 4x4 bicubic matrix, I guess if you could tolerate the longer render times then a 8x8 matrix might give slightly better results.

One idea that been in the back of mind that I just haven't been bothered to try is to "smart" de-interlace to double the frame rate, scale and then re-interlace back to interlaced. This means static parts of the frame would give more resolution as the fields would be merged. The parts in motion would have lower res but given the presence of motion blur that's kind of irrelevant.

Bob.
johnmeyer wrote on 4/11/2011, 7:15 PM
Bob,

I happen to have all the moving parts to do what you suggest. The QTGMC deinterlacing script used in Nick Hope's complicated AVC workflow has an option to do the smart-deinterlace/framerate doubling. I can then resize that and then re-interlace. I may have a few more minutes to devote to this tonight, and if anything comes of it, I'll let you know.

[edit]OK, no one has posted in the fifteen minutes it took me to do the test. Bottom line: there is a very slight improvement compared to the simpler re-sizing I was doing, but it still doesn't even come close to the detail quality provided by Vegas.

I'd sure like to see what results others are getting, because everything I see says that Vegas is doing a fine job. The only issue is the one of apparent sharpness, and we have covered that many times in the past. It is pretty clear to me that most of what people are seeing is the result of expectations set by years of watching over-sharpened SD video.

So, while I have various things I think that Vegas could do better, I don't think that the HD to SD conversion quality is one of them. I fully realize that many in this thread have already stated their opinion and that they won't agree, but I just can't produce anything better than what I can get with Vegas, even with some extremely exotic workflows.

farss wrote on 4/11/2011, 9:40 PM
John,
thanks for trying that. I'm thinking it might be possible to do this entirely in Vegas with Mike Crash's Smart De-Interlacer as it has a "frame" differnce mode.

The thing is like you I'm pretty happy with the outcome just doing it without any extra effort using Vegas. I suspect the reason some are not happy is two fold.

1) As you've said they're comparing the outcome to what came out of the average DV camcorder.

2) They feel that just because they've shot "HD" then the SD should look fantastic. This myth seems to persist a lot and it had me sucked in for a long time as well.
My understanding is this,
If you shoot 1080i the average cheap palmcorder is going to give you 600 lines resolution. Now that sounds a lot better that what our trusty PD150/170s could manage and viewing the native footage at the same field of view the HD palmcorder should look better.
Problem is one is giving 600 in 1080 and the other 400 in 480 lines. Now downscale the HD to 480i and you only get at very best under 300 lines, probably even less due to other factors. Now compare the two and the SD camera's output is going to look better, it'll look even better given the amount of edge enhancement most of those cameras had. The HD looses a lot of the in camera edge enhancement during downscaling.

3) Shooting style. With SD we all knew those big wide shots were going to look sad, we avoided them as much as we could or kept them short. HD makes them look much better but does nothing to help SD downscaled from HD.

Bob.
NickHope wrote on 4/12/2011, 10:36 AM
Edit: Anyone who has got this far with this thread and intends to read further should really read this thread first, if not already, as we soon pick up on what was discussed then.

As a note to self as much as anything, here are some other threads of relevance to HD>SD downsizing:

John Meyer
Laurence
dvinfo.net
doom9 1
doom9 2
doom9 3
johnmeyer wrote on 4/12/2011, 11:31 AM
Nick,

I spent a lot of time reading that last doom9 post yesterday, and the "final" script that was posted near the end of that thread is one that I used in my testing yesterday. Despite all the refinements, I was never ever able to produce the same level of detail, going from 1080i (HDV) to 480i as I get in Vegas using the proper Vegas settings. Perhaps this has to do with non-square pixels (something that doesn't seem to be part of the AVISynth lexicon).

NickHope wrote on 4/12/2011, 11:43 AM
You've probably saved me quite a bit of effort then John. And to be honest I've always been pretty happy with my method of simply downsizing in Vegas (with a deinterlace method set) and frameserving to CCE for MPEG-2 encoding. I've never really pored over the results super-closely though since those DVDs weren't for mass production. When I spotted the subject come up on the doom9 QTCMC thread I wondered, as I suppose you did, if a better way had been found.

On my list above I've added 3 links to old threads on this forum that I have bookmarked on this subject, including one of yours from way back. That should cover just about all the options for ways to do this internally in Vegas.
johnmeyer wrote on 4/12/2011, 4:03 PM
I hope a few of you are still following this because I re-did the test and THIS time finally got the results I had expected all along, namely that I can significantly beat the quality of the Vegas 1440x1080 interlaced to 720x480 widescreen interlaced result.

To do this requires doing the full deinterlacing/frame doubling --> resizing --> reinterlacing that Bob suggested above and which I tried to do yesterday. However, I was in such a hurry to reply to him that I was sloppy and blew the test. One of the "gurus" over at doom9, where I also posted the results, was pretty insistent that I should have gotten better results than Vegas, and suggested I try again.

He was right.

It turns out I made two mistakes, one of which isn't relevant (my script had an error), but the other is very relevant: I used a codec rather than saving as uncompressed. Once I used uncompressed as my output, I saw a significant improvement over what I can get with the native Vegas workflow. However, when I saved using the MainConcept DV codec (this is a purchased codec that I use to save when rendering from VirtualDub), I got quite a bit of degradation. However, I then used VFAPIConv to serve back into a second instance of Vegas (is anyone every going to read this tortured post??) and saved using the outstanding DV codec built into Vegas. This still wasn't as good as uncompressed, when viewed field by field (by setting Vegas to Progressive 59.94), but it was pretty close. I also used that configuration to save an MPEG-2 file, using the DVD Architect Widescreen template, at 8,000,000 bps constant bitrate. Here is a link where you can get my original m2t file, the MPEG-2 SD result, and the AVISynth script:

Test Files

So, I have two conclusions: First, if you want to use the script (also shown below), and frameserve YUY2 out of Vegas into this script, you can produce some remarkable SD interlaced video from HD interlaced sources. I cannot imagine that ANYONE who has complained about getting "yucky" SD video for DVDs from their HD camcorders would have anything but praise for the results.

Second, choose carefully the encoding codec. This process produces some of the most detailed video that an SD codec has ever seen, and I think this shows up the flaws in each codec more than almost any other source imaginable.

The issue of people's preferences for traditionally over-sharpened SD video still remains. This workflow will definitely NOT produce that artificial "snap." However, as has been recommended many times, adding sharpening with a setting of "0" after doing the re-sizing to 720x480 will nicely overcome that objection.

#Script to re-size from HD to SD using deinterlace/framedouble - resize - followed by re-interlace
loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools2.dll")
loadplugin("C:\Program Files\AviSynth 2.5\plugins\RemoveGrainSSE2.dll")
loadplugin("C:\Program Files\AviSynth 2.5\plugins\SSE3Tools.dll")
loadplugin("C:\Program Files\AviSynth 2.5\plugins\mt_masktools-25.dll")
Import("E:\Documents\My Videos\AVISynth Scripts\QTGMC-3.31.avsi") #

AVISource("e:\frameserver.avi").assumetff()

QTGMC( Preset="Very Fast", FPSDivisor=1, EdiThreads=0, ShowSettings=false ) #use for 60p output

LanczosResize(720,480)
separateFields()
#SelectEvery(4,0,3) #BFF
SelectEvery(4,1,2) #TFF
Weave()


farss wrote on 4/12/2011, 5:04 PM
"is anyone every going to read this tortured post"

Yes.
You've now encouraged me to see if I can nut out a way to do the same trick entirely in Vegas. I used to use "Blend" for downscaling which will give the most res at the expense of artifacts on motion.


One general comment I should make, just for the benefit of other following my comments. I'm working in PAL SD. If nothing else having that extra resolution in SD means I can probably afford to loose a bit of resolution before things look too tragic.
On the other hand my "reference" for how good SD can look is OTA DVB broadcast. That is 4:2:2 and it's fed into my 16:9 CRT TV via RGB component on a SCART connection. The difference between 4:2:2 and 4:2:0 is significant with interlaced vide so anything I put onto a DVD is already at a disadvantage.

Bob.
musicvid10 wrote on 4/12/2011, 5:13 PM
It makes me happy that we can have higher level discussions here (of which I am in awe) without all the vitriol that characterizes Doom and a few of the others.

+1 for maturity.
PeterDuke wrote on 4/12/2011, 7:01 PM
John (or anyone) have you any comments on the Avisynth antialiasing filter?

http://avisynth.org/mediawiki/AntiAliasing

(The doom discussion thread is referenced at the bottom.)

In particular, I wondered whether it might help with some troublesome content.
NickHope wrote on 4/13/2011, 12:10 AM
is anyone every going to read this tortured post??

Hanging on your every word John, as usual.

For anyone wanting to try John's AviSynth script, my web video guide should help, particularly with the QTGMC part. Just skip all the stuff about MeGUI and x264.

The tricky part with QTGMC is getting stability when using it multi-threaded or 64-bit. That's a mine field.

I've said it many times before but, if you can stump up $58, CCE Basic is way better than Vegas' MainConcept for MPEG-2 encoding, and much faster too. There's a trial version. I've just noticed there is an AviSynth support tool for it too ("GoCCE") which might sit very well with a QTGMC workflow.
amendegw wrote on 4/13/2011, 3:33 AM
"is anyone every going to read this tortured post??"I love these threads... and read every word. I know a little bit about this subject (posted above), but know when it's best to shut-up and let the experts take over.

...Jerry

System Model:     Alienware M18 R1
System:           Windows 11 Pro
Processor:        13th Gen Intel(R) Core(TM) i9-13980HX, 2200 Mhz, 24 Core(s), 32 Logical Processor(s)

Installed Memory: 64.0 GB
Display Adapter:  NVIDIA GeForce RTX 4090 Laptop GPU (16GB), Nvidia Studio Driver 566.14 Nov 2024
Overclock Off

Display:          1920x1200 240 hertz
Storage (8TB Total):
    OS Drive:       NVMe KIOXIA 4096GB
        Data Drive:     NVMe Samsung SSD 990 PRO 4TB
        Data Drive:     Glyph Blackbox Pro 14TB

Vegas Pro 22 Build 239

Cameras:
Canon R5 Mark II
Canon R3
Sony A9

NickHope wrote on 4/13/2011, 8:16 AM
Looking into CCE Basic a bit more and I see it natively supports AviSynth .avs files, which is great. I had forgotten that.

This GoCCE program I discovered today is basically a CCE launcher which opens an AVI file and runs it through an AviSynth script that it creates on the fly to prepare it for encoding. But as it stands the AviSynth script is very rudimentary:

DirectShowSource("D:\fs.avi")
SeparateFields
BilinearResize(720,240)
Weave
ChangeFPS(29.97)
ConvertToYUY2


It's open source, so the AviSynth script could be changed to whatever is desired, including QTGMC etc.. However someone would need MS Visual Studio .NET or whatever to compile it, which is something I couldn't do. In any case I don't really see any advantage over just creating one's own AviSynth script, opening that direct in CCE, and encoding to a DVD template.

So now I'm trying to do Jerry's HD to SD Challenge by running his Amendegw-AVCHD.MTS file through a single-threaded variant of John's AviSynth script and then encoding with CCE Basic. Here's the script:

DirectShowSource("D:\My Videos\Amendegw-AVCHD.MTS")
ConvertToYV12(interlaced=true)
AssumeTFF
LanczosResize(720,height)
QTGMC( Preset="faster", FPSDivisor=1 )
LanczosResize(width,480)
separateFields()
#SelectEvery(4,0,3) #BFF
SelectEvery(4,1,2) #TFF
Weave()


The trouble I'm having is that AviSynth is not liking the input file. I get an error "Resize image is too small for this resize method". I have no such trouble with an HDV .m2t file. Jerry, what exactly is that file? Is it straight from your camera? Anyone know what I'd have to do to get it working in AviSynth? I messed around with tsMuxeR a bit but no joy. I have Haali Splitter installed. I'll ask on doom9 as well.
amendegw wrote on 4/13/2011, 9:42 AM
"Jerry, what exactly is that file? Is it straight from your camera?"Yeah, it's straight from my Canon HG21 recording in 1920x1080 60i, FXP (17Mbps) mode. The only thing I did was to rename it from the 0000##.mts to AVCHD.mts.

btw, here's the best I could do using the Vegas/Lagarith method posted above - if you wish to use it for comparison purposes: Proj-B-LagsV1322.zip

Good Luck!
...Jerry

System Model:     Alienware M18 R1
System:           Windows 11 Pro
Processor:        13th Gen Intel(R) Core(TM) i9-13980HX, 2200 Mhz, 24 Core(s), 32 Logical Processor(s)

Installed Memory: 64.0 GB
Display Adapter:  NVIDIA GeForce RTX 4090 Laptop GPU (16GB), Nvidia Studio Driver 566.14 Nov 2024
Overclock Off

Display:          1920x1200 240 hertz
Storage (8TB Total):
    OS Drive:       NVMe KIOXIA 4096GB
        Data Drive:     NVMe Samsung SSD 990 PRO 4TB
        Data Drive:     Glyph Blackbox Pro 14TB

Vegas Pro 22 Build 239

Cameras:
Canon R5 Mark II
Canon R3
Sony A9

johnmeyer wrote on 4/13/2011, 10:51 AM
Nick,

I tried your torture test using the QTGMC-based re-size script and the moiré patterns were horrible. I tried some of the slow presets, but that didn't help much. So, as much as I liked the results on my ballet footage, for this clip, I think it fails, and it fails quite spectacularly.

I then tried the script that was the result of several months of posts over at doom9. That thread was mostly about how to correct for chroma shift in YV12 video, something that doesn't apply here, but it also investigated the best ways to resize HD interlaced to SD interlaced. I found that this script produced some very nice results.

Of course much of what we are doing now is a re-hash of what we talked about in another thread several months ago, using this torture clip. I don't have time to re-visit the long thread in these forums where everyone tried to resize your torture tests, but I think I got a good result (this is the square pixel version, so it is squished). This is a single field from the resulting 720x480 image. I set the Vegas project properties to 59.94 progressive and then captured the image using the old "snapshot" script. I say that I think it is good not because it is particularly sharp, but because it (and all the other frames) seem to be free of moiré. Adding a sharpen=0 fX "fixes" the slight softness (although I didn't add that for the snapshot below).

[edit]I took the extra step of rendering to high-quality SD MPEG-2, using Vegas, burning a DVD, and then viewing the resulting DVD on my WEGA Sony 30" CRT monitor. The Vegas downsized result was OK, but had significant moiré; the QTGMC result was unwatchable; but the video created with the script below looked almost perfect and had no moiré whatsoever.



Here's the script:

#Re-size function
source=AVISource("e:\frameserver.avi").assumetff()

IResize(source,720,480)

function IResize(clip Clip, int NewWidth, int NewHeight) {
Clip
SeparateFields()
Shift=(GetParity() ? -0.25 : 0.25) * (Height()/Float(NewHeight/2)-1.0)
E = SelectEven().Spline36resize(NewWidth, NewHeight/2, 0, Shift)
O = SelectOdd( ).Spline36resize(NewWidth, NewHeight/2, 0, -Shift)
Ec = SelectEven().Spline36Resize(NewWidth, NewHeight/2, 0, 2*Shift)
Oc = SelectOdd( ).Spline36Resize(NewWidth, NewHeight/2, 0, -2*shift)
Interleave(E, O)
IsYV12() ? MergeChroma(Interleave(Ec, Oc)) : Last
Weave()
}


BTW, you mention multi-threaded in previous posts. For these tests, I used only single-threaded in order to eliminate any issues or problems associated with that aspect of AVISynth. It makes troubleshooting easier to eliminate as many variables as possible.