View Full Version : Improving resolution


carlmart
27th February 2009, 13:57
I have two cameras: a DV one and an HDV one.

The problem is how to use them both, be it as DV for SD screening or improving resolution to get to HD.

Let's start with DV. Even if both cameras are Sony, have three CCDs and are semi-pro, their image is different. Some adjustments are in order, at least in post-production.

Better yet: perhaps there's a way to shoot already thinking in that "boost" or "soften" that will be provided later on, and adjust settings accordingly.

What plug-ins should I start making tests with?

Some days ago I tried to use a "sharpen" filter on a DV image I had to improve resolution, and the only thing I got was an increase in the "halo" area along the objects borders, increasing the video look instead of diminishing it and making it look like film.

Perhaps what I need is a mix of several plugins, but I would like to know what to start with.

2Bdecided
27th February 2009, 16:47
You can't make DV look like HDV. No point trying.

You can easily make HDV into DV. Most HDV cameras will shoot DV anyway.

Then it's just a case of the usual matching issues between cameras - e.g. colour balance. You usually do this in your NLE with skill and care, having set both cameras up to be as close as possible to start with.

EDIT: if you're asking for the best way of upscaling DV to HDV, that's a useful question, and there are lots of relevant upscaling threads in the AVIsynth section. However, relying on good upscaling is not a good way to shoot + conform new content - it's just a "least bad" way of incorporating old content.

Cheers,
David.

carlmart
27th February 2009, 17:38
You can't make DV look like HDV. No point trying.

Neither would I try to. If you see my writing I said HD. So yes, that would involve upscaling.

You can easily make HDV into DV. Most HDV cameras will shoot DV anyway.

Yes. Mine is a Sony Z1 and does that. It can also downconvert from HDV to DV. It's still discussed what is better: shooting in HDV and downscaling or directly shooting in DV. Nowadays I am doing the former.

Then it's just a case of the usual matching issues between cameras - e.g. colour balance. You usually do this in your NLE with skill and care, having set both cameras up to be as close as possible to start with.

Yes, I have done that. Interestingly enough the DV shots, from a Sony PDX10, look crisper and with more detail than those from the Z1. Until now I have chosen to go black and white on one of them, but I think maybe avisynth allows more latitude with more transparency.

My NLE (Avid Xpress) allows some good handling in colour adjust, but not in texture. That's why I called this improving resolution.

EDIT: if you're asking for the best way of upscaling DV to HDV

No, that's part of the question. I am looking for ways to improve SD images too. And you can't (or shouldn't) upscale to HDV, but to HD.


and there are lots of relevant upscaling threads in the AVIsynth section. However, relying on good upscaling is not a good way to shoot + conform new content - it's just a "least bad" way of incorporating old content.

I will look into them too. I already did on some and didn't find what I was looking for.

About how to shoot considering the upscaling, maybe it's just part of my film background. Where you shot considering how the lab would process that film later. Perhaps there's a way to get better results by doing that in this process too.

2Bdecided
27th February 2009, 20:36
For HD>SD interlaced, about every possible approach made its way into this thread...
http://forum.doom9.org/showthread.php?t=139102

For HD>SD progressive, it's just a case of trying out the different resizers (and sharpeners). Or, if you want to avoid flicker on interlaced displays, see this thread:
http://forum.doom9.org/showthread.php?t=139948


Is it stating something far too obvious to say that it's pointless upscaling DV (or any SD) to HD? I would say making it intentionally different (B&W like you suggested) is a smart idea - making it look like a "special effect" you can sometimes get away with it. Another idea: have the SD footage playing on an SD TV, and film it with an HD camera.

I don't think any of these options really integrates newly shot DV footage into an HD workflow convincingly, but YMMV.

Cheers,
David.

carlmart
27th February 2009, 21:30
For HD>SD interlaced, about every possible approach made its way into this thread...
http://forum.doom9.org/showthread.php?t=139102

For HD>SD progressive, it's just a case of trying out the different resizers (and sharpeners). Or, if you want to avoid flicker on interlaced displays, see this thread:
http://forum.doom9.org/showthread.php?t=139948


Thanks, I will have a look at both.

Is it stating something far too obvious to say that it's pointless upscaling DV (or any SD) to HD?

Probably so. But I was curious to see what you could get. I did see some very good stuff on a video forum a time ago, with some stuff that was upscaled and did look better than the original.

You can do it by hardware too, like Miranda, but you have to get the equipment. I want to know how far you can get.

I would say making it intentionally different (B&W like you suggested) is a smart idea - making it look like a "special effect" you can sometimes get away with it.

As I said, I wonder why the DV stuff looked better than the HDV. Probably because light was low and the Z1 is not good with more gain.

Another idea: have the SD footage playing on an SD TV, and film it with an HD camera.

What about the TV lines? What would I get that way?

Yesterday I was having a look at some topic on Doom9 concerning upscaling a cartoon. What I wonder is what happens when upscaling. When I upscale a DVD on my player and look at it at 720p, the results are a lot better than when I screen it at 480p. So why wouldn't upscaling DV by software improve things too?

I don't think any of these options really integrates newly shot DV footage into an HD workflow convincingly, but YMMV.

My intention is to learn with this process, even if results are not what I might expect.

Blue_MiSfit
27th February 2009, 21:34
First of all, you can improve the look of a good, clean DV source somewhat with good interpolation, sharpening, and grain addition, but you're not going to match an HD source. Period.

I think it's a great idea to shoot in HDV. It nets better looking SD than DV can, IMO.

You'd better edit everything in SD though. Here's how I'd do it (if I had lots of time, and didn't mind the intermediate file sizes)

1) Shoot HDV and DV as necessary. Shoot everything in either 24p or 60i.
2) Conform all files to SD masters using AviSynth to field-match or bob-deinterlace as necessary. I'd store everything in MJPG, uncompressed, or lossless at 24p or 60p. Avoid interlacing :) You could also sharpen the DV->SD sources to make them similar to the HDV->SD sources. LSFMod is my personal favorite ATM.
3) Edit using these SD masters, do your color correction etc in the NLE, as they're usually much better at this than AviSynth can be (at least, from a UI perspective)
4) Export your final product from the NLE via frame-serving (so you can avoid possible color space conversions etc...) to a lossless format
5) Use this lossless export as your source for DVD / H.264 encoding.

If you want to do the whole thing in HD - shoot it all in HD, and edit in ProRes or CineForm.

Here's an important question - what NLE / platform are you running on? I'm assuming Windows?

~MiSfit

carlmart
27th February 2009, 22:49
Your approach is very interesting and worth investigating. I am currently involved in doc I shot myself with both cameras in 16:9. HDV on the Z1 and DV on the PDX10. Integrating them somehow is the key.

As DV is better for medum to close-up shots, that's what I do. HDV is much better for wide shots but resolves differently than DV for close-ups, more filmlike perhaps.

First of all, you can improve the look of a good, clean DV source somewhat with good interpolation, sharpening, and grain addition, but you're not going to match an HD source. Period.

You mean match an HD from what source?

What puzzles me is how great look upscaled images outputted by my DVD player @ 720p. Why can't I get such results from a DV source. Of course it would have to be clean. It's very much like blowing up 16mm film: if it's underexposed or grainy it will look bad.

You name three things I would like try on some of my doc shots: interpolation, sharpening and grain addition.

I think it's a great idea to shoot in HDV. It nets better looking SD than DV can, IMO.

You mean shooting HDV for DV downscaling? Why not HDV for an HD product?

You'd better edit everything in SD though. Here's how I'd do it (if I had lots of time, and didn't mind the intermediate file sizes)

OK. Time wouldn't be a problem. But why edit in SD?

1) Shoot HDV and DV as necessary. Shoot everything in either 24p or 60i.

Both cameras have 60i. The 24p in the Z1 is fake, not good. On the Z1 I may shoot 50i, to edit in PAL and looking a bit film-like; later going up to 60i. But that would leave me just one camera, and you need two cameras for a better edit.

2) Conform all files to SD masters using AviSynth to field-match or bob-deinterlace as necessary. I'd store everything in MJPG, uncompressed, or lossless at 24p or 60p. Avoid interlacing :)

More processing I will have to learn: field-match and bob-deinterlace.

What file type would that be? I am not sure Avid Xpress can read MJPG.

You could also sharpen the DV->SD sources to make them similar to the HDV->SD sources. LSFMod is my personal favorite ATM.

Well, I already have something I shot on a park, in the afternoon, with both cameras. I may start with that for comparison.

LSFMod it is, then. What parameters to start with?


3) Edit using these SD masters, do your color correction etc in the NLE, as they're usually much better at this than AviSynth can be (at least, from a UI perspective)

Good approach. That's the one I was thinking off: improving resolution first, adjusting color later. I use 3prong colorfix plugins which work great in Avid, better than its own.

4) Export your final product from the NLE via frame-serving (so you can avoid possible color space conversions etc...) to a lossless format

What that format would be? I export as mov, which preserves the originals quality, usually to an m2p to make the DVD from. But I am planning to broadcast this project, and hopefully the one ones to follow. So what do I export to?

5) Use this lossless export as your source for DVD / H.264 encoding.

OK.

If you want to do the whole thing in HD - shoot it all in HD, and edit in ProRes or CineForm.

If you get me the money!

My concern is to output programs I can screen in HDTV. Discovery, and that I know for a fact, was shooting in HDV shows to be screened in HDTV.

Here's an important question - what NLE / platform are you running on? I'm assuming Windows?

Yes, Windows XP. Not going to Vista yet.

Was considering FCP, which seems to be better than Avid for HD, but it would be later on.

Blue_MiSfit
28th February 2009, 04:02
Your approach is very interesting and worth investigating. I am currently involved in doc I shot myself with both cameras in 16:9. HDV on the Z1 and DV on the PDX10. Integrating them somehow is the key.


Okay, so we already have a mixture of HDV and DV footage. Fine.



You mean match an HD from what source?


Either a really good HDV / AVCHD camera, or something better, like a 1080p telecine.


What puzzles me is how great look upscaled images outputted by my DVD player @ 720p. Why can't I get such results from a DV source. Of course it would have to be clean. It's very much like blowing up 16mm film: if it's underexposed or grainy it will look bad.


You can get surprisingly good results if you're willing to spend the time. AviSynth is powerful. I think you'll be pleased. Just keep in mind that shooting the same scene with two cameras - one HD and one SD, you won't ever get the SD to match the HD. It will look good, sure, but you can't magically turn 480 lines into 1080 lines :)


You mean shooting HDV for DV downscaling? Why not HDV for an HD product?


You certainly can use HDV for HD. That's what it's designed for :) I was just thinking of lowering everything to a greatest common denominator (SD), but you want to produce HD content, so now we're doing the opposite! :D


You name three things I would like try on some of my doc shots: interpolation, sharpening and grain addition.


Yep. Here's a basic skeleton script I'd use for taking a 480i60 source, and upscaling it to 1080i60. There's been lots of discussion on this subject, and I don't often work with interlaced video, so it might not be perfect.


AVIsource("Clip.avi") #Let's assume NTSC true anamorphic 16x9 DV, decoded via Cedocida into YUY2 4:2:2

#First, we need to bob-deinterlace. My usual standard is YADIFmod, but there are lots of options
EDI=NNEDI(field=-2)
YADIFmod(mode=1, edeint=edi)

#Now, we're at 720x480p60, hopefully aliasing free!
NNEDI(field=0, dh=true).turnright.NNEDI(field=0, dh=true).turnleft

#Now we're at 1440x960p60, hopefully looking reasonably good!
Spline36resize(1920,1080)

#Now we're at 1920x1080p60. Now would be a good time to start cleaning things up

#Start with fft3dfilter or fft3dgpu in chroma-only mode. DV usually has a lot of chroma noise, so I'd start with moderate settings, and work up as necessary
fft3dfilter(plane=3, sigma=1, sigma2=2, sigma3=2, sigma4=1)

#Now a generic MVDegrain2. There's lots of options here as well (MC_Spuds, and other MVDegrain wrappers)
super = MSuper(pel=2, sharp=1)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)

#Now we should be pretty nice and clean! Let's do some sharpening. Here's a basic LSFMod
LSFMod(Smode=5)

#And finally, let's add some grain!
GrainFactory3(g1str=5, g2str=7, g3str=10)

#And to re-interlace everything:
Separatefields.SelectEvery(4,0,3).Weave


Want to compare that to a simple upscale? Drop the re-interlacing line, and compare to this:


AVISource("clip.avi")
Bob()
LanczosResize(1920,1080)


I think you'll be suitably impressed :)

AvsP is an invaluable tool for working with AviSynth. Learn it :)


Both cameras have 60i. The 24p in the Z1 is fake, not good. On the Z1 I may shoot 50i, to edit in PAL and looking a bit film-like; later going up to 60i. But that would leave me just one camera, and you need two cameras for a better edit.


Shoot everything in 60i. Frame-rate conversions are a PITA. Just do 60i... SO much simpler (and this coming from the guy that's advising you to use multiple instances of NNEDI and MVDegrain2 on a 480i->1080i upscaling script :P


What file type would that be? I am not sure Avid Xpress can read MJPG.

It had damned well better!!! :) MJPG is a great common format. If not in the AVI container, then it should certainly support it in the QuickTime MOV container!


Well, I already have something I shot on a park, in the afternoon, with both cameras. I may start with that for comparison.


Fantastic! If you want to upload the DV / HDV files somewhere, I'd love to take a look!


Good approach. That's the one I was thinking off: improving resolution first, adjusting color later. I use 3prong colorfix plugins which work great in Avid, better than its own.

I figured as much. I've always been impressed with both the speed and simplicity of Avid's color correction! With the workflow I'm proposing, you'll be able to feed 4:2:2 MJPG into Avid, and have good accuracy for color correction.


What that format would be? I export as mov, which preserves the originals quality, usually to an m2p to make the DVD from. But I am planning to broadcast this project, and hopefully the one ones to follow. So what do I export to?

I would suggest exporting to a lossless VFW (avi) codec like HuffYUV if you can. I'm not sure how Avid's export engine works. I'm most familiar with Premiere. If you can export via QuickTime, you should be okay. Just use PhotoJPEG at 100% quality. That will maintain 4:2:2 color, and isn't unmanageably large.

Once you've spit out your master, you can again load it into AviSynth, do any last minute stuff you might need (a final sharpen, noise reduction, or perhaps dithering), and feed the result directly into an awesome MPEG-2 encoder like HC! Alternatively, you could feed it into my dear friend x264 and produce fantastic quality H.264 video ;)


My concern is to output programs I can screen in HDTV. Discovery, and that I know for a fact, was shooting in HDV shows to be screened in HDTV.


Absolutely. HDV is a perfectly capable acquisition format, provided you are aware of, and know how to work around its limitations.


Was considering FCP, which seems to be better than Avid for HD, but it would be later on.

For ProRes, yes FCP is awesome :) I personally don't like FCP that much (since I'm a Windows guy), but lots of people think it's the best thing since sliced bread! I say use what you know, and for me, that's AviSynth, which requires Windows, and therefore means Avid or Premiere :D

Anyway, I hope my suggestions have been helpful. Please feel free to ask any questions. I'm always very interested to help someone involved in production / post learn how things really work under the hood, and how to do things "right" :)

~MiSfit

carlmart
28th February 2009, 04:25
MiSfit,


I will take some time to comment your comments, but I am glad you were around. Thanks.

As I already learnt how to load-up small excerpts in VideoHelp, will see if I do that in the week-end.

Pity that next week I will be travelling, so there won't be much more from me for the next 7 days. But as soon as I come back I will continue at full speed with avisynth.

As I still have to shoot a bit more, I will be able to do that with this background helping me.

See you!

Blue_MiSfit
28th February 2009, 09:16
Cool, I eagerly await it :)

2Bdecided
1st March 2009, 23:12
When I upscale a DVD on my player and look at it at 720p, the results are a lot better than when I screen it at 480p. So why wouldn't upscaling DV by software improve things too?With respect, your DVD player is probably working with a higher quality source (Hollywood movie) - and you aren't comparing 480i vs 1080p every few seconds by cutting between them. Your eyes adjust to the soft but jagged-free upscaling, and prefer it to the soft and jagged(?) 480p. Throw in some native 1080p and the upscale will look what it is: soft and lacking in detail.

Good script from Blue_MiSfit, but if you're shooting interlaced and blowing up to 1920x1080, you might need a better bobber than yadiff. If so, try mcbob or tgmc - but be warned: they're very slow.

If you really want HD, you need an HD camera. It doesn't have to be expensive. Lots of people are using consumer Canon HDV machines for "B roll". Some people are selling more expensive SD camcorders to pay for them ;) Depends what you want - if SD is much more important, then obviously your PDX10 is going to give better SD pictures than a _much_ cheaper HDV machine.

Cheers,
David.

carlmart
1st March 2009, 23:56
With respect, your DVD player is probably working with a higher quality source (Hollywood movie) - and you aren't comparing 480i vs 1080p every few seconds by cutting between them. Your eyes adjust to the soft but jagged-free upscaling, and prefer it to the soft and jagged(?) 480p. Throw in some native 1080p and the upscale will look what it is: soft and lacking in detail.

Point taken. Pity I don't have the time yet to start experimenting, as I'm getting ready for my trip tomorrow.

But it might be worth doing some tests with my DV camera and seeing it direct and through the DVD with upscaling. Then we can talk a bit more on what does what.

I am not sure if I can play DV through the component output in the Z1 camera, because then I might also compare DV and HDV of similar scenes. I think that is the test I should do to have a reference on what I should look for.

Though I will only be able to watch @ 720p, which is the maximum my plasma screen can take. Over that it will downscale. In any case the Z1 only outputs 1080i AFAIK.

Good script from Blue_MiSfit, but if you're shooting interlaced and blowing up to 1920x1080, you might need a better bobber than yadiff. If so, try mcbob or tgmc - but be warned: they're very slow.

OK. Let's talk about them when I start my tests.

If you really want HD, you need an HD camera. It doesn't have to be expensive. Lots of people are using consumer Canon HDV machines for "B roll". Some people are selling more expensive SD camcorders to pay for them ;) Depends what you want - if SD is much more important, then obviously your PDX10 is going to give better SD pictures than a _much_ cheaper HDV machine.

I bought the PDX10 when HDV was just starting, and I didn't want to risk all that money an F1 did cost back then. And now I will get very little if I try to sell the PDX10.

That's why I'm looking into what I can still get from it image wise.

Small HDV cameras like Canon's or Sony's have two limitations: only one CCD/CMOS and crappy lenses. You may get away on close to mid shots and as long as you don't move the camera.

Blue_MiSfit
3rd March 2009, 05:31
Small HDV cameras like Canon's or Sony's have two limitations: only one CCD/CMOS and crappy lenses. You may get away on close to mid shots and as long as you don't move the camera.


Bingo.

They're fine for consumer usage, and maybe for shooting an interview or something with good lighting and a tripod etc, but their lenses and CCDs are simply not very good when it comes to noise, dynamic range, etc... Lots of pixels though :D

~MiSfit

carlmart
4th March 2009, 13:05
Bingo.

They're fine for consumer usage, and maybe for shooting an interview or something with good lighting and a tripod etc, but their lenses and CCDs are simply not very good when it comes to noise, dynamic range, etc... Lots of pixels though :D


Once again we seem to agree on another point. It looks that we have both been there and probably quite know what to look for.

Pity I am now in Buenos Aires and not in Rio de Janeiro, so that we could start our tests with the stuff I already recorded. That only next week.

I am looking forward to it.

Blue_MiSfit
4th March 2009, 20:34
Rio de Janeiro! What a wonderful city. I visited a year ago for the first time, and enjoyed it very much. Are you Carioca?

~MiSfit

*.mp4 guy
7th March 2009, 06:29
If you really want to know what you can get out of your dv footage, post a sample in the avisynth usage forum, and ask advice on blowing it up to HD resolution. You should get a few good suggestions, and you can use the one you like the best.

Sagekilla
9th March 2009, 14:53
If you're feeling particularly sadistic, you can try this:


# Deblock and Denoise, optional
SmoothD(3,4,1,1)
src = last
super = src.MSuper(pel=2)
bvec2 = super.MAnalyse(isb=true, delta=2, overlap=4)
bvec1 = super.MAnalyse(isb=true, delta=1, overlap=4)
fvec1 = super.MAnalyse(isb=false, delta=1, overlap=4)
fvec2 = super.MAnalyse(isb=false, delta=2, overlap=4)
src.MDegrain2(super,bvec1,fvec1,bvec2,fvec2)

AddBorders(8,8,8,8).SSSharp(strength=5).GradFun2db(1.51).Crop(8,8,-8,-8)
NNEDI(0,dh=true).TurnLeft().NNEDI(0,dh=true).TurnRight()

Didée
9th March 2009, 18:07
@Sagekilla: that ain't work if you don't *use* the super clip ...
[...]
super = src.MSuper(pel=2)
[..vectors..]
src.MDegrain2(super,bvec1,fvec1,bvec2,fvec2)
[...]

Blue_MiSfit
9th March 2009, 20:04
I can't wait to see test clips ;)

smok3
9th March 2009, 20:40
some random notes, while still fresh;

i have just finished a c-production music video, it was shot with 2 kameras: sony hvre1 and older pano dvx100. Pano was set to f6 (the movie mode curves) and got me some letterboxed '16:9' DV footage, sony was set to cine-curve as well, to easy the post i have shot using wide DV mode (so basically all the material was DV). All material is also progressive.

Now in post, project was done using wide preset (premiere cs3), so the pano footage was upscaled.

CC
primary CC was to behave the signal and to get the colors close to each other (the image is still completely different, sony looks mucho sharper)
secondary CC was applying some false color looks, some vignete and some slight grain (edit: and some chroma bluring).
mastering correction was slight luma compression and not-so-slight chroma compression.
post-mastering was forcing TV levels to all versions (including the one for the web).

Came out pretty well at the end - the point here is that multiple CCs will give you closer to the uniform look (while that might not be technically correct), of course you can do plenty damage for a music video, not all kind of projects would survive that.

regrets:
it would either need;
a. a lot more post to make some sort of faked DOF
or
b. proper DOF adapters for both cameras to get that sexy shallow depth (at least on close-ups)
or
c. use some more crazy tech altogether, like using Nikon d-90 for example.

p.s. why DV? i could spent more time editing and less time thinkering about conversions, easy ;)

2Bdecided
9th March 2009, 21:32
Does the "cheats" DOF trick of getting a long way away, and then zooming in, work with those cameras? If you have the space, and the camera is steady, the resulting video can be just what you want - it can be a pain to shoot well though - you think your tripod is stable until you try this! ;)

Cheers,
David.

smok3
9th March 2009, 23:12
it would work (and it did to some point), however you can't just build on such shots (i did actually a lot of handwork using wide lens as well - and those shots are actually the best in this case).

with other words, i regret i didn't get a look like this one for example;
http://vimeo.com/834458
(these guys used canon dslr)

carlmart
10th March 2009, 04:47
Rio de Janeiro! What a wonderful city. I visited a year ago for the first time, and enjoyed it very much. Are you Carioca?


Well, even if born in Buenos Aires, after living 30 years in Rio I do consider myself carioca!

carlmart
10th March 2009, 04:49
If you really want to know what you can get out of your dv footage, post a sample in the avisynth usage forum, and ask advice on blowing it up to HD resolution. You should get a few good suggestions, and you can use the one you like the best.

Tomorrow that's what I will do. Using my samples is the best way to achieve that.

carlmart
10th March 2009, 04:52
I can't wait to see test clips ;)

Right now it's late night here and I just came back from Buenos Aires. Tomorrow expect to start trying the samples.

One thing: how do I capture HDV from Windows XP? I know how to do that from Avid, even if I never tried it yet. Until now I have been downconverting HDV to DV from the Z1.

Blue_MiSfit
10th March 2009, 09:22
IIRC, HDVSplit works well :)

~MiSfit

smok3
10th March 2009, 09:30
or you think one step ahead and record to hard-drive on location....

carlmart
10th March 2009, 11:38
or you think one step ahead and record to hard-drive on location....

When these portable/affordable HD systems came along there was a split between card-based ones and tape based ones.

Both had compromises, but I found time limitations & cost the bigger issue in card systems.

Then HDD portable recorders came as the great savior for card cameras and also for tape cameras, both using firewire interface.

It has surprised me that no one, absolutely no one, raised the main problem of using firewire interface on location shooting: the connector. It's a very serious issue, as I see it. The connector is not a locking type and it doesn't remain completely stationary on camera or HDD.

Now you can get the Sony EX1 and EX3 cameras that record more than 50 minutes in one card, which is certainly more practical and affordable than Panasonic ones.

smok3
10th March 2009, 11:44
the main problem of using firewire interface on location shooting: the connector. It's a very serious issue, as I see it. The connector is not a locking type and it doesn't remain completely stationary on camera or HDD.

hmm, maybe that would be an issue if you didn't attach the drive itself directly to the camera.
edit: i do usually shot to tape as well at the same time, so there is always 'backup' if something goes wrong.

carlmart
10th March 2009, 11:54
hmm, maybe that would be an issue if you didn't attach the drive itself directly to the camera.

Not really. The best holding solution I have seen is a sliding one that you fix between camera and tripod. All others, like the popular "belt-type" are potentially dangerous for moving situations.

HDD systems are quite expensive, BTW, as they are not just HDDs.

In any case, it's not something I am very inclined for.

Tape is still much less epensive and much better to store than all others, even if hugely compromised in bandwidth.

smok3
10th March 2009, 21:05
The best holding solution I have seen is a sliding one that you fix between camera and tripod
that's what i'am using. Yes they are pricey.

carlmart
12th March 2009, 22:14
OK. Now I'm back.

I am having some problems to make HDVSplit to recognize the camera.

Windows has already seen it, identified it as Sony Z1 and all that. But not HDVSplit.

The read-me file says I have to install a DVHS driver, which I can't find anywhere. But on a Google I made people seem to use HDVSplit straight away. So I wonder what may be happening.

--------------------------------------------------------------------------------------------------
PLEASE DISREGARD ABOVE. THE CAMERA WAS SETUP FOR DV. AFTER RE-READING THE MANUAL AND SETTING TO HDV THINGS ARE FINE.

I left this because some people reading it might have faced this same problem and remember how to solve it.

Blue_MiSfit
13th March 2009, 09:49
Welcome back!

Toss a sample up on megaupload or somewhere similar when you get a chance :) I'm eager to see your footage!

carlmart
13th March 2009, 12:49
How long should be those files I am uploading?

In EasyShare, which is the uploader I used in the past, a 26 sec HDV file, which is 86.000Kb long, is taking forever to upload. It says it will take more than 3 hours!

Any other place to do that faster?

Guest
13th March 2009, 14:04
www.mediafire.com

carlmart
13th March 2009, 19:48
Well, after several comings and goings with Mediafire, I got to understand that my grand total in files can't exceed 100MB.

So I think I will just capture smaller chunks to see if I can put the two files there. But they can't exceed 10 seconds each, apparently.

2Bdecided
13th March 2009, 21:14
I thought you wanted someone to suggest how to upscale DV nicely? If so, you need to upload DV. (Sorry to state the bleeding obvious - maybe I've missed something in two pages?!) Are you just uploading the HDV for comparison?

Cheers,
David.

carlmart
13th March 2009, 21:37
I thought you wanted someone to suggest how to upscale DV nicely? If so, you need to upload DV. (Sorry to state the bleeding obvious - maybe I've missed something in two pages?!) Are you just uploading the HDV for comparison?


My query pretends to get to know how to do both things: upscaling DV and, when shooting along with an HDV camera, finding a way to use the DV stuff to look as close as possible to the HDV.

As I have already shot some stuff using both cameras, it might be useful to see how it would apply there.

carlmart
14th March 2009, 16:19
Well, at last could I upload one file: the one in DV.

http://www.mediafire.com/file/1nmzjmmm3kn/testDV1_a.avi

You can take a look.

After you download it I'll see if I can upload the HDV file. Do let me know when you did, as something may go wrong and I delete the one already there by mistake.

Blue_MiSfit
14th March 2009, 17:56
Downloading :)

I'll let you know what I discover.

~MiSfit

Blue_MiSfit
15th March 2009, 12:03
A nice test clip! You're lucky your DV camera creates very clean footage, and you had good lighting!

I got pretty good results. I had Cedocida decode to YV12, since RemoveGrain (in TempGaussMC) didn't like YUY2..


AVISource("C:\doom9\testDV1_a.avi")

TempGaussMC_Alpha3()
spline36resize(1920,1080)

fft3dgpu(plane=3, sigma=1, sigma2=2, sigma3=4, sigma4=1, sharpen=.4)

lsfmod(smode=5)

grainfactory3(g1str=5, g2str=8, g3str=10)
addgrainc(0,2)

separatefields.selectevery(4,0,3).weave


TempGaussMC was a significant improvement over yadifmod+nnedi. I'm quite impressed with the deinterlacing, actually! Peek at the internal 1080p60 by commenting out the separatefields..... line!

To me, the only real remaining issue is what appears to be chroma halos. I tried fft3dgpu, with mixed results. I've heard awarpsharp is good at fixing this, but I've never used it :)

Let's see an HDV clip to see if they intercut reasonably well!

~MiSfit

carlmart
15th March 2009, 16:24
Let's see an HDV clip to see if they intercut reasonably well!


Here it is then:

http://www.mediafire.com/?sharekey=baad3af1c8fb5a28d6baebe61b361f7c8143292265456bebb8eada0a1ae8665a#

Please tell me if the URL works OK.

After you download it, we may talk about it, as there are some distortions on the captured file that were not on the original. As I never captured HDV this way before and only through Avid, I don't know what it is.

WorBry
15th March 2009, 20:15
A nice test clip! You're lucky your DV camera creates very clean footage, and you had good lighting!

I got pretty good results. I had Cedocida decode to YV12, since RemoveGrain (in TempGaussMC) didn't like YUY2..


AVISource("C:\doom9\testDV1_a.avi")

TempGaussMC_Alpha3()
spline36resize(1920,1080)

fft3dgpu(plane=3, sigma=1, sigma2=2, sigma3=4, sigma4=1, sharpen=.4)

lsfmod(smode=5)

grainfactory3(g1str=5, g2str=8, g3str=10)
addgrainc(0,2)

separatefields.selectevery(4,0,3).weave


TempGaussMC was a significant improvement over yadifmod+nnedi. I'm quite impressed with the deinterlacing, actually!

~MiSfit

I would have thought that TempGaussMC is not advisable if the intent is to re-interlace after processing, since it acts on the original fields as well as the interpolated fields:

http://forum.doom9.org/showthread.php?p=1139797#post1139797

I appreciate that the original fields are lost anyway in the resizing, but would have thought that using a 'true' bobber would be less prone to edge abberations after the upscaled fields are interlaced?

Also, since denoising (MVDegrain) and counter-sharpening are integral components of TGMC, your script is effectively performing two rounds of denoising/sharpening, one before and one after upscaling. Surely, denoising and sharpening each at one point after bobbing (whether before or after upscaling) would make for better preservation of detail?

I guess I should try it myself.

carlmart
15th March 2009, 20:18
Blue_MiSfit,

I was just about going to try the script you suggested, and being, a novice to avisynth as I am, planned to use AVStoDVD as the program to load the scripts in.

Then I remembered that this is not a DVD file but an HD file. So I am not quite sure which path to follow.

Maybe HCgui should be the way, so let's see if I am doing things right:

1) Load your script, with changes over where my source is.

2) What do I write as output file?

3) What do I log file name?

4) What else do I load to get the "Encode" button to work?

Is there any other way you suggest to work with these files?

JohnnyMalaria
15th March 2009, 21:18
To compare HDV and upscaled DV from the same camcorder, record HDV to tape and simultaneously use the FireWire output in DV mode and capture to disk. (This assumes that the camcorder hasn't been stupidly designed to encode to HDV and then convert to DV when recording a live image).

carlmart
15th March 2009, 22:09
To compare HDV and upscaled DV from the same camcorder, record HDV to tape and simultaneously use the FireWire output in DV mode and capture to disk. (This assumes that the camcorder hasn't been stupidly designed to encode to HDV and then convert to DV when recording a live image).

Interesting. But how do I get a video file with an upscaled DV image?

For instance: I know you can convert DV to HD-SDI using hardware, like Miranda, or software, like Video Enhancer.

But I wonder what I can get using avisynth. My guess is that, in the case of some software programs, they may simply be using avisynth plugins. Am I wrong?

carlmart
15th March 2009, 22:24
A nice test clip! You're lucky your DV camera creates very clean footage, and you had good lighting!

The camera is reasonably good. You can certainly get better images with a Sony PD170 or a Pana DVX100, but the PDX10 is very good in 16:9.

Lighting was good, but I should have probably used a better F stop. I think it's a bit underexposed. To do things right I should use some sort of waveform metering, I think.

I got pretty good results. I had Cedocida decode to YV12, since RemoveGrain (in TempGaussMC) didn't like YUY2..

In what Cedocida is better than a regular DV codec?

To me, the only real remaining issue is what appears to be chroma halos. I tried fft3dgpu, with mixed results. I've heard awarpsharp is good at fixing this, but I've never used it :)


Well, until I get to do see things myself I can't comment over this. BTW: I will find to find a way to see this on a larger screen. My plasma can resolve up to 720p only, but that should be enough for now. Perhaps I should copy the resolved files to our laptop and see them on the plasma screen.

Let's see an HDV clip to see if they intercut reasonably well!

Could you donwload it? The background in both shots is different, and that is something I will also look into in future setups, if I can.

2Bdecided
15th March 2009, 22:57
@WorBry,

IMO unless you're going to re-interlace to the same resolution and keep those lines in the output, keeping the original lines when deinterlacing is irrelevant. I'd just use whichever works best.

FWIW I think the original source is really nice and clean, and the slight denoising inherent in TGMC might not be appropriate. If I was going OTT, I'd try the various versions of TGMC and the two versions (EEDI2 / NNEDI) of mcbob, to see which worked best.

Cheers,
David.

Didée
16th March 2009, 01:39
Short addendum to 2Bdecided's OT - if TGMC's inherent denoising is an issue, you can always reduce noise before TGMC, and re-add it afterwards. Technically dirty, but quite effective in practice. ;)

a = last
b = a.fft3dfilter(sigma=?,interlaced=true)
c = b.TempGaussMC()

c.mt_adddiff(mt_makediff(a,b).doubleweave(),U=2,V=2)

2Bdecided
16th March 2009, 16:34
To add another suggestion...

I can't see anything worth "filtering", but I think the halo on the bright/dark transitions is horrible. I've never been very happy with attempts to fix these kinds of problems, but here is a start...

AVISource("testDV1_a.avi",pixel_type="yuy2")

converttoyv12(interlaced=true)

#a=last

TempGaussMC_Alpha3()

nnedi(field=0,dh=true).TurnRight().nnedi(field=0,dh=true).TurnLeft()

BlindDeHalo3(rx=3.2,ry=4.5)
limitedsharpenfaster()

spline36resize(1280,960)

sharpen(0.5)

grainfactory3(g1str=2, g2str=4, g3str=5)
addgrainc(0,2)

spline36resize(1440,1080)

limitedsharpenfaster()

#interleave(last,a.Bob().spline36resize(1440,1080))

return last

separatefields.selectevery(4,0,3).weave

Remove the "return last" line to interlace the output.

Uncomment the two "#" lines to compare this processing with a basic bob-resize (which is what many TVs do).


Note: to match HDV, the size needs to be 1440x1080. Using NNEDI gives a little useful anti-aliasing of some diagonals - the difference is just visible.


As for downsizing HDV to match this DV - I think the HDV clip you supplied is a little over exposed and requires colour matching, but a simple bob, resize, slight soften and then (over!) sharpen will match quite well.

Cheers,
David.

carlmart
16th March 2009, 18:31
OK. With some help from the friends on another topic, at least I could run Blue_MiSfit script in VirtualDubMod.

Probably due to something I'm missing, I get errors from the lines

TempGaussMC_Alpha3()

lsfmod(smode=5)

grainfactory3(g1str=5, g2str=8, g3str=10)
addgrainc(0,2)

Without them I can get the file to run, but not as smoothly as it should.

carlmart
16th March 2009, 18:47
2Bdecided,


Would love to try your script... as soon as I solve the problems I described above.


Note: to match HDV, the size needs to be 1440x1080. Using NNEDI gives a little useful anti-aliasing of some diagonals - the difference is just visible.

About HDV, I have yet to determine to what format will it be exported for editing and after editing. This should be the format the DV should get to too.

As for downsizing HDV to match this DV - I think the HDV clip you supplied is a little over exposed and requires colour matching, but a simple bob, resize, slight soften and then (over!) sharpen will match quite well.

Yes, it's a bit over exposed. Exposure is something I will be more careful next time I shoot with both cameras. In general I prefer video to be a bit over exposed, as long as highlights are not blocked out. Detail you don't get in video for overexposure won't get back, but so are if it's lost in underexposure noise.

WorBry
16th March 2009, 20:24
Just a comment about the halo-ing. I see its already present in your source DV sample and most likely a by-product of the camcorders internal (electronic) sharpening mechanism. 3CCD DV cams in particular are quite prone to it, including my Panasonic NV-GS400, which, in auto-mode, has a bias toward slight over-sharpening....all part of the illusion of crisp detail ;). I've had little success myself at eliminating it in-post, at least with the commonly used AVS de-halo filters. If your PDX10 allows you to manually adjust the picture sharpness, you might find some benefit in turning it down a notch or two.

carlmart
16th March 2009, 22:03
David:

These were the only filters I could get to work from your suggestions:


LoadPlugin("C:\video\AviSynth 2.58\plugins\FFT3dGPU.dll")
LoadPlugin("C:\video\AviSynth 2.58\plugins\addgrain.dll")
LoadPlugin("C:\video\AviSynth 2.58\plugins\nnedi.dll")
LoadPlugin("C:\video\AviSynth 2.58\plugins\RSharpen.dll")
import("C:\video\AviSynth 2.58\plugins\LimitedSharpenFaster.avsi")
import("C:\video\AviSynth 2.58\plugins\BlindDeHalo3.avs")

AVISource("C:\pedro\testDV1_a.avi")

converttoyv12(interlaced=true)

#a=last

nnedi(field=0,dh=true).TurnRight().nnedi(field=0,dh=true).TurnLeft()

limitedsharpenfaster()

spline36resize(1280,960)

sharpen(0.5)

spline36resize(1440,1080)

limitedsharpenfaster()

#interleave(last,a.Bob().spline36resize(1440,1080))

return last

separatefields.selectevery(4,0,3).weave


Things that resulted in errors were:

TempGaussMC_Alpha3() (This is obvious, because I can't find it for download)

BlindDeHalo3(rx=3.2,ry=4.5): it's on my script directory. Could make it work.

grainfactory3(g1str=2, g2str=4, g3str=5)
addgrainc(0,2): it's on my script directory.

Thanks,


Carlos

2Bdecided
17th March 2009, 11:23
OK, firstly, you don't need to use "LoadPlugin" for things in your AVIsynth plugin folder - they will auto load. Not sure why (other) people include these useless lines in their scripts.

Secondly, you need to Google for each filter. Just googling AVIsynth and then the filter name usually finds it. Some are .dll files (in zip archives) - put the .dll in your AVIsynth plugins folder. Some are scripts/functions posted as text files or quotes in posts right here on doom9 - save those with the filters filename, with the extension .avsi, in the avisynth plugins folder.

The problem with functions like TempGaussMC_Alpha3 (and the comparable mcbob, which FWIW I think is fractionally grittier (in a good way!) in this case) is that they depend on many many other filters. It's a real pain tracking them down - if you find the appropriate thread on doom9 (again, Google is your friend) you'll probably find a list with download links. If not, Google each name separately.

Before you do all this, you probably want to see what this script achieves - you might not think it's worth it (I'm not sure I do). So I'll try to upload an example somewhere soon.

Cheers,
David.

2Bdecided
17th March 2009, 11:44
Here is frame 98:

http://www.mediafire.com/?sharekey=605ee2b5f85656f5e62ea590dc5e5dbb5d75094fb909faa7b8eada0a1ae8665a

I don't have a GPU, so that's not exactly Blue_MiSfit's script - I used FFT3DFilter instead. Also, I used 1440x1080 on both scripts for easy comparison. For all the differences in the scripts, 90% of the visible difference is due to the dehalo.

Notice how "forgiving" of faults 1280x720 is compared with 1440x1080. 1920x1080 is slightly worse again.


I don't think his hair looks very natural after dehaloing and sharpening. The dehalo line removes the nasty halos, but it also removes far too much real detail (look at the bottom end of the guitar(?) strings where they go over the white part). You can do more or less dehaloing by changing the dehalo parameters - there's a "strength" parameter too - the default is 125.


Ditto what WorBry said - if you can reduce the sharpening in the DV camera, you'll get a much more pleasing result. With less/no AVIsynth dehaloing (and less sharpening), it'll look less like a cartoon / plastic - though that look is somewhat inevitable when upscaling.


If you're stuck with the halos (and I am on my old DV footage - no chance to re-shoot it!) I think it's time to beg one of the gurus here to take another look at dehaloing.

Cheers,
David.

carlmart
17th March 2009, 17:37
OK, firstly, you don't need to use "LoadPlugin" for things in your AVIsynth plugin folder - they will auto load. Not sure why (other) people include these useless lines in their scripts.

You were right. But I did have to include the "import" lines.

Secondly, you need to Google for each filter. Just googling AVIsynth and then the filter name usually finds it. Some are .dll files (in zip archives) - put the .dll in your AVIsynth plugins folder. Some are scripts/functions posted as text files or quotes in posts right here on doom9 - save those with the filters filename, with the extension .avsi, in the avisynth plugins folder.

I'm already doing that, googling to find the filters. When I ask here is because I didn't find it. The extension has to be avs or avsi? I am not quite sure about that. The scripts/functions are all on my plugin directory.

The problem with functions like TempGaussMC_Alpha3 (and the comparable mcbob, which FWIW I think is fractionally grittier (in a good way!) in this case) is that they depend on many many other filters. It's a real pain tracking them down - if you find the appropriate thread on doom9 (again, Google is your friend) you'll probably find a list with download links. If not, Google each name separately.

Will probably have to look further. What does TempGaussMC_Alpha3 do? Can I replace it for some other filter?

carlmart
17th March 2009, 17:49
Here is frame 98:

http://www.mediafire.com/?sharekey=605ee2b5f85656f5e62ea590dc5e5dbb5d75094fb909faa7b8eada0a1ae8665a

I don't have a GPU, so that's not exactly Blue_MiSfit's script - I used FFT3DFilter instead. Also, I used 1440x1080 on both scripts for easy comparison. For all the differences in the scripts, 90% of the visible difference is due to the dehalo.

Notice how "forgiving" of faults 1280x720 is compared with 1440x1080. 1920x1080 is slightly worse again.


I don't think his hair looks very natural after dehaloing and sharpening. The dehalo line removes the nasty halos, but it also removes far too much real detail (look at the bottom end of the guitar(?) strings where they go over the white part). You can do more or less dehaloing by changing the dehalo parameters - there's a "strength" parameter too - the default is 125.


Ditto what WorBry said - if you can reduce the sharpening in the DV camera, you'll get a much more pleasing result. With less/no AVIsynth dehaloing (and less sharpening), it'll look less like a cartoon / plastic - though that look is somewhat inevitable when upscaling.


If you're stuck with the halos (and I am on my old DV footage - no chance to re-shoot it!) I think it's time to beg one of the gurus here to take another look at dehaloing.


Comparing the photos you uploaded, I certainly do not want the halos like on the subject's right arm or on the nose. That you can see more clearly on dv_upscale_Blue_MiSfit_frame98_1440x1080. I am always looking for a film-like look, and the border sharpening is something I never like in video. That doesn't mean I prefer a soft image, as I do not.

What I would like to do now is to be able to output some video file that I can load on VLC and compare it to my original DV file. How can I do that?

2Bdecided
17th March 2009, 18:56
You were right. But I did have to include the "import" lines. ... The extension has to be avs or avsi? I am not quite sure about that. The scripts/functions are all on my plugin directory..avsi files in the plugin folder are autoloaded (no need for import) .avs are not autoloaded.

Will probably have to look further. What does TempGaussMC_Alpha3 do? Can I replace it for some other filter?It's an excellent deinterlacer. You could try mcbob, but it also requires many other filters.

You can try just bob() if you want, but it will look really bad.


Comparing the photos you uploaded, I certainly do not want the halos like on the subject's right arm or on the present. That you can see more clearly on dv_upscale_Blue_MiSfit_frame98_1440x1080. I am always looking for a film-like look, and the border sharpening is something I never like in video.That's what is in your original - BlueMiSfit didn't really make it any worse. It just looks worse when upscaled, because it covers 4 pixels rather than 1!.

What I would like to do now is to be able to output some video file that I can load on VLC and compare it to my original DV file. How can I do that?You can play the avs file directly in, say, mplayer, but I doubt it'll play in real time. So yes, you need to encode to something. There are a million ways - VirtualDub for the formats it supports (anything with a VFW (video for windows) codec), HCenc for MPEG2, MeGUI for MPEG4 (x264, XviD etc) - there are hundreds of options. Even some NLEs take avs files as an input, and encode them to all supported format.

You need to pick a format (that your machine can play!) and then encode to it.

What format do you intend editing with? I don't have a real HDV encoder on this machine, though I have several generic MPEG-2 encoders that will get close.

Cheers,
David.

carlmart
17th March 2009, 19:55
.avsi files in the plugin folder are autoloaded (no need for import) .avs are not autoloaded.

Then I can name them all avsi and that's it?


It's an excellent deinterlacer. You could try mcbob, but it also requires many other filters.

You can try just bob() if you want, but it will look really bad.

Bad I do not want. Better yes. The question now is not try them, but to find them.


That's what is in your original - BlueMiSfit didn't really make it any worse. It just looks worse when upscaled, because it covers 4 pixels rather than 1!.

There's a light border following the upper right arm that is not in the original.

You can play the avs file directly in, say, mplayer, but I doubt it'll play in real time. So yes, you need to encode to something.

Just tried in Mplayer, and no, I couldn't get any real time play.


There are a million ways - VirtualDub for the formats it supports (anything with a VFW (video for windows) codec), HCenc for MPEG2, MeGUI for MPEG4 (x264, XviD etc) - there are hundreds of options. Even some NLEs take avs files as an input, and encode them to all supported format.

Having the NLE process it would be cool. But I don't know if Avid accepts avs files.

For now it would only be a matter of dealing with this test and watch it with VLS, normal and upscaled.


You need to pick a format (that your machine can play!) and then encode to it.

What format do you intend editing with? I don't have a real HDV encoder on this machine, though I have several generic MPEG-2 encoders that will get close.


AFAIK you shouldn't edit in HDV, or at least not let the program process anything, or it will compress things back to HDV.

Blue_MiSfit
18th March 2009, 00:05
You won't get ANYTHING near realtime with tempgaussMC_alpha3 :)

It's one of the best bob-deinterlacers (aka taking 29.97i and converting to 59.94p as part of the upconversion process) available, but it's also quite slow!

I'd expect less than 1fps for rendering your DV footage into HD. Get ready to wait a _long_ time!!!

If TempGaussMC is too slow, you can use my old script, which used YADIFMod+NNEDI, which is pretty good itself.

As far as an output codec, I'd suggest MJPG (you can use FFDShow's VFW MJPG encoder to do this in VirtualDub). A better choice would be DNxHD, as it's a native Avid codec, and is "almost" lossless (very similar to CineForm and ProRes). ffmpeg's recent official .5 release supposedly supports encoding and decoding DNxHD, but I've never tried it :) This may help: http://itbroadcastanddigitalcinema.com/ffmpeg_howto.html#Encoding_VC-3

Also, for finding plugins etc, I usually start on warpenterprises (http://avisynth.org/warpenterprises/) Most stuff here is pretty up to date. TempGaussMC_alpha3 is an avsi script that Didee wrote and is sitting in a thread here somewhere... this project is actually the first time I've tried it, and I was completely blown away by its quality!

Sorry I haven't been in this thread more - work and the rest of my pesky real life has been a real drain lately! I want to help you as much as possible!!

~MiSfit

carlmart
18th March 2009, 01:06
You won't get ANYTHING near realtime with tempgaussMC_alpha3 :)

It's one of the best bob-deinterlacers (aka taking 29.97i and converting to 59.94p as part of the upconversion process) available, but it's also quite slow!

I'd expect less than 1fps for rendering your DV footage into HD. Get ready to wait a _long_ time!!!

That is a rate of 24/1 for each outputted minute! Wow!!!

If TempGaussMC is too slow, you can use my old script, which used YADIFMod+NNEDI, which is pretty good itself.


It should be nice comparing them. But for that I do have to watch them on a larger, higher resolution screen.

In any case I wouldn't have to upscale the whole stuff, as the HDV shots would lead the way in the final editing.

As far as an output codec, I'd suggest MJPG (you can use FFDShow's VFW MJPG encoder to do this in VirtualDub).

That sounds interesting. Will have to find out how to do that. There should be a VD plugin.

A better choice would be DNxHD, as it's a native Avid codec, and is "almost" lossless (very similar to CineForm and ProRes). ffmpeg's recent official .5 release supposedly supports encoding and decoding DNxHD, but I've never tried it :)

This may help: http://itbroadcastanddigitalcinema.com/ffmpeg_howto.html#Encoding_VC-3

Thanks.

Also, for finding plugins etc, I usually start on warpenterprises (http://avisynth.org/warpenterprises/) Most stuff here is pretty up to date. TempGaussMC_alpha3 is an avsi script that Didee wrote and is sitting in a thread here somewhere... this project is actually the first time I've tried it, and I was completely blown away by its quality!

That's why I would like to try it. I even sent a pm to Didee to see if he could help me. I found what I think is the script for that avsi file, but I am not sure if it's right or if there were further corrections for it later on. When I run it I get an error message saying "There's no function named MVAnalise"

Sorry I haven't been in this thread more - work and the rest of my pesky real life has been a real drain lately! I want to help you as much as possible!!

I thought my shallow avisynth knowledge had made you give up on me! :)

carlmart
18th March 2009, 01:12
Today I was trying to get some information to see to what HD format should I got to, and I saw this comment:

" The issues of upconversion relate to image quality. A standard definition image will turn into a standard definition image with more scan lines. Increasing the scan line count will reduce some of the problems associated with our current television system. The image, however, is still short on the high frequency detail that makes a higher resolution image. Also, a standard image with 350,000 pixels upconverted to a two million pixel image will challenge the DTV encoder unnecessarily and degrade the image further at the home DTV receiver. Since the DTV standards allow for broadcast of what is essentially our current television resolution, the image will look better if it is transmitted as SDTV and not upconverted to an artificially high pixel count."

Hopefully we get to do a bit more than artificially high pixel count!... :rolleyes:

Blue_MiSfit
18th March 2009, 02:16
That's why I would like to try it. I even sent a pm to Didee to see if he could help me. I found what I think is the script for that avsi file, but I am not sure if it's right or if there were further corrections for it later on. When I run it I get an error message saying "There's no function named MVAnalise"

Didee gets lots of PMs! He probably can't respond to all or any of them!

The MVAnalyse error is because TempGaussMC requires MVTools, which you can get from avisynth.org.ru. You want MVTools, not MVTools2 :)

The other dependencies (I think) are NNEDI, and MaskTools2, plus RemoveGrain and Repair.

Here's a nice AviSynth plugins package that should get you up and running! Tracking all these down is a total nightmare!
http://www.mediafire.com/?sharekey=47de74c3f78774007f7ec40ada4772a656ab3d7c1775e105c95965eaa7bc68bc

What are your system specs?

~MiSfit

2Bdecided
18th March 2009, 10:58
Today I was trying to get some information to see to what HD format should I got to, and I saw this comment:

" The issues of upconversion relate to image quality. A standard definition image will turn into a standard definition image with more scan lines. Increasing the scan line count will reduce some of the problems associated with our current television system. The image, however, is still short on the high frequency detail that makes a higher resolution image. Also, a standard image with 350,000 pixels upconverted to a two million pixel image will challenge the DTV encoder unnecessarily and degrade the image further at the home DTV receiver. Since the DTV standards allow for broadcast of what is essentially our current television resolution, the image will look better if it is transmitted as SDTV and not upconverted to an artificially high pixel count."

Hopefully we get to do a bit more than artificially high pixel count!... :rolleyes:But that's just saying that you should broadcast SD as SD. Fair enough for a full SD programme - but not practical for a programme that intercuts SD and HD.

Also common experience is that good SD>HD upconversion by the broadcasters (never mind these 1/25th real-time scripts!) is far far far better than anything a STB or TV can achieve - so what that quote says is simply wrong: properly upconverted SD>HD, broadcast in HD, will look far better than the same content broadcast in SD.


btw, TGMCa3 is here:
http://forum.doom9.org/showthread.php?p=1138514#post1138514

There's also beta1 and beta2. I don't think they're quite as good as alpha3 for my (soft HDV) footage, though they are sharper (if the original is sharp) and faster (with default settings), so may be more useful to you on your footage.

I can't find a post listing all the filters you need. It's a case of running it, reading the error message, and googling for what it says you're missing.

Cheers,
David.

P.S. I don't think Yadifmod with NNEDI is very good when things with fine details are moving...
http://www.hochladen.info/image/XZuDK47Z5dogwLs/tv-stars-promis-urlaub-party-sport-auto/

carlmart
18th March 2009, 21:26
Didee gets lots of PMs! He probably can't respond to all or any of them!

I guessed that.

The MVAnalyse error is because TempGaussMC requires MVTools, which you can get from avisynth.org.ru. You want MVTools, not MVTools2 :)

Corrected and working! :)

The other dependencies (I think) are NNEDI, and MaskTools2, plus RemoveGrain and Repair.

Your original script is working alright. Now I need a way to output it to some HD format so I can watch them and compare them.

Here's a nice AviSynth plugins package that should get you up and running! Tracking all these down is a total nightmare!
http://www.mediafire.com/?sharekey=47de74c3f78774007f7ec40ada4772a656ab3d7c1775e105c95965eaa7bc68bc


Wow, thanks. It's already downloaded.

What are your system specs?


Not that fast, but was fast enough for what I needed. Gigabyte EP31-DS3L, Core2 E6420 and 2GB Patriot. No OC.

carlmart
18th March 2009, 21:39
But that's just saying that you should broadcast SD as SD. Fair enough for a full SD programme - but not practical for a programme that intercuts SD and HD.

I think the comments might have been a bit old, when converters were not that good, or when NLEs did not intercut SD and HD stuff on the same timeline.

Also common experience is that good SD>HD upconversion by the broadcasters (never mind these 1/25th real-time scripts!) is far far far better than anything a STB or TV can achieve - so what that quote says is simply wrong: properly upconverted SD>HD, broadcast in HD, will look far better than the same content broadcast in SD.

My idea that things could be better for SD stuff came from seeing what a DVD upscaler could achieve. If in fact that is true, and not just pushing up contrast and color saturation, then there might be something there. My query here is to see how far we can get and get away with it.


btw, TGMCa3 is here:
http://forum.doom9.org/showthread.php?p=1138514#post1138514

Thanks. That had been the one I had downloaded as text and made a script with. There was not an actual zip file with it. But fortunately I am getting smarter. Well, as someone would say: you can not go anywhere but up from where I am. ;)

There's also beta1 and beta2. I don't think they're quite as good as alpha3 for my (soft HDV) footage, though they are sharper (if the original is sharp) and faster (with default settings), so may be more useful to you on your footage.

Let's got find them. Setup would be the same as Alpha's?

I can't find a post listing all the filters you need. It's a case of running it, reading the error message, and googling for what it says you're missing.

Yes, I'm getting the catch of it. Next will be how to handle the settings, which should be much more difficult.


P.S. I don't think Yadifmod with NNEDI is very good when things with fine details are moving...
http://www.hochladen.info/image/XZuDK47Z5dogwLs/tv-stars-promis-urlaub-party-sport-auto/

Which one is better in your opinion?

carlmart
18th March 2009, 21:47
As people dealing with 1/4" and 1/3" DV cameras, many of you are certainly aware of the main problem we face with: huge depth of field.

In our test shot, even if I was 6 feet or more from the bush behind the subject and I was relatively close to the man, the leaves are too much in focus.

Sometime I will have to see if there are ways to deal with that in post-production, as during shooting you can only put the camera further away or use a DOF adapter, which swallows 2 or 3 stops.

Has anyone tried an effective method to cheat on that?

Blue_MiSfit
18th March 2009, 23:08
I certainly haven't - and fully understand your problem :(

Maybe when you shoot, manually focus so your subject is at the extreme end of your focal plane? I dunno... :)

Did that plugin package get you up and running with TempGaussMC?

~MiSfit

carlmart
18th March 2009, 23:41
I certainly haven't - and fully understand your problem :(

Maybe when you shoot, manually focus so your subject is at the extreme end of your focal plane? I dunno... :)

Not really. The question is not manually focusing or not, but that because the CCDs are so small, the DOF is too large. When you come from film, as I do, this problem is quite blatant and difficult to live with. You are used to things going in & out of focus almost millimetrically, but with these pro and semi-pro cameras this is impossible. You have to go up 1/2" or 3/4" CCDs to get closer to that, or use a DOF adapter, using photo or film lenses.

You can move away from your subject, but sometimes this is physically impossible.

Did that plugin package get you up and running with TempGaussMC?

Yes, thank you.

Now I have to encode this video onto some HD package I can view with VLC.

Blue_MiSfit
19th March 2009, 01:51
Right. I'd suggest doing the following:

1) Install ffdshow-tryouts, and VirtualDub.
2) Drop the AVS into VirtualDub, and do the following:
3) Video -> Select "Fast Recompress"
4) Video -> Compression -> Select ffdshow Video Codec and click configure
5) Click on "encoder" tab, switch "encoder" type to MJPEG, and switch "mode" to one pass - quality. Set the "quality" slider to ~ 90-100%,.
6) File -> Save as AVI to wherever you want
7) Go get a cup of coffee, because rendering a 480i-1080i clip with TempGaussMC will be brutally slow, as we discussed :)
8) The resulting AVI file should play back in real-time on VLC or any other media player

You should also be able to drop this AVI into your Avid, but that may have mixed results. For example, we may need to store the MJPG video in a MOV container for Avid to stay happy! Thankfully, that's easy enough.

Let us know how it goes :)

~MiSfit

2Bdecided
19th March 2009, 11:10
There's a light border following the upper right arm that is not in the original.There's certainly haloing in the original.

This is the original with a simple (soft) bob and bicubic (i.e. soft) resizing. No edge enhancement, no added ringing, nothing - and the halo is still visible:

http://www.mediafire.com/file/tunmdc5lmj3/dv_upscale_bob_bicubicresize_frame98.jpg


If you don't trust the bob deinterlacer, take a look at the original full frame (some people call this "weaving"), simply upscaled using bicubicresize, without any enhancement:

http://www.mediafire.com/file/wzm10hjydtm/dv_upscale_weave_bicubicresize_frame49.jpg


The original certainly has halos!

Cheers,
David.

2Bdecided
19th March 2009, 11:16
because the CCDs are so small, the DOF is too large.Apart from the options you've already mentioned, you're stuck with it. You can mask the foreground/background and add a blur plug-in - there's even a variableblur script for AVIsynth - but creating the mask is painful. It's possible with still photos, but with video it's more time and trouble than it's worth.

The problem with upscaling and sharpening is that even if your background was a little out-of-focus, all the sharpening will bring it right back into focus. Look at the leaves behind the man (left of screen) - on my upscaled version (http://www.mediafire.com/file/wmmymkknv3t/dv_upscale_2Bdecided_frame98_1280x720_sharp.jpg), they look sharper than the man himself, whereas on the original they were slightly soft. So this processing is making the problem worse.

Some DSLRs shoot video - great for shallow DOF - plenty of other problems though!

As a "film guy" I'm surprised you're shooting 60i. I like it, but most people prefer 24p, and 24p would be slightly easier (and much faster) to upscale, since there would be no need to deinterlace.

Cheers,
David.

smok3
19th March 2009, 14:03
depth of field depends on the object distance, the focal length, the F-number, and on the perceptivity of the observer
http://toothwalker.org/optics/dof.html

about object distance: the closer you are to the subject, the lesser is DOF.

besides using some DSLR, there are adapters like http://www.letusdirect.com/ , but they bring in pack of problems as well (last time i edited material shot with one of those, they forget to turn on the rotating, so i got some necessary shots that looked like sort of a poster...)

carlmart
19th March 2009, 14:36
There's certainly haloing in the original.

That's quite likely. In general haloing, if we are speaking of the same thing, is related to optical resolution. Anti-reflective treatment in the lens elements tend to cure that. This camera lens is just average.

This is the original with a simple (soft) bob and bicubic (i.e. soft) resizing. No edge enhancement, no added ringing, nothing - and the halo is still visible:

http://www.mediafire.com/file/tunmdc5lmj3/dv_upscale_bob_bicubicresize_frame98.jpg


If you don't trust the bob deinterlacer, take a look at the original full frame (some people call this "weaving"), simply upscaled using bicubicresize, without any enhancement:

http://www.mediafire.com/file/wzm10hjydtm/dv_upscale_weave_bicubicresize_frame49.jpg


The original certainly has halos!


Interesting viewing. Thanks, David.

Many of these discussions will get a better result when I watch them as video.

carlmart
19th March 2009, 14:42
http://toothwalker.org/optics/dof.html

about object distance: the closer you are to the subject, the lesser is DOF.

As long as you are using a longer focal length. In my case I was handling both cameras on their tripods, and I couldn't be too far away from the subject. So I had to use wider settings, which increase DOF.


besides using some DSLR, there are adapters like http://www.letusdirect.com/ , but they bring in pack of problems as well (last time i edited material shot with one of those, they forget to turn on the rotating, so i got some necessary shots that looked like sort of a poster...)

Those are what I call DOF adapters. You certainly need to have a rotating mirror rolling all the time, which is what eats up F stops. They are alright for working outdoors or with lots of light.

carlmart
19th March 2009, 14:47
Right. I'd suggest doing the following:

1) Install ffdshow-tryouts, and VirtualDub.
2) Drop the AVS into VirtualDub, and do the following:
3) Video -> Select "Fast Recompress"
4) Video -> Compression -> Select ffdshow Video Codec and click configure
5) Click on "encoder" tab, switch "encoder" type to MJPEG, and switch "mode" to one pass - quality. Set the "quality" slider to ~ 90-100%,.
6) File -> Save as AVI to wherever you want
7) Go get a cup of coffee, because rendering a 480i-1080i clip with TempGaussMC will be brutally slow, as we discussed :)
8) The resulting AVI file should play back in real-time on VLC or any other media player

It's REALLY taking its time to process it. When it first started it said it was going to take 2 hours or so. Now, after 3.38 hours it says it will take more than 5 HOURS (!!!) to process it.

It certainly is not something practical to do. Better to try something else.

You should also be able to drop this AVI into your Avid, but that may have mixed results. For example, we may need to store the MJPG video in a MOV container for Avid to stay happy! Thankfully, that's easy enough.


That's something to worry later on.

carlmart
19th March 2009, 14:55
Still climbing in time left. Almost a 1/1 seconds rate or even more.

I think I will cut the processing.

carlmart
19th March 2009, 15:03
Yes, the estimated rate is climbing at TWICE the rate of the elapsed time. It will take forever to process it. I will cut it.

2Bdecided
19th March 2009, 15:49
You can't do the whole file at that rate! Start by doing 1-2 seconds to make sure it's really working.

You can do this easily - just add "trim(0,60)" to the end of the file and AVIsynth will only process the first 60 output frames.

Cheers,
David.

Blue_MiSfit
19th March 2009, 20:45
:D TempGaussMC is definitely slow.

I'd try YADIFMod + NNEDI, as I suggested in my original script. That should be significantly faster.

What are your PC's specs?

~MiSfit

2Bdecided
20th March 2009, 13:15
With tgmc_a3 in my script, I get 0.25fps on my (old!) PC. Your 624/2 frames took 40 minutes.

I re-sized to 1280x720 and encoded to MPEG-1 progressive 1:1 PAR (should play on anything - try VLC) and uploaded the 13MB result here:
http://www.mediafire.com/?lznmklzwn1l

I'm amazed how good it looks! It's not "HD sharp", but it doesn't scream "upscaled SD" either.


YADIFMod + NNEDI gives pretty good results too - it's not as temporally stable as tgmc_a3, or as sharp - but it's much quicker and still looks nice. I'll upload it later.

Cheers,
David.

smok3
20th March 2009, 13:19
As long as you are using a longer focal length. In my case I was handling both cameras on their tripods, and I couldn't be too far away from the subject. So I had to use wider settings, which increase DOF.
the point is, when using el-cheapo tech (like i do) you just can't do everything...


Those are what I call DOF adapters. You certainly need to have a rotating mirror rolling all the time, which is what eats up F stops. They are alright for working outdoors or with lots of light.
are you sure? :)

carlmart
20th March 2009, 14:40
You can't do the whole file at that rate! Start by doing 1-2 seconds to make sure it's really working.

You can do this easily - just add "trim(0,60)" to the end of the file and AVIsynth will only process the first 60 output frames.


I think not. Even if it would end up beautifully, it would be absolutely impractical for this job when I get to do edit it all.

carlmart
20th March 2009, 14:43
:D TempGaussMC is definitely slow.


Yes, it is. :(


I'd try YADIFMod + NNEDI, as I suggested in my original script. That should be significantly faster.

Which would be your original script? The first one you put here? There was a long one and a shorter one.


What are your PC's specs?

I mentioned them. Gigabyte P31 mobo + Core2 E6420 + 2Gb Patriot mem. No OC.

carlmart
20th March 2009, 14:47
the point is, when using el-cheapo tech (like i do) you just can't do everything...

Certainly not.



are you sure? :)

Sure about what? That they eat up 2 or more F stops? Yes, I am.

The Z1 camera, where I would use it, is not very good in low light and it suffers when you increase gain.

2Bdecided
20th March 2009, 15:46
I've re-done my script with NNEDI Yadif now. It was only twice as fast on my PC (0.5fps NNEDI Yadif vs 0.25fps tgmca3).

Here are some 1280x720p60 MPEG-1 videos:

NNEDI Yadif:
http://www.mediafire.com/?4oaxzybtvwz

tgmca3:
http://www.mediafire.com/?lznmklzwn1l

If only my own SD DV footage looked so good upscaled! I wouldn't mind the one hour of footage = 2 or 4 days processing. I'm not usually that quick at editing anyway(!), and it can run unattended for a week on a spare PC.

EDIT: the other thing to note is that these are progressive (but lower resolution). With 1920x1080i60, I think some problems would be increased, while the interlacing would hide some of the differences. I don't have a 1920x1080 display so can't look.

Cheers,
David.

carlmart
20th March 2009, 16:47
I've re-done my script with NNEDI Yadif now. It was only twice as fast on my PC (0.5fps NNEDI Yadif vs 0.25fps tgmca3).

What's your setup?


Here are some 1280x720p60 MPEG-1 videos:

NNEDI Yadif:
http://www.mediafire.com/?4oaxzybtvwz

tgmca3:
http://www.mediafire.com/?lznmklzwn1l

They look great!

If only my own SD DV footage looked so good upscaled! I wouldn't mind the one hour of footage = 2 or 4 days processing. I'm not usually that quick at editing anyway(!), and it can run unattended for a week on a spare PC.

I think you're right. But I don't know why on mine it seemed to start fine at first and climbed up so much later on.

EDIT: the other thing to note is that these are progressive (but lower resolution). With 1920x1080i60, I think some problems would be increased, while the interlacing would hide some of the differences. I don't have a 1920x1080 display so can't look.

Neither do I. But that would certainly be the proof by fire.


Carlos

2Bdecided
20th March 2009, 18:11
What's your setup?P4 2.8GHz.

Cheers,
David.

Blue_MiSfit
20th March 2009, 20:13
@carlmart:

Try this:


AVIsource("Clip.avi") #Let's assume NTSC true anamorphic 16x9 DV, decoded via Cedocida into YUY2 4:2:2

#First, we need to bob-deinterlace. My usual standard is YADIFmod, but there are lots of options
EDI=NNEDI(field=-2)
YADIFmod(mode=1, edeint=edi)

#Now, we're at 720x480p60, hopefully aliasing free!
NNEDI(field=0, dh=true).turnright.NNEDI(field=0, dh=true).turnleft

#Now we're at 1440x960p60, hopefully looking reasonably good!
Spline36resize(1920,1080)

#Now we're at 1920x1080p60. Now would be a good time to start cleaning things up

#Start with fft3dfilter or fft3dgpu in chroma-only mode. DV usually has a lot of chroma noise, so I'd start with moderate settings, and work up as necessary
fft3dfilter(plane=3, sigma=1, sigma2=2, sigma3=2, sigma4=1)

#Now a generic MDegrain2. There's lots of options here as well (MC_Spuds, and other MVDegrain wrappers)
super = MSuper(pel=2, sharp=1)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)

#Now we should be pretty nice and clean! Let's do some sharpening. Here's a basic LSFMod
LSFMod(Smode=5)

#And finally, let's add some grain!
GrainFactory3(g1str=5, g2str=7, g3str=10)

#And to re-interlace everything:
Separatefields.SelectEvery(4,0,3).Weave


That should run considerably faster than TempGaussMC! If it's still impractically slow, you can comment out the NNEDI resizing step:

#Now, we're at 720x480p60, hopefully aliasing free!
#But oh no! I'm too slow!!!
#NNEDI(field=0, dh=true).turnright.NNEDI(field=0, dh=true).turnleft


This should speed things along considerably, and let spline36resize handle all the upscaling work.

Also, what kind of video card does your PC have? If it's something kinda beefy, you can swap out fft3dfilter for fft3dgpu, which will offload another big chunk of work.

~MiSfit

carlmart
20th March 2009, 23:20
Blue_MiSfit,


Right now I am processing an old film, which should take about two hours more.
i
When I get back I will try your remarkable script on my shot. Thanks a lot.

Now I will have to find a way to view it on a higher resolution screen, and my plasma can't get further 720p. It downscales if you feed it something higher. But it may give me an idea on how things will look.

The next step would be to actually intercut it with the HDV shot and see how it ends up.

carlmart
20th March 2009, 23:25
Distortions on the captured HDV shot.

Have you noticed the horizontal bands on the subject's hands when he moves them?

Where did that come from?

carlmart
22nd March 2009, 19:47
Even if my following question is not directly related to this particular job, in a way it has some points in common.

As I have been dealing with doing new copies of some of my DVDs, a few of them being old or not coming from too new film originals or not so good film transfer, perhaps sharpening or contrast enhancing might improve them.

What are the best sharpeners to try? On some tests I made the sharpening ended up looking phony, increasing borders or noise in an artificial way. That's why I mentioned contrast enhancing as a way to tame sharpened things to look more natural.

Am I right or completely off the mark?

BTW: these past days I've been booting from my other HDD on this computer, and as my avisynth installation is a bit different from my other HDD, I couldn't yet try the latest script. Should do it tomorrow.

2Bdecided
23rd March 2009, 11:12
Have you noticed the horizontal bands on the subject's hands when he moves them?That's interlacing!

You need to watch using a player that deinterlaces. VLC has various options - try bob or linear.

Cheers,
David.

2Bdecided
23rd March 2009, 11:14
@Blue_MiSfit,

Have you tried this on his footage? You're suggesting noise reduction for an almost noise-free source (which you add grain to anyway!), yet leaving the hideous halos in place.

Cheers,
David.

carlmart
23rd March 2009, 12:55
That's interlacing!

You need to watch using a player that deinterlaces. VLC has various options - try bob or linear.

It got better, but not perfect. There's still some flickering.

That's probably due to the Z1's long GOP.

carlmart
23rd March 2009, 12:58
P4 2.8GHz.

Would things improve for processing if I get to 2.8GHz or more with OC?

Mine is set standard to 2.133GHz. It's almost 1/3 less than yours.

2Bdecided
23rd March 2009, 13:12
Bob-deinterlacing does flicker on fine details, especially horizontal lines. It shouldn't be that bad on a 720 display.

A single core 2.8GHz wasn't meant as a recommendation. ;) There are ways of multi-threading AVIsynth scripts and/or running them on multiple cores - I just haven't looked at them myself, so can't advise.

Cheers,
David.

carlmart
23rd March 2009, 14:34
Bob-deinterlacing does flicker on fine details, especially horizontal lines. It shouldn't be that bad on a 720 display.

My concern is how will the HDV stuff look on the final HD output. My intention would be, if possible, to edit this job as an HD one and then downconvert to SD for some copies. That way the doc will be prepared for HD broadcasting.

A single core 2.8GHz wasn't meant as a recommendation. ;) There are ways of multi-threading AVIsynth scripts and/or running them on multiple cores - I just haven't looked at them myself, so can't advise.

Oh, I didn't take your comment as a recommendation. But it got me thinking that perhaps I should consider this might be the moment to go into OC if I am going to process stuff with avisynth.

How do you multi-thread scripts or run them on multiple cores? I know it's done because the first program I used to process avisynth scripts, AVStoDVD, does enable multithread encoding.

2Bdecided
23rd March 2009, 14:48
My concern is how will the HDV stuff look on the final HD output.That's a very good question, but it has little to do with interlacing. The interlacing isn't a "problem" - lots of HD content is interlaced.

Cheers,
David.

Blue_MiSfit
23rd March 2009, 22:52
How do you multi-thread scripts or run them on multiple cores?


It's a big can of worms...

MT AviSynth works, and is fantastic. But, you have to baby it around. Some filters work best with MT(), and some work best with SetMTMode(). It's definitely a hassle.

Download MT avisynth, and take a look at the docs..

Now another thought.. You might consider doing your whole project in 720p. This offers a couple of significant advantages:

1) 720p means you can do 59.94fps progressive. That means no deinterlacing for the end-user, which means you don't have to worry about their TV / media player doing a crappy job. Plus, you can use a good deinterlacer like YADIFMod ahead of time.
2) It's a bit smaller, and quicker to work with
3) It looks just as good as 1080i/1080p in many cases. I haven't actually tried bobbing your HDV sample and downsampling to 720p, but I doubt much would be lost.
4) You can use your TV to do 1:1 quality comparisons!

:)

~MiSfit

2Bdecided
24th March 2009, 12:07
I like 1280x720p for those reasons. It's obviously a get resolution for PC use and a great master for web use. I don't think I lose anything from my 1440x1080i in the conversion, but my camera is a toy compared to yours!

However, all HD broadcasts in the UK are 1080i.

Cheers,
David.

carlmart
24th March 2009, 12:55
The main question is not my present monitoring setup, limited to 720p, but what will broadcasters demand in the future when they look for HD stuff. Will it be 1080i?

2Bdecided
24th March 2009, 15:35
The BBC HD channel in the UK does not accept HDV originated content as HD. I think most American channels do though.

Widest appeal is 1920x1080p24. That's not nicely achievable from 1440x1080i60.

If I were you, I would edit at 1440x1080i60.

If you have broadcast in mind, you should approach a broadcaster before you start, to check what their specific requirements are.

I think you also need to consider your video levels carefully. Your HDV footage includes levels way over legal video white. If you use this as-is, and the broadcaster doesn't reject it outright (many will), they'll probably run it through a "legal video levels" filter, which will do this...

Full range (scaled for PC viewing)
http://www.mediafire.com/imageview.php?quickkey=cgewliqyzdi&thumb=4

Legal range (scaled the same as above for PC viewing)
http://www.mediafire.com/imageview.php?quickkey=y1mnonidmmy&thumb=4

Note how the legal range has ruined the flesh tones.

Obviously you can fix this in your NLE, if it decodes HDV with the super-white range intact.

Cheers,
David.

carlmart
24th March 2009, 16:17
Thanks, your considerations on broadcast problems are very good.

About broadcasters requirements, I will have to find out what people around here accept.

I did google a little on HDV specs, and found this about broadcasters specs:


Use of HDV in broadcast television

HDV is accepted with varying restrictions for broadcast TV use. It has been used for shows like "Deadliest Catch" and "Mythbusters", and was used in the TV series "JAG" for scenes where larger HD cameras would have been impractical. The BBC currently considers HDV a "non-broadcast domestic HD format," but accepts HDV footage for up to 25% of HD programming content with advance approval.

The preferred delivery formats for Discovery HD Theater are HD-D5 and HDCAM. HDV source content is accepted if it is limited to 15% of a whole program and is shot with a 1080-line camera. Producers wishing to use HDV are required to submit an approved postproduction path outlining their handling of the footage in the editing process. However, the main Discovery Channel's HD simulcast has fewer or no guidelines and accepts a mix of XDCAM HD, HDV and AVCHD for the length of a program.


So maybe I am not quite there yet or not sure on what you can really do to produce low budgets docs wholy shot with HDV. That is how to get up to HD legit values and get away with it.

2Bdecided
24th March 2009, 18:24
The BBC actually count HDV as SD for the purposes of BBC HD - you're allowed up to 25% SD in an HD programme, if there's a very good reason for it.

It's difficult to "get away with it" - HDV simply doesn't have the resolution of HDCAM-SR (the emerging format over here) and, being quite compressed to start with, doesn't re-compress for broadcast as well as the less compressed professional formats.

Interestingly, it's used a lot for SD over here, as a nicer (and more flexible) source for SD documentaries than most SD cameras.

Cheers,
David.

WorBry
24th March 2009, 20:49
I must say, following this thread has (sort of) rekindled my interest in SD > HD upscaling. Playing around with 2BDecided and Blue_Misfits scripts, I'm actually getting quite good results with my PAL DV (anamorphic) home videos, at least with the better quality material.

Two queries arise:

David, I see that in your script you down-size (length-wise) the NNEDI-upscaled (1440 x 960) frame to 1280 x 960, before upsizing again to 1440 x 1080.



AVISource("testDV1_a.avi",pixel_type="yuy2")

converttoyv12(interlaced=true)

#a=last

TempGaussMC_Alpha3()

nnedi(field=0,dh=true).TurnRight().nnedi(field=0,dh=true).TurnLeft()

BlindDeHalo3(rx=3.2,ry=4.5)
limitedsharpenfaster()

spline36resize(1280,960)

sharpen(0.5)

grainfactory3(g1str=2, g2str=4, g3str=5)
addgrainc(0,2)

spline36resize(1440,1080)

limitedsharpenfaster()

#interleave(last,a.Bob().spline36resize(1440,1080))

return last

separatefields.selectevery(4,0,3).weave



I'm sure there is a good reason for doing so, but could you explain?

Secondly, of the various upscaling scripts I've come across, some folks denoise before upsizing, whilst others do so after. What are the relative merits, aside from processing speed?

Cheers.

carlmart
24th March 2009, 21:25
The BBC actually count HDV as SD for the purposes of BBC HD - you're allowed up to 25% SD in an HD programme, if there's a very good reason for it.

In any case that's BBC's requirements, which I will never need to fulfill.

We will have to see what others, particularly US related distribution circles, demand for HD.

It's difficult to "get away with it" - HDV simply doesn't have the resolution of HDCAM-SR (the emerging format over here) and, being quite compressed to start with, doesn't re-compress for broadcast as well as the less compressed professional formats.

What I'm considering is never to recompress to HDV again, but to go up a higher grade HD, using software or hardware upscaling. You can use DNxHD to export from Avid, and the original long-GOP files should be filled in somehow. That's what I mean by get away with it.

But that's something some steps away from what we are doing now, which is upscaling DV. Though of course we need to know to what we will be upscaling.

Interestingly, it's used a lot for SD over here, as a nicer (and more flexible) source for SD documentaries than most SD cameras.

Yes, it's very cool. Pity something which was interesting in the Z1, the PAL/NTSC capability, was taken away in further models. I don't quite know how it's that in the new "Cinealta" small cameras, like EX1 and EX3.

smok3
24th March 2009, 21:40
EX are just slightly better than HDV, BBC would probably still count those as SD.

carlmart
24th March 2009, 22:22
EX are just slightly better than HDV, BBC would probably still count those as SD.

Fortunately the world is not rotating around BBC!

2Bdecided
25th March 2009, 12:51
I'm sure there is a good reason for doing so, but could you explain?It's probably not a good reason, and they're probably not the best numbers - but what I've found is that you can only try faking resolution using clever trick so far, before the tricks themselves become visible, and simple (good old fashioned slightly blurred) resizing would be preferable.

So I prefer to use NNEDI up to a resolution where it doesn't fall apart (which usually means downscaling slightly after NNEDI to hide the faults), and then simply upscale with spline36resize from there.

The same goes for adding grain. If you have an SD source, and you add HD grain, I think it just looks like HD grain on an SD source(!) - i.e. it doesn't help much at all. Whereas if you have an SD source, and there's a resolution somewhere between SD and HD where it still looks kind of believable, then add the grain at that intermediate resolution, and then blow it up to HD. To my eyes, this makes the grain more convincing, so it actually does the trick of increasing the perceived resolution.

FWIW I find it's much easier to make 1280x720 look convincing than 1920x1080. That said, deinterlaced 1440x1080i50 HDV doesn't always look entirely convincing at 1920x1080p50 either (not that it matters - I can't watch that anyway!).

Secondly, of the various upscaling scripts I've come across, some folks denoise before upsizing, whilst others do so after. What are the relative merits, aside from processing speed?In other contexts, I've found mvdegrain and similar can sometimes average out some temporal instability and weirdness from NNEDI. So there's an argument for doing it after upsizing. The (weak) argument against is that most scripts / functions "expect" a certain kind/scale of noise, and they don't see it in upscaled video. The strong argument against is the time it takes!


I'm finding some of my old DV footage shot in bright daylight upscales OK, but the indoor stuff is just horrible. It looks horrible in SD, so there's not much hope :(.

Cheers,
David.

carlmart
25th March 2009, 14:31
I'm finding some of my old DV footage shot in bright daylight upscales OK, but the indoor stuff is just horrible. It looks horrible in SD, so there's not much hope :(.


When I started working in video, in U-Matic times and then Betacam, I found it very much related to 16mm film. The grain was a problem and telltaled it was 16 when you blew it to 35mm film.

Things got better when you used 16mm fine grain film, which was very slow and needed lots of light.

I think DV, and HDV much more, can do great if properly lit. That is you need to avoid low exposure situations.

Things work better for DV if using better cameras, like Sony's PD170, which is great in low light. But you still have to be careful with exposure range, like using graduated ND filters to avoid highlights.

If you work between those limits results can be impressive.

carlmart
26th March 2009, 18:07
Today I switched back from my other HDD, where I don't quite know why I can process avisynth better.

Then I used the latest script Blue_MiSfit had suggested, with NNEDI instead of TempGaussMC_Alpha3(), to process my DV sample.

What did I get this time:

1) Time was much more reasonable: about two hours for 10 seconds.

2) The resulting file plays in VLC, but with that very same interlacing horizontal distortion I had on my HDV sample. Only this time I can't setup VLC to cure that. If I choose bob or linear I get no image. So there seems to be some other thing I need to solve.

carlmart
26th March 2009, 21:55
OK. Following the advice of a friend of mine, who works on a rather large production company, the target should be 1440x1080i.

Apparently from there you can get 1920 from Avid to an SDI output.

That I wouldn't be able to do on my facilities, of course, but I could take it elsewhere and do the export to HDCam, which is what's being used for now.

My intention is to assemble my timeline so I can export to SD now and to HD later on, editing all as HDV.

Blue_MiSfit
27th March 2009, 19:26
carlmart:

Can you post a small sample of this MJPG encode you created? VLC's bob deinterlace filter should output 60p correctly and have no residual combing.

I want to take a look :)

~MiSfit

2Bdecided
27th March 2009, 21:13
He didn't say he had combing - he said he had no image!

That's quite common when changing deinterlacing settings in VLC (though I see it more with MPEG-4 variants) - it can also cause it to pop out of full screen mode, leaving the video overlay buried under the desktop.

While the deinterlace settings always cause it to deinterlace, I've seen it get the field order wrong sometimes.

Also, at least by default, if VLC can't keep up, it often chokes. Enabling bob deinterlacing effectively doubles the frame rate, so can cause it to choke. Not on a less-than-ten-year-old machine with HD MPEG-2 though, and you'd think MJPEG was even easier to decode.

Cheers,
David.

Blue_MiSfit
27th March 2009, 22:13
Oh! :)

At any rate, if watching on VLC isn't working out, perhaps you can watch on Media Player Classic, with ffdshow forcing hardware bob-deinterlacing via the renderer?

~MiSfit

carlmart
27th March 2009, 22:52
carlmart:

Can you post a small sample of this MJPG encode you created? VLC's bob deinterlace filter should output 60p correctly and have no residual combing.


Of course. Here it is:

http://www.mediafire.com/?sharekey=baad3af1c8fb5a28d6baebe61b361f7ce04e75f6e8ebb871

It's a 1440x1080 sample.

carlmart
27th March 2009, 22:55
At any rate, if watching on VLC isn't working out, perhaps you can watch on Media Player Classic, with ffdshow forcing hardware bob-deinterlacing via the renderer?


Got no image in MPC either, not even interlaced.

carlmart
28th March 2009, 03:44
Today I had to switch back to my other HDD, booting from it, and now I can watch my sample in VLC alright, correcting the deinterlace.

It looks quite good to me, even if there seems to be a glitch of some kind in the middle of the sample which I don't know what caused it.

A friend of mine processed it in several ways, one of them to full HD, but the file size grew 10 times. He also got it to HDV and uploaded the file to megaupload. I think he used After Effects. Let him tell me what he used and how long it took to process it.

It's a production company, and they use AE to upscale stock shots from their tapes, in order to mix them with other HD stuff.

Blue_MiSfit
28th March 2009, 21:06
Agreed, I think your encoded sample looks great.

Much better than a simple bob and resize.

scharfis_brain
28th March 2009, 21:10
hmm, I cannot Download the File.
MediaFire keeps saying it is invalid...

carlmart
28th March 2009, 22:19
hmm, I cannot Download the File.
MediaFire keeps saying it is invalid...


Can you try it again?

I just did try the download process up to actually saving it, and it went fine. When do you get that message?

carlmart
28th March 2009, 22:22
Agreed, I think your encoded sample looks great.

Much better than a simple bob and resize.

Well, it's all thanks to all of you. :)

About that mid-take glitch I mentioned: did you see it? Where did it come from? The original is fine, as you know.

What do you think might improve by using TempGaussMC_Alpha3() ?

Blue_MiSfit
30th March 2009, 02:03
I'm glad you like it too!

I didn't notice any issues in the encoded 1440x1080 MJPG you posted.

TempGaussMC will just improve the deinterlacing a bit. In my tests, it made the image a bit sharper/cleaner, but it does another round of MDegrain, among other things, so IMO it may not be really necessary. The massive speed hit makes it impractical anyway :)

SmoothLevels(preset="PC2TV") will do a nice job scaling the levels of your HDV clip from full range to TV range. I can't seem to download your HDV sample anymore - could you post another one, so we can come up with a good script for cleaning that up and conforming it to MJPG?

~MiSfit

carlmart
30th March 2009, 11:35
I didn't notice any issues in the encoded 1440x1080 MJPG you posted.

It's strange. Every time I play it there's glitch in the image. Now I've tried it again, looking to see if it's on a specific place, but it's not. But there comes a glitch alright. I wonder what might be it. Can't play it with MPV. What other playing program should I try?

TempGaussMC will just improve the deinterlacing a bit. In my tests, it made the image a bit sharper/cleaner, but it does another round of MDegrain, among other things, so IMO it may not be really necessary. The massive speed hit makes it impractical anyway :)

Yes, it's not practical. It might be interesting trying MT Avisynth, to see if it works and if things get better.

will do a nice job scaling the levels of your HDV clip from full range to TV range.


The script would just be that?

SmoothLevels(preset="PC2TV")


I can't seem to download your HDV sample anymore - could you post another one, so we can come up with a good script for cleaning that up and conforming it to MJPG?

The HDV sample is not there anymore. Mediafire allows just 100MB for a free account, so I had to erase that sample to upload the 1440x1080 one. There's a friend who's still going to download the latter. After he does we can go back to my HDV sample.

Yesterday I was shooting an outdoor presentation from that musician, in a tree sheltered place, and there were a lot of extreme situations, going from sun-lit white shirts to black people in the shadow. So I wonder what could have been done there to cure it, except from using an HMI unit!

In any case, this time I used the zebra in the LCD screen a bit more, manually correcting the exposure until the stripes went away. We'll see how that will look on the screen later on.

The plug in I used in Avid allowed some correction for all that, but I am not sure if they will work with HDV.

This week I plan on shooting most of what's left to shoot, so I can start placing things on the timeline.

2Bdecided
30th March 2009, 12:02
Of course. Here it is:

http://www.mediafire.com/?sharekey=baad3af1c8fb5a28d6baebe61b361f7ce04e75f6e8ebb871

It's a 1440x1080 sample.It plays fine in VLC here, but VirtualDub gives a helpful error message about not being able to decode 4:2:2 M-JPEG with non-mod16 image dimensions. Of course 1080 isn't mod16.

Whether it plays elsewhere depends on whether they have an M-JPEG codec at all, and whether it has this restriction.


You decided to leave the halos in there then? :(

I wouldn't bother with tgmc if you want reasonable speed, but I'd certainly remove the halos (unless you think it does more harm than good).

Cheers,
David.

carlmart
30th March 2009, 13:31
It plays fine in VLC here, but VirtualDub gives a helpful error message about not being able to decode 4:2:2 M-JPEG with non-mod16 image dimensions. Of course 1080 isn't mod16.

Whether it plays elsewhere depends on whether they have an M-JPEG codec at all, and whether it has this restriction.

I usually make such a mess with codecs, that sometimes I don't know what to install. Even if looked for it, I never found a place that would tell you what really to install and what might be conflictive and get you in trouble. I just did install the M-Jpeg codec, but the glitch continues.

You decided to leave the halos in there then? :(

I didn't remember I had! After a few comings and goings I lost track of it.

The reason was that I am getting an error when I include BlindDeHalo3. The message says: "There's no function named "Expand". But the conflict line seems to be here:

limitedsharpenfaster()

Which is after Blinddhalo.

I wouldn't bother with tgmc if you want reasonable speed, but I'd certainly remove the halos (unless you think it does more harm than good).

A very important thing which I will have to learn in avisynth is to identify and name the problems exactly. So let's begin: what is it you call halo that you find to be bad?

2Bdecided
30th March 2009, 13:41
A halo is an over-sharpened edge. The white/black border above the guy's arm is a halo.

lsfmod is a different version of limitedsharpenfaster. You can try without either.

Cheers,
David.

carlmart
30th March 2009, 18:14
A halo is an over-sharpened edge. The white/black border above the guy's arm is a halo.

What I see there, and maybe a larger screen would help me judge that better, is a sort of "enhanced border" that makes it look like "video".

Like you say it's in the transition from dark to light, even if I can see some of that in the left back-hand, over the orange shirt.

How do you say I can improve on that?

lsfmod is a different version of limitedsharpenfaster. You can try without either.

Just take those lines away? But will cure the halo or not enhance it.

Blue_MiSfit
30th March 2009, 19:12
limitedsharpenfaster and lsfmod can sometimes introduce or worsen halos - much like any other sharpening filter.

These filters are pretty advanced, and tend to avoid really ugly halos like a simple unsharp mask, but they can still cause problems. I'm not sure how to fix the halos I saw in your video, particularly with the edge of the musician's shirt.

You can upload to mediafire without an account, and upload all you want :)

I'll play with your script and see if I can multithread any of it.

~MiSfit

2Bdecided
31st March 2009, 11:44
"BlindDeHalo3" removes the halos. It's not achingly slow - the problem is it's not perfect, but it's still worth doing IMO. YMMV!

I didn't suggest removing limitedsharpenfaster to reduce halos - the whole point of using lsf rather than a basic sharpen is to avoid adding halos. I said you could try without, simply to get the script to run. If lsfmod works, use that.

Let's re-cap.

Blue_MiSfit suggested this...
AVIsource("Clip.avi") #Let's assume NTSC true anamorphic 16x9 DV, decoded via Cedocida into YUY2 4:2:2

#First, we need to bob-deinterlace. My usual standard is YADIFmod, but there are lots of options
EDI=NNEDI(field=-2)
YADIFmod(mode=1, edeint=edi)

#Now, we're at 720x480p60, hopefully aliasing free!
NNEDI(field=0, dh=true).turnright.NNEDI(field=0, dh=true).turnleft

#Now we're at 1440x960p60, hopefully looking reasonably good!
Spline36resize(1920,1080)

#Now we're at 1920x1080p60. Now would be a good time to start cleaning things up

#Start with fft3dfilter or fft3dgpu in chroma-only mode. DV usually has a lot of chroma noise, so I'd start with moderate settings, and work up as necessary
fft3dfilter(plane=3, sigma=1, sigma2=2, sigma3=2, sigma4=1)

#Now a generic MDegrain2. There's lots of options here as well (MC_Spuds, and other MVDegrain wrappers)
super = MSuper(pel=2, sharp=1)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)

#Now we should be pretty nice and clean! Let's do some sharpening. Here's a basic LSFMod
LSFMod(Smode=5)

#And finally, let's add some grain!
GrainFactory3(g1str=5, g2str=7, g3str=10)

#And to re-interlace everything:
Separatefields.SelectEvery(4,0,3).Weave

I suggested this:
AVISource("testDV1_a.avi",pixel_type="yuy2")

converttoyv12(interlaced=true)

#a=last

TempGaussMC_Alpha3()

nnedi(field=0,dh=true).TurnRight().nnedi(field=0,dh=true).TurnLeft()

BlindDeHalo3(rx=3.2,ry=4.5)
limitedsharpenfaster()

spline36resize(1280,960)

sharpen(0.5)

grainfactory3(g1str=2, g2str=4, g3str=5)
addgrainc(0,2)

spline36resize(1440,1080)

limitedsharpenfaster()

#interleave(last,a.Bob().spline36resize(1440,1080))

return last

separatefields.selectevery(4,0,3).weave

You found my script too slow. No surprise - tgmc is a glacially slow deinterlacer.

If I were you, I'd try to go back to basics and understand how AVIsynth works. It's trivial to chop and change things in this script to keep only the bits you want, e.g. I think "fast-but-good" is something like this...

AVISource("testDV1_a.avi",pixel_type="yuy2")

#First, we need to bob-deinterlace. My usual standard is YADIFmod, but there are lots of options
EDI=NNEDI(field=-2)
YADIFmod(mode=1, edeint=edi)

converttoyv12(interlaced=false)

# Remove halo issues:
BlindDeHalo3(rx=2.5,ry=3.0,strength=175)

# Re-sharpen the result (hopefully less halos):
LSFMod()

spline36resize(1280,960)

sharpen(0.5)

# Add some grain:
grainfactory3(g1str=5, g2str=5, g3str=5)
addgrainc(0,2)

# Re-size to final output
spline36resize(1440,1080)

# Sharpen a bit more
LSFMod()

#Re-interlace:
separatefields.selectevery(4,0,3).weave

The best way to understand what each line is doing is to comment them all out, and then un-comment then (re-enable them) one-by-one, looking at the output in VirtualDub.

Cheers,
David.

carlmart
31st March 2009, 12:47
Very good sum up on where we are now.

The script that I used for the sample I uploaded was the last one, because on the others there were things I couldn't make it work.

But I will get back to them little by little, just removing the lines that make things too slow, like TempGaussMC. Even that I will try to speed up with MT Avisynth, to see how it's different from the others.

What you say I should do, both to learn and to try things, chopping and adding lines, is what I'm already doing. It's the way I think I should use to learn avisynth: trial and error.

Blue_MiSfit
1st April 2009, 05:23
Indeed :) A good plan!

Do use AvsP if you're not already. It's an AMAZING tool. I don't know how I dealt with the tediousness of VirtualDub before!

~MiSfit

carlmart
1st April 2009, 13:42
Do use AvsP if you're not already. It's an AMAZING tool. I don't know how I dealt with the tediousness of VirtualDub before!


Didn't know it. Now it's downloaded and installed.

Just tried to run one script (you use "Tools > Encode the video", right?).

But it didn't run, claiming there were errors in the script. There seems to be a "Test" function in "Macros", but I don't understand what might wrong on that line. The error seems to be here:

YADIFmod(mode=1, edeint=edi)

The error notice says: "local variable 'x' referenced before assignment (test.py, line 6)".

Can someone translate it for me, please? Why did it run before, on my other HDD, and now it doesn't?

It's strange that I can't seem to run my scripts in this current HDD installation. It is not the one I used for converting the upscaled sample you saw. But I still wonder what might be wrong in this setup that scripts don't run as they should.

I have already re-installed Avisynth from zero, deleting all things that might be conflictive. Then copied the scripts sub-directory from the "working HDD" to this one. What might be wrong?

2Bdecided
1st April 2009, 14:30
obvious: plug-ins.
non-obvious: some related dll being corrupt, wrong version, or missing.

Cheers,
David.

Blue_MiSfit
1st April 2009, 18:24
Just push F5 to preview the script :)

I think you're trying to run one of the built-in Python macros.

~MiSfit

carlmart
1st April 2009, 18:52
Just push F5 to preview the script :)

I am seeing the script alright.

I think you're trying to run one of the built-in Python macros.

I don't have the least idea what a Python macro can be! :)

This the script I am trying to run:


LoadPlugin("C:\video\AviSynth 2.58\plugins\fft3dfilter.dll")
import("c:\video\AviSynth 2.58\plugins\LSFmod.v1.7.avs")
AVISource("C:\pedro\testDV1_a.avi")

EDI=NNEDI(field=-2)
YADIFmod(mode=1, edeint=edi)

NNEDI(field=0, dh=true).turnright.NNEDI(field=0, dh=true).turnleft

Spline36resize(1440,1080)

fft3dfilter(plane=3, sigma=1, sigma2=2, sigma3=2, sigma4=1)

super = MSuper(pel=2, sharp=1)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)

LSFMod(Smode=5)

GrainFactory3(g1str=5, g2str=7, g3str=10)

Separatefields.SelectEvery(4,0,3).Weave

Blue_MiSfit
1st April 2009, 20:26
That should be fine.

AvsP is useful for previewing a script and making adjustments. However, if you want to actually ENCODE the script, you've gotta dust off VirtualDub or some other tool still :)

If your script renders okay in AvsP the script itself should be totally fine.

Another note, I may have asked before, but what kind of video card does your PC have? You might get a nice speed boost from switching to fft3dgpu!

Also, if you have MT Avisynth installed, this should speed things along quite nicely! If you want to get speed up even more, you should look into getting a quad core CPU

LoadPlugin("C:\video\AviSynth 2.58\plugins\fft3dfilter.dll")
import("c:\video\AviSynth 2.58\plugins\LSFmod.v1.7.avs")
AVISource("C:\pedro\testDV1_a.avi")

EDI=NNEDI(field=-2)
YADIFmod(mode=1, edeint=edi)

NNEDI(field=0, dh=true).turnright.NNEDI(field=0, dh=true).turnleft

Spline36resize(1440,1080)

fft3dfilter(plane=3, sigma=1, sigma2=2, sigma3=2, sigma4=1)

MT("""
super = MSuper(pel=2, sharp=1)
backward_vec2 = super.MAnalyse(isb = true, delta = 2, overlap=4)
backward_vec1 = super.MAnalyse(isb = true, delta = 1, overlap=4)
forward_vec1 = super.MAnalyse(isb = false, delta = 1, overlap=4)
forward_vec2 = super.MAnalyse(isb = false, delta = 2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)
""",2) # two threads


LSFMod(Smode=5)

GrainFactory3(g1str=5, g2str=7, g3str=10)

Separatefields.SelectEvery(4,0,3).Weave


The MT snippet comes straight from the MVTools2 manual! I use this frequently and it's quite good!

~MiSfit

carlmart
1st April 2009, 20:42
That should be fine.

AvsP is useful for previewing a script and making adjustments. However, if you want to actually ENCODE the script, you've gotta dust off VirtualDub or some other tool still :)

Then I'm fine as it is. That is I did use VD for encoding the sample.

If your script renders okay in AvsP the script itself should be totally fine.

How do I know if it "renders OK"?

Another note, I may have asked before, but what kind of video card does your PC have? You might get a nice speed boost from switching to fft3dgpu!

My video card is a Nvidia GeForce 7100GS. How do I do that switching to fft3dgpu?

Also, if you have MT Avisynth installed, this should speed things along quite nicely! If you want to get speed up even more, you should look into getting a quad core CPU



I haven't installed MT Avisynth yet. Should I?

From what I've read you have to change several things when writing the script, and I'm learning howto for the non-MT! :D

Gavino
1st April 2009, 22:16
How do I know if it "renders OK"? [in AvsP]
Hit F5 (or Video/Refresh preview) and the first frame of your video should appear. You can then step through it using the arrow keys, or call up an external player to play it. I'm sure once you've tried it, you will never want to do it any other way.

Blue_MiSfit
1st April 2009, 22:53
Indeed. If the display in AvSP looks correct, you're good to go!

You can install MT AviSynth without breaking any non-MT stuff. You just add multithreading when you need it!

Your 7100gs might be weak for fft3dgpu, but I'd try it anyway. Google fft3dgpu and run the installer. Then, replace fft3dfilter... with fft3dgpu... in the script.

I'd try it on some footage with just that - no fancy other stuff and do a bit of a speed comparison, and see which is actually faster.

~miSfit

Gavino
1st April 2009, 23:17
You can install MT AviSynth without breaking any non-MT stuff.
However, note that the 'official' MT Avisynth is based on Avisynth 2.5.7, so is missing features added in 2.5.8 (eg Spline64Resize). There is an experimental MT 2.5.8 available (search the forums), but AFAIK it is still just that (experimental).

carlmart
6th April 2009, 18:49
I have just opened another thread with a different kind of problem: how to improve a 16mm film to video transfer.

http://forum.doom9.org/showthread.php?p=1270484#post1270484

If you can please do have a look and tell me what might be done to improve on that.

carlmart
24th January 2010, 05:10
It's now been almost a year since my last word in this thread, and I am at least arriving to the time to process my DV images.

The problem is I almost forgot how to actually process the script I would be using in order to get my upscale to 1440 x 1080, so I can import that file and put it on my HD timeline.

As I understand it I will load the script in Virtualdub, but I am not too clear on what output format to pick. None seem to be 1440 x 1080.

Blue_MiSfit
24th January 2010, 10:43
Hi Carlos! Long time no chat. Hit me up on IM sometime. I'm not on too often, but I'm around.

Now, regarding your processing!

You've got plenty of options. The question is - what format are you editing in? You want to output your upscale into some format that edits nicely (keyframe only perhaps), and that plays nice with your NLE. I'd suggest MJPG or maybe h.264 with only I frames. Which editor are you using, again?

~MiSfit

carlmart
24th January 2010, 14:46
Hi Carlos! Long time no chat. Hit me up on IM sometime. I'm not on too often, but I'm around.

Hi! Pity I couldn't get in contact with you last October, as I was in SF visiting.


You've got plenty of options. The question is - what format are you editing in? You want to output your upscale into some format that edits nicely (keyframe only perhaps), and that plays nice with your NLE. I'd suggest MJPG or maybe h.264 with only I frames. Which editor are you using, again?


My editor is Avid Media Composer 3.0. Avid recovers any long gop HD images you feed into it and gives you every frame, which of course is essential for editing.

From what I have seen it directly accepts DNxHD 145 MXF and 220 MXF, and also DVCProHD MXF. In the VirtualDub options for compress I have Canopus DVCProHD, but I wonder if that's the same. More tests are due indeed, particularly on the filters I will be using or any artifacts I may have.

One problem I foresee on any format I pick is that it has to get me a 1440x1080 ratio, which for instance is not what is listed here for DNxHD:

http://itbroadcastanddigitalcinema.com/ffmpeg_howto.html#Encoding_VC-3

They are 1920x1080 or 1280x720

carlmart
25th January 2010, 18:46
I made a new XP install just to have a clean slate for Avid.

One thing that caused some conflicts and/or problems several times in the past were the codecs to load.

What codecs should I get for using avisynth and similar converters (VD, etc.)?

Blue_MiSfit
25th January 2010, 22:34
I'd suggest first installing Avid, so you get all its codecs.

Then, you should install the latest ffdshow_tryouts, haali splitter, and whatever AviSynth plugins you need (I'd definitely suggest finding the latest ffms2)!

I'd toss on Media Player Classic - Home Cinema to get yourself a nice little player while you're at it.

Regarding your output format - I think DNxHD might be the best way to do this, since it's relatively light on the CPU, keyframe only, and works directly in Avid.

Note, DVCProHD is not DNxHD - it's a format more similar to DV which is not very good IMO. It's ~ 100mbps and stores at 1280x1080 or 960x720.

I'd suggest using ffmpeg to encode your AVS scripts to DNxHD in an MXF container. Just encode them at 1080p24 or 1080i60. I forget what your sources are :) Avid should intercut this with your HDV footage without any issues, since 1440x1080 in this case displays at 1920x1080.

~MiSfit

carlmart
26th January 2010, 00:18
I'd suggest first installing Avid, so you get all its codecs.

Done.


Then, you should install the latest ffdshow_tryouts, haali splitter, and whatever AviSynth plugins you need (I'd definitely suggest finding the latest ffms2)!

My ffms2 is from july 2009. Is there a newer one?


I'd toss on Media Player Classic - Home Cinema to get yourself a nice little player while you're at it.

Done.


Regarding your output format - I think DNxHD might be the best way to do this, since it's relatively light on the CPU, keyframe only, and works directly in Avid.

OK. Where is that format in ffdshow to pick it from? It seems to be hidden somewhere.


Note, DVCProHD is not DNxHD - it's a format more similar to DV which is not very good IMO. It's ~ 100mbps and stores at 1280x1080 or 960x720.

I don't know that much yet to agree or disagree.


I'd suggest using ffmpeg to encode your AVS scripts to DNxHD in an MXF container. Just encode them at 1080p24 or 1080i60. I forget what your sources are :) Avid should intercut this with your HDV footage without any issues, since 1440x1080 in this case displays at 1920x1080.


I guess that should be available within VD. Right now and on this setup I can't load AvsP and on VD I can't load the script. Get errors on both, so I don't know what's missing. But let me work a bit more until I get things running.

carlmart
26th January 2010, 00:45
OK. Now I could load AvsP and open the script.

Also could open the script in VD but it crashed.

How do you install ffmpeg?

Blue_MiSfit
27th January 2010, 03:56
ffmpeg is just a CLI application. You can download a recent binary from http://ffmpeg.arrozcru.org/builds/ and toss it in your c:\windows\system32 folder.

Now open a command prompt (cmd.exe) and type ffmpeg and then enter. You should get a vomit of text which indicates ffmpeg is installed and functioning.

To actually transcode your AVS to a DNxHD MOV, use a command like this:
(from http://www.itbroadcastanddigitalcinema.com/ffmpeg_howto.html#Encoding_VC-3)
(also assuming you want 1080i60 output at 220mbps)

ffmpeg -i input avs -vcodec dnxhd -b 220Mb -flags +ildct -an output.mov

This MOV should import into your Avid with no problems. It may remux to MXF, or it may operate natively.

~MiSfit

carlmart
27th January 2010, 21:10
Well, as I speak ffmpeg is running and supposedly converting my first shot.

I had to modify the script because it didn't accept 1440x108: had to go with 1920x1080.

Also don't know how long will it take to upscale the stuff.

If it turns up well maybe it's time to review what filters to use.

carlmart
27th January 2010, 23:25
How much should I expect this HD file to be larger than the original?

It's now 6.5 times the original size, and still going up...

poisondeathray
28th January 2010, 00:40
How much should I expect this HD file to be larger than the original?

It's now 6.5 times the original size, and still going up...


It will go up by the change factor of the bitrate

e.g.
If you're using 220Mb/s DNxHD and your original was , for example 10Mb/s, It would go up by about 22x

Blue_MiSfit
28th January 2010, 03:09
Right. DNxHD will use roughtly 220mbps at the setting we told it to. If your source was DV, then you can probably comfortably get away with using the lower bitrate options.

~MiSfit

carlmart
28th January 2010, 18:00
Ok. File ended up 7.6x the original size. Pity the file is so large for me to pick something for you to see. What can I use to select a few seconds with?

The MOV file imported fine to Avid, so that is very good.

What I would like to know is what program can I use to view the resulting HD file. The others I tried (VLC, MPC and QT) do not play it smoothly. Any suggestions?

carlmart
28th January 2010, 18:20
At least a small sample of what I got: a captured frame from Avid.

http://www.mediafire.com/file/mmn2yohq0z2/orixas4a.jpg

carlmart
28th January 2010, 18:52
And this is a frame from the HDV image it will be intercut with.

http://www.mediafire.com/file/vqynjtviwtw/orixas3.jpg

Blue_MiSfit
28th January 2010, 23:32
Avid should play the DNxHD file smoothly.

Post screenshots with something like imgur or photobucket.

You can trim a piece of the MOV using QuckTime, and do a save as. Then, send this to us with mediafire or something like that.

~MiSfit

carlmart
29th January 2010, 04:28
Avid should play the DNxHD file smoothly.

It's not so smoothly, and I would like to know why. There are some artifacts, like short time horizontal-bars like moving up that come now and then. They are not on the original avi file, but they also were there when Avid player the original avi file.

So I guess it might be just an Avid artifact, and that's why I asked for a reliable player to play the HD file.


Post screenshots with something like imgur or photobucket.

I did post some screenshots. Don't they show?

You can trim a piece of the MOV using QuckTime, and do a save as. Then, send this to us with mediafire or something like that.

It's not working. I am using QT Pro, but I can't seem to mark edit points to trim a piece of the file. As I am not familiar with QT, certainly it's my fault.

I do think the SD file can ge cleaned even further using the avisynth script. This is the one I used:


converttoyv12(interlaced=true)

#a=last

nnedi(field=0,dh=true).TurnRight().nnedi(field=0,dh=true).TurnLeft()

limitedsharpenfaster()

spline36resize(1280,960)

sharpen(0.5)

spline36resize(1920,1080)

limitedsharpenfaster()

#interleave(last,a.Bob().spline36resize(1440,1080))

return last

separatefields.selectevery(4,0,3).weave

carlmart
29th January 2010, 14:35
Things improved a lot when I just now tried deinterlacing it with:

EDI=NNEDI(field=-2)
YADIFmod(mode=1, edeint=edi)

Seems like a move in the right direction.

Now if I had a way to improve DV border enhancement, that is soften it, which IMHO is one of the things that is (thankfully) missing in HD.

Edit: well, I'm answering myself. Deleting sharpen() or using a lower factor seems to soften border enhancement.

Ghitulescu
29th January 2010, 16:36
Why do you need deinterlacing?
Apparently you shot both interlaced (DV per se, HDV as Sony Z1 is 1080i - the cinematic is a bad joke).
Even if you're otherwise happy with cinematic 24/25/30, if you want to interface it with DV then you need 1080i. Once you got the final film, then you have to decide if you're deinterlacing it or not, depending on the support.

carlmart
29th January 2010, 16:49
Why do you need deinterlacing?
Apparently you shot both interlaced (DV per se, HDV as Sony Z1 is 1080i - the cinematic is a bad joke).

Yes, I shot both interlaced. And yes, the Z1 cinema setup is a VERY bad joke that many people are falling for and regretting it later on.

What I do not like is the result I am getting from my upscaled interlaced images when played on the Avid. A friend of mine, who knows a lot of Avid, tells me it might be a problem of inverted fields when importing, which should be lower first for NTSC. As it is now you can see the interlace when I think you should not. Look at the hand of the lady or her dress on the left side.

As I am now carrying on a fresher upscale, also without the sharpenings, I will be able to compare them.

Blue_MiSfit
30th January 2010, 02:36
Try something like this script instead:


#Assuming YUY2 decoded from NTSC DV

EDI=NNEDI(field=-2)
YADIFmod(mode=1, edeint=edi)

spline36resize(1920,1080)
ConvertToYV12()
#Now we have 1080p60 in YV12

limitedsharpenfaster()
ColorMatrix(mode="Rec.601->Rec.709")

AssumeTFF.SeparateFields.SelectRvery(4,0,3).Weave
#And finally 1080i30, TFF, Rec. 709 YV12, which should match HDV


~MiSfit

carlmart
30th January 2010, 12:41
Try something like this script instead:


AssumeTFF.SeparateFields.SelectRvery(4,0,3).Weave
#And finally 1080i30, TFF, Rec. 709 YV12, which should match HDV




Why should we go for something 1080i30 instead of 1080i60?

BTW: you trust me too much that I will be smart enought to correct SelectRvery and put SelectEvery instead. I went googling to see if SelectRvery was correct before modifying it. Was that a test to see if I am paying attention?...
:p

poisondeathray
30th January 2010, 16:56
Why should we go for something 1080i30 instead of 1080i60?


This might be confusing, but 1080i30 means the same thing as 1080i60 . They both mean 30 FRAMES per second or 60 FIELDS per second. Just different naming conventions - but this is opening a big can o worms...

carlmart
30th January 2010, 19:16
OK, I can understand that and won't get into it.

But why does the last script I mentioned look better (cleaner, no interlace artifacts) in AvsP than this last script?

I can show two frame areas to show what I mean. Believe me, this is helping me understand better a lot of things, so please be patient with me.

poisondeathray
30th January 2010, 20:00
But why does the last script I mentioned look better (cleaner, no interlace artifacts) in AvsP than this last script?

I can show two frame areas to show what I mean. Believe me, this is helping me understand better a lot of things, so please be patient with me.



Exactly which scripts? which post#

Every source is different. You might find artifacts in different sections in one script , but not in the other using a different deinterlacer

I've found yadifmod+nnedi2 on DV material can leave artifacts more often than nnedi2 alone ; you could try adjusting blue_misfits script and see if that helps

Assuming you have BFF DV, change the first 2 lines to
NNEDI2(field=2)

carlmart
30th January 2010, 21:19
Exactly which scripts? which post#

Oh, sorry. Post #161. Then I added the deinterlacer and things got cleaner.

Every source is different. You might find artifacts in different sections in one script , but not in the other using a different deinterlacer

My question is whether I should use a deinterlacer or not. Apparently I shouldn't need one because my stuff is interlaced and will continue to be so. But then it's difficult to see in AvsP what improvements I am getting as I change the filters.

I've found yadifmod+nnedi2 on DV material can leave artifacts more often than nnedi2 alone ; you could try adjusting blue_misfits script and see if that helps

Assuming you have BFF DV, change the first 2 lines to
NNEDI2(field=2)

Things didn't change much with that. In any case this is what I get by applying the first script (http://www.mediafire.com/i/?1nhdoiz1hyt) and then Blue_MiSfit's (http://www.mediafire.com/i/?zntmzmhnyjt).

carlmart
30th January 2010, 21:24
Just to show things better, the script corresponding to "hand1" is:


converttoyv12(interlaced=true)
EDI=NNEDI(field=-2)
YADIFmod(mode=1, edeint=edi)
nnedi(field=0,dh=true).TurnRight().nnedi(field=0,dh=true).TurnLeft()
spline36resize(1280,960)
sharpen(0.3)
spline36resize(1920,1080)
return last
separatefields.selectevery(4,0,3).weave

poisondeathray
30th January 2010, 23:14
My question is whether I should use a deinterlacer or not. Apparently I shouldn't need one because my stuff is interlaced and will continue to be so


You can't resize interlaced material. Or you can, but it has to be in an interlace aware method. (I think you can resize horizontally without anything special, but that's not very useful by itself).


I can't see any of the screenshots; they have to be approved. You could use a 3rd party site like imageshack, tinypic, imagebam etc...

Anyways just use whatever you think works better. Every source is different

Blue_MiSfit
31st January 2010, 00:10
Indeed. You can resize an interlaced image horizontally without any issues. Doing it vertically works as well (so long as you do it with an interlaced aware method, otherwise you will slaughter it messily), but bobbing, resizing, and re-interlacing usually delivers more stable results (less aliasing etc).

Attachments take forever to get approved. I also suggest using a 3rd party image hosting service and just posting links here

~MiSfit

carlmart
31st January 2010, 02:50
Sorry, I thought you were seeing the sample screens.

Already uploaded them to Mediafire, and the URLs are above and on page 8.

carlmart
1st February 2010, 14:53
If it's not asking too much, I would like a brief explanation on the deinterlacing filters we are using and why.

The main purpose for this upscaling was being able to use my DV camera in order to help my editing.

The first step is resizing it, so I can put them all on the same timeline and later export it as an HD file.

The second step is processing the image in order to blend it, so it can cut smoothly. That will require some processing within Avid, even if some things I might get ready when using the Avisynth filters.

For instance: as the HDV image on some cases had some lens reflections that caused a certain softening, which was not present on the DV images, I tried a Tiffen filter effect called Black Mist and it softened the DV harder contrast very well. But also the borders got softened, so I might try some sharpening on the Avisynth to see how Black Mist processes all that later on.

What do you think?

A harder job will be on the other shots, which were the ones you had seen at the beginning of this topic. The thing that bothers me most is that everything seems to be on the same focus plane, including the background. That is a result of the large depth of field natural in small cameras.

That is something I will have to foresee in the future, shooting farther away and using tele in order to defocus the background.

For now it was suggested to me that I might use a mask that might help me split the image, then blurring the background in order to look "out of focus".

What I wonder if this is something I might be able to do with Avisynth too. The most critical part is adding that mask, which apparently can be done with Photoshop or Adobe After Effects, both programs I have nil experience with.

Blue_MiSfit
1st February 2010, 20:17
Hi Carlos,

The big depth of field issue will be very difficult (if possible at all) inside avisynth. This is where a real VFX / compositing platform like After Effects will come in handy. A proper GUI seems like a prerequisite for doing good masks etc..

About deinterlacing, there are always several things to choose from. We could use a dumb Bob, but that usually kills sharpness and is prone to aliasing. TDeint is good, but sometimes falls apart in fast motion, and needs TMM and NNEDI's help to clean things up, which is very slow. YADIF is good, extremely fast, and rarely falls apart completely. YADIFMod + NNEDI is a nice compromise because it lets you use YADIF's high speed and good intelligence with NNEDI's incredible interpolation! This leads to a sharper output, less aliasing etc... If you want to really maximize quality you can use TempGaussMC, which is the absolute latest word in software deinterlacing AFAIK. It's also rather slow, but not horribly so :)

As far as getting these to intercut smoothly - I hate to suggest it, but you might try lowpassing / blurring the HDV footage a bit. Yuck. I feel like I should go wash my hands now.

~MiSfit

carlmart
2nd February 2010, 14:16
The big depth of field issue will be very difficult (if possible at all) inside avisynth. This is where a real VFX / compositing platform like After Effects will come in handy. A proper GUI seems like a prerequisite for doing good masks etc..

Learning curve for AE is quite steep. Perhaps with Photoshop can be better, but I am not sure.

About deinterlacing, there are always several things to choose from. We could use a dumb Bob, but that usually kills sharpness and is prone to aliasing. TDeint is good, but sometimes falls apart in fast motion, and needs TMM and NNEDI's help to clean things up, which is very slow. YADIF is good, extremely fast, and rarely falls apart completely. YADIFMod + NNEDI is a nice compromise because it lets you use YADIF's high speed and good intelligence with NNEDI's incredible interpolation! This leads to a sharper output, less aliasing etc...


So that's why that YADIFMod + NNEDI combo looked better on my test (see photos)! It's the winner until now, but I thought I might be doing something wrong.

If you want to really maximize quality you can use TempGaussMC, which is the absolute latest word in software deinterlacing AFAIK. It's also rather slow, but not horribly so :)


It might be interesting trying it.

As far as getting these to intercut smoothly - I hate to suggest it, but you might try lowpassing / blurring the HDV footage a bit. Yuck. I feel like I should go wash my hands now.


You're grounded for emitting dirty thoughts! ;)

I think the sharpen (avisynth) + Tiffen filter (Avid) on the Dv image will get me there.

Question is how to do it fast, like using still images to feed into Avid and see which combo works better. Then I will not have to wait so much for processing.

Blue_MiSfit
6th February 2010, 20:27
Any luck?

carlmart
6th February 2010, 23:14
Any luck?

You mean about the blurring thing?

Well, yes, I got some instructions from a forum guy apparently quite knowing what I want to do.

The problem is that I am not that familiar with Avid yet to completely understand all the steps involved. Will need the help of another friend of mine, currently on vacation, to decipher and implement the thing.

But it involves a mask and works within Avid itself.

What I would like to know from you is where we can start with TempGaussMC in our script.

Blue_MiSfit
9th February 2010, 08:41
Easy!

First, install http://avisynth.org/mediawiki/upload/c/c8/TempGaussMC_beta1mod.avsi and any plugins it requres (if you don't have them already)


Required Plugins

MVTools
RemoveGrain + Repair
MaskTools v2
NNEDI / NNEDI2 (2009) / EEDI2 / Yadif , depending on which EdiMode you want to use


Replace


EDI=NNEDI(field=-2)
YADIFmod(mode=1, edeint=edi)

with


TempGaussMC(EDIMode="NNEDI2")


Both examples will bob the video. I think you'll find TempGaussMC's results more visually pleasing, in most cases.

~MiSfit

carlmart
9th February 2010, 12:30
All filters seem to be loaded alright, but I keep getting this message:

"There is no function named TempGaussMC".

Blue_MiSfit
9th February 2010, 12:52
Whoops!


TempGaussMC_beta1mod(EDIMode="NNEDI2")


:)

carlmart
9th February 2010, 13:13
Now I get:

"There is no function named TempGaussMC_beta1mod".

The error must be somewhere else.

Just to clean up the slate, the script I am loading is:


AVISource("e:\file.avi")
converttoyv12(interlaced=true)
TempGaussMC_beta1mod(EDIMode="NNEDI2")
nnedi(field=0,dh=true).TurnRight().nnedi(field=0,dh=true).TurnLeft()
spline36resize(1280,960)
sharpen(0.3)
spline36resize(1920,1080)
return last
separatefields.selectevery(4,0,3).weave

Blue_MiSfit
11th February 2010, 13:04
Hmmm.. you did copy the avsi script to you avisynth plugins folder, correct?

carlmart
11th February 2010, 13:19
Hmmm.. you did copy the avsi script to you avisynth plugins folder, correct?

You're right to ask that. Unfortunately I did.

Even checked all the filters to see if versions were the latest. They are all updated.

Can't understand why it works with all others and not when adding TempGaussMC_beta1mod.

Edit: OK. As I was booting from my HDD1, instead of the HDD2, I tried the script in #183. This time it did load alright. So I wonder what is wrong on my HDD2 plugin folder.

carlmart
14th February 2010, 13:15
Just to add one more interesting info for those reading this project.

There are only some places where I will be using SD to HD blowup, as some of them are not providing good looking results. My fault, because the SD camera was unattended on some occasions where I was shooting alone, and images are too dark. In fact next time I do that, I will leave the camera in auto and also shoot from further away, so the background gets out of focus.

The interesting thing was that I had to go back to an old technique, which is enlarging the shots you are using to get closer angles or close-ups. I was resisting that idea because that tends to show up a bit when using larger screens. Only that this time I will try it adding a mask to separate figure from background, and then focus-out the background. I have already tried it and it looks great.

What I am thinking of using is a Tiffen black mist effect to diffuse the close-up a bit, which is quite usual when going closer with a lens, and hid the enlarging problems.

carlmart
24th February 2010, 13:04
OK. Second upscaling, with a different shot.

Have a look at a comparative frame from Avid, with original DV on the right and upscaled HD on the left.

http://www.mediafire.com/i/?ztizzdqu0zj

Quite interesting indeed. The only enhancement I used was sharpen (0,3), and it brought out some subtle detail.


AVISource("e:\file.avi")
converttoyv12(interlaced=true)
TempGaussMC_beta1mod(EDIMode="NNEDI2")
nnedi(field=0,dh=true).TurnRight().nnedi(field=0,dh=true).TurnLeft()
spline36resize(1280,960)
sharpen(0.3)
spline36resize(1920,1080)
return last
separatefields.selectevery(4,0,3).weave


The HDV camera framed a wide shot of the group, so I can't compare the upscaled HD to it. But obviously there are some resolution differences against the DV, which doesn't seem to behave as well as it does on a well lit shot. The stage here was lit with available fluorescent light.

My way out for this sequence will be to convert it to black & white and use a 2.1 mask, as if it was cinemascope. The B & W will help me correct just the contrast, which will make HDV and upscaled HD shots blend better. I already tried it on the timeline and it looks great. The final test will be next week, when I will screen it on my 42" plasma.

Now a question on the ffmpeg conversion. As I think I mentioned, I installed WinXP SP3 in two different HDDs on my computer. The idea for that is to have a cleaner install where the Avid was supposed to work. But this dual setup has helped me on other questions, like when attacked by virus, avisynth problems and now ffmpeg.

Ffmpeg works fine on one HDD, but it does not on the other. I dropped the same ffmpeg .exe and .play files in the System32 directory on both HDDs, so I don't know what is missing on the one that refuses to load ffmpeg.

The next weird thing is the mov file. After I converted the DV file to HD on the working HDD, I went to the "Avid-clean" HDD to import the mov file. The resulting imported file came out with a completely white screen! That has never happened to me.

So I went back to HDD where I had made the ffmpeg conversion, loaded Avid there and imported the same mov file. Clean as a whistle!

Why is that? The only thing I had done was move the HD mov file from one HD to another. Can that be the reason? Why?

I am not too familiar with mov files, but they seem to be containers. Do they have paths inside that may make them lose their tracks on what is where? My guess is they do, so I wonder how to change that.

2Bdecided
24th February 2010, 13:29
Sounds like a codec issue.

carlmart
24th February 2010, 13:37
Sounds like a codec issue.

Probably. What do you suggest I should do?

poisondeathray
24th February 2010, 16:37
white screen suggests you're missing the codec.

so you should install it

(e.g if you are using dnxhd, install dnxhd)

carlmart
25th February 2010, 15:13
OK. Now I am not getting a white screen when I import from Avid. Even if that DNxHD codec should have been installed when I installed this Avid version, which was last week.

What I am still not getting to work is the ffmpeg converter on this HDD. What might be missing?

BTW, please go have a look at the comparison between the SD and upscaled HD here:

http://www.mediafire.com/i/?ztizzdqu0zj

HD on the left, SD on the right.

2Bdecided
25th February 2010, 16:24
BTW, please go have a look at the comparison between the SD and upscaled HD here:

http://www.mediafire.com/i/?ztizzdqu0zj

HD on the left, SD on the right.I already did. My comments are the same as, ooo, about a year ago! Those halos make it look more like upscaled SD. Try to get rid of the halos.

Though in the small resolution you uploaded, it's hard to know what it'll look like on a 1080p display!

btw, I'm very proud that you're taking as long to finish this project as I do some of mine. I start, and then something else comes along, and...!

(Still got to finish my wedding video - it's our eleventh anniversary this year!)

Cheers,
David.

carlmart
25th February 2010, 18:38
I already did. My comments are the same as, ooo, about a year ago! Those halos make it look more like upscaled SD. Try to get rid of the halos.

I think I tried it back then and I didn't quite like the results or it took to long to render them. But it would be nice to try them again. What would you suggest to use for that?

OTOS I am processing the upscaled SD images further. The one that I uploaded now will be turned to B & W, and I applied a Tiffen Soft/F video effect, so the halos are not so evident now.

I think that what you call halos I call borders, and I am quite aware of them. The filters soften them a lot.

Though in the small resolution you uploaded, it's hard to know what it'll look like on a 1080p display!

Sorry, I will try to capture two full frame shots, upscaled and processed, for you to see the results.

btw, I'm very proud that you're taking as long to finish this project as I do some of mine. I start, and then something else comes along, and...!

I am in the final stages now. Next week I will show the first cut to the musician, and on March 24th should be the public show.

(Still got to finish my wedding video - it's our eleventh anniversary this year!)

Congrats!

carlmart
25th February 2010, 19:53
OK. Here are the shots in three versions:

1) Original DV file:

http://www.mediafire.com/file/joiumdzonzd/radio_DV.jpg

2) Upscaled DV file:

http://www.mediafire.com/file/juzmydwtmj0/radio_upscaled.jpg

3) Processed upscaled file:

http://www.mediafire.com/file/gyj2nzo2kjm/radio_B&W + mask.jpg

2Bdecided
26th February 2010, 12:32
It's depressing how bad SD looks by default when you put it on a large screen - I think some NLEs try to do the worst job possible! Thank goodness for AVIsynth!

Yes, halos = borders, and yes, removing them usually makes the picture look softer. Don't think it's slow though.

My suggestions are back in the thread. Don't know if there are any better halo solutions out there now.


SD upscale > B&W as a "feature" is a good idea I think.

Cheers,
David.

carlmart
27th February 2010, 15:52
Hi David,

It's depressing how bad SD looks by default when you put it on a large screen - I think some NLEs try to do the worst job possible! Thank goodness for AVIsynth!

Yes, I am quite grateful on what Avisynth does for free. I think many of those programs, like Magic Bullet, implement many things used on Avisynth, charging a bundle.


Yes, halos = borders, and yes, removing them usually makes the picture look softer. Don't think it's slow though.

Let's try it then. First of all, if you can, explain a little to me on what variables do what on BlindDeHalo3. Forget about that last scene I uploaded, as I think the B&W trick worked like a charm.

Please suggest what I can do on the other image, with the black singer, also uploaded there.


Carlos

carlmart
27th February 2010, 15:53
Hi David,

It's depressing how bad SD looks by default when you put it on a large screen - I think some NLEs try to do the worst job possible! Thank goodness for AVIsynth!

Yes, I am quite grateful on what Avisynth does for free. I think many of those programs, like Magic Bullet, implement many things used on Avisynth, charging a bundle.


Yes, halos = borders, and yes, removing them usually makes the picture look softer. Don't think it's slow though.

Let's try it then. First of all, if you can, explain a little to me on what variables do what on BlindDeHalo3. Forget about that last scene I uploaded, as I think the B&W trick worked like a charm.

Please do suggest what I might do on the other image, with the black singer, also uploaded there.


Carlos

carlmart
28th February 2010, 19:06
Another stage. Today I could view the edited stuff in full quality on my 42" plasma. Remarkably good, superb, we might say without sounding too self-praising.

The editing is not complete, but now I can show it tomorrow with the minimum quality I wanted which is very good.

Today I could also concentrate on an artifact that shows on the upscaled DV stuff, which is difficult to explain. Imagine a circle which splits horizontally in two, and you see them displaced for a split second, sometimes in two places at the same time.

At first I thought it might be something related to Avid and its video player, which is QT, or even the video board. But when I used a Geforce 9600GT, things were crystal clear, so it's not hardware related.

My guess is it might be related to the deinterlacing plug-ins, as the artifact always happens in movements: subject, pan or camera movement. It's a split second, so it doesn't show when you view it frame by frame.

Any suggestions on:

1) The name of this artifact.

2) Tips to avoid them.

2Bdecided
1st March 2010, 13:41
I can't remember the name, but it happens when the framerate of the video clip isn't locked to the frame rate of the display device - or even the frame-change of the video clip isn't synchronised to the frame-change of the display device, and the displayed frame changes mid-frame - hence the top half is the previous frame, the bottom half is the next frame.

Can happen in the PC due to the player, or even in the display (if it's doing horrible frame rate conversion).


That's why you don't see it when stepping through frame-by-frame: it's not there in the footage itself.

Cheers,
David.

P.S. Sorry, I know no more about BlindDeHalo3 than you - this thread was the first time I played around with it.

carlmart
19th March 2010, 13:31
After two succesful conversions three weeks ago using ffmpeg, now I'm getting an error message like this:

http://www.mediafire.com/i/?mzahzzjiymy

The script I'm using is exactly the same, only changing the avi file.


import("C:\video\AviSynth 2.58\plugins\BlindDeHalo3.avs")
AVISource("h:\capturas\amorim.09-06-25_12-56.00.avi")
trim(1991,3000)
converttoyv12(interlaced=true)
TempGaussMC_beta1mod(EDIMode="NNEDI2")
nnedi(field=0,dh=true).TurnRight().nnedi(field=0,dh=true).TurnLeft()
spline36resize(1280,960)
BlindDeHalo3(rx=3.2,ry=1.5)
sharpen(0.3)
spline36resize(1920,1080)
return last
separatefields.selectevery(4,0,3).weave


The text I'm loading into ffmpeg is also the same, only changing input and output names.


ffmpeg -i tema_começo.avs -vcodec dnxhd -b 145Mb -flags +ildct -an tema_começo.mov

I've already gone back to the ffdshow version I had back then. The only other thing I did since then is installing and updating Megui.

What do you suggest might be happening and what can I do?

There are a few short shots more I need to upscale, and I don't know what other way I may go.

Blue_MiSfit
20th March 2010, 02:23
The problem is the resolution that ffmpeg is seeing from avisynth. The tiny size probably means that avisynth is throwing an error.

Open you AVS in AvsP or VirtualDub, and see what the error message is :)

carlmart
20th March 2010, 13:26
Oh, I'm very much ashamed to say that the error was really my fault. Sorry!

The problem was that I was specifying a different file directory for ffmpeg than for AvsP, thinking I was correcting an error I had had in the past. As the file was loading correctly in AvsP and VD, then the problem was not in the script.

So I changed the directory for ffmpeg and conversion went fine.

Sometimes you think you are correcting things and are really messing it up... :(

Now I have a different problem, and would appreciate a suggestion: where would the trim line be placed.

I'm using the same script as above, changing the file name. It loads the file alright, but when I find the trim points and load them... I get a one frame long shot!

What might be happening?

D3C0D3R
25th March 2010, 12:27
for speed-up try to replace
nnedi(field=0,dh=true).TurnRight().nnedi(field=0,dh=true).TurnLeft()
by this
nnedi2_rpow2(rfactor=2, cshift="spline36resize")

nnedi2 is faster than nnedi and nnedi2_rpow2 made specially for enlarging images by powers of 2
(nnedi shifts chroma and after upscaling it can be visible).
also you can use McBob for deint - it slow, but the source 480p may be better. So 1080i will better too.

for more automate LaTo write resizing func.

# NNEDI2resize function by LaTo INV.
#
# PARAMETERS:
# -----------
# ox = destination width
# oy = destination height
# nsize,qual,pscrn,cshift = nnedi2 parameters
#
# ABOUT RESOLUTION:
# -----------------
# if output > input : use nnedi2 resizer + "cshift" resizer
# if output = input : do nothing
# if output < input : use "cshift" resizer
#
# EXAMPLE:
# --------
# NNEDI2resize(1280,720)
# NNEDI2resize(1920,1080,qual=1,cshift="spline16resize")

function NNEDI2resize(clip clp, int ox, int oy, int "nsize", int "qual", bool "pscrn", string "cshift")
{
nsize = default( nsize, 2 )
qual = default( qual, 3 )
pscrn = default( pscrn, true )
cshift = default( cshift, "spline36resize" )

ix = clp.width()
iy = clp.height()

rx = float(ox)/float(ix)
ry = float(oy)/float(iy)
rf = (rx > ry) ? rx : ry

clp = ( rf > 1.0 ) ? clp.nnedi2_rpow2(rfactor=ceil(rf/2.0)*2, nsize=nsize, qual=qual, pscrn=pscrn, cshift=cshift, fwidth=ox, fheight=oy)
\ : ( rf < 1.0 ) ? Eval( "clp." + cshift + "(" + string(ox) + "," + string(oy) + ")" )
\ : clp

return clp
}

carlmart
25th March 2010, 13:18
for speed-up try to replace
nnedi(field=0,dh=true).TurnRight().nnedi(field=0,dh=true).TurnLeft()
by this
nnedi2_rpow2(rfactor=2, cshift="spline36resize")

nnedi2 is faster than nnedi and nnedi2_rpow2 made specially for enlarging images by powers of 2
(nnedi shifts chroma and after upscaling it can be visible).

I tried it on AvsP. It doesn't seem to change much, but the AvsP screen is small, even if I now enlarge it quite a lot. A whole blowup might show improvements. Nnedi shifts chroma how and where to?


also you can use McBob for deint - it slow, but the source 480p may be better. So 1080i will better too.

I got some comments that McBob might not have quality enough or had some issues.


for more automate LaTo write resizing func.

# NNEDI2resize function by LaTo INV.
#
# PARAMETERS:
# -----------
# ox = destination width
# oy = destination height
# nsize,qual,pscrn,cshift = nnedi2 parameters
#
# ABOUT RESOLUTION:
# -----------------
# if output > input : use nnedi2 resizer + "cshift" resizer
# if output = input : do nothing
# if output < input : use "cshift" resizer
#
# EXAMPLE:
# --------
# NNEDI2resize(1280,720)
# NNEDI2resize(1920,1080,qual=1,cshift="spline16resize")

function NNEDI2resize(clip clp, int ox, int oy, int "nsize", int "qual", bool "pscrn", string "cshift")
{
nsize = default( nsize, 2 )
qual = default( qual, 3 )
pscrn = default( pscrn, true )
cshift = default( cshift, "spline36resize" )

ix = clp.width()
iy = clp.height()

rx = float(ox)/float(ix)
ry = float(oy)/float(iy)
rf = (rx > ry) ? rx : ry

clp = ( rf > 1.0 ) ? clp.nnedi2_rpow2(rfactor=ceil(rf/2.0)*2, nsize=nsize, qual=qual, pscrn=pscrn, cshift=cshift, fwidth=ox, fheight=oy)
\ : ( rf < 1.0 ) ? Eval( "clp." + cshift + "(" + string(ox) + "," + string(oy) + ")" )
\ : clp

return clp
}

What improvements would I have with "NNEDI2resize function by LaTo" over spline36resize?

carlmart
9th April 2010, 14:07
I am back with some good news and new problems.

The most important good news is that the editing is finished and final results are very very good. So a BIG thanks is in order first to every one that helped me here.

In due time I will upload the film file to Rapisdshare so you can go have a look, and hopefully enjoy it too.

The problems I am having now are centered on Avid. I can't seem to get an interlace artifact free copy on the tests I am carrying on. Ironically, the problem I am having is not on the upscaled shots, but on the HDV ones, that were imported direct from camera to Avid. So I don't think anyone here will be able to help me there if they don't know Avid.

What I could do was export a DV file that I would like to make a DVD off. The file is DV, but I think I can rename it avi and could be treated as such. My idea is to use avisynth to convert it to DVD ready files, perhaps even trying some filters to improve resolution.

Next wednesday there will be a big presentation for the film, which will be seen in 3 x 2 meters screen, for a probably 100 people audience. So I working over the clock to get a workable, artifact free HD copy by then.

2Bdecided
9th April 2010, 15:43
If the output is HDV, you just need to use a player which deinterlaces it on the fly - I can't see Avid (which I have no knowledge of) is breaking something on the way from interlaced HDV input to interlaced HDV input!

If the output isn't HDV, what are you rendering to?

Cheers,
David.

carlmart
9th April 2010, 17:42
If the output is HDV, you just need to use a player which deinterlaces it on the fly - I can't see Avid (which I have no knowledge of) is breaking something on the way from interlaced HDV input to interlaced HDV input!

No, the output is not HDV. I wouldn't have any use for it. It's not a home system or something broadcasts air with. Broadcasting is done with 720p and 1080p. So in my mind is no longer part of the equation as soon as it's captured.

If the output isn't HDV, what are you rendering to?.

1080i for interlaced or 720p for progressive.

carlmart
10th April 2010, 01:51
What should I use to input a .dv file into an script?

I did try changing dv by avi and using avisource, but I get a "couldn't open file" message.

I will also have to demux the file to get my audio out.

Blue_MiSfit
11th April 2010, 02:41
.DV is tricky. I would export from Avid into something else, maybe DNxHD?

You can load this in to avisynth using FFMS2 (or directly with x264 now).

~MiSfit

carlmart
11th April 2010, 15:32
.DV is tricky. I would export from Avid into something else, maybe DNxHD?

You can load this in to avisynth using FFMS2 (or directly with x264 now).


I seem to be getting to the trickier and probably most critical part of my edit: how to export it.

Perhaps I should concentrate on one thing: exporting an HD file that I can manage and get my SD conversions from it.

No problem in exporting DNxHD, but Avid only exports as QT movie from my 1440x1080 timeline. A pity, because on the short tests I made I got best image results from a QT reference.

The program I am using to convert the mov file onto H264 is Sorenson Squeeze. I also tried Carbon Coder, which supposedly is better, but I got interlace artifacts from it, as I did on my first Squeeze conversions. Tried several combos on Squeeze until I cured the artifacts. But I'm not too happy with Sorenson Squeeze.

The problem, to put it straight on the table, is how to get from a mov file to an MKV file, which is the one I will be playing next wednesday on the pre-release presentation.

The mov to H264 conversion is the key, as it has to handle video & audio at the same time. The H264 program has to merge both onto a single file, or the MKV file won't play.

I know that because I tried doing video & audio separate mixdowns, video converted to H264 and audio to AC3, then merged them with MKV merge. The result did not play on my LG BD390 which plays all my MKVs.

As the export and conversions take several hours, I have to be very careful on what path to go now. I already did several short tests to compare results, and it's about 1 hour or more per minute. As my film is 26 minutes long, just add it up. Can't afford to miss.

carlmart
11th April 2010, 19:21
A smaller question: can I go fom a mov file to dvd files with avisynth?

How do I load the file in the script?

2Bdecided
12th April 2010, 16:48
1080i for interlaced or 720p for progressive.1080i WHAT?! For what?

"Interlaced artefacts" are a result of watching something that's interlaced without deinterlacing. 1080i is interlaced. Therefore, the problem is with your viewer, not the export.

If 720p also shows interlaced artefacts, then I agree - export (or deeper) problem!

Cheers,
David.

carlmart
13th April 2010, 18:47
As we speak I am running a mov to DVD files conversion using TMPGEnc 4.0 Xpress. I would have preferred to use Avisynth for this, as I thnk I might get better results. But I don't know how to load a mov file onto a script.

Unfortunately I also had to give up, for now, on an HD mp4 conversion from my mov original. Both programs I tried, Sorenson 6 and Carboncoder, who are supposed to process everything, stop in mid conversion providing no hint on what made them stop.

An HD mp4 is the only option I have to put inside an MKV file that I can play from my BD player and get an HD I can play from disc, besides using a BD burner which I do not have to burn a BD disc.

In any case yesterday I made a DVD copy from another mov (QT movie instead of the QT reference I am using now), and the final DVD played beautifully on my BD player, which upscales SD.

carlmart
16th April 2010, 13:29
Just to put an end, relative or final, to this story.

I could at last generate a full MP4 copy of my film. I ended up using Carboncoder, after failures with Sorenson Squeeze and QT Pro.

And I could get to that copy after a Carboncoder failure too, apparently because there was a program running: Windows Explorer.

All these programs seem very sensitive: not only do they fill up both CPU cores, as they do not tolerate any other thing running. Or you risk the program stopping the conversion and becoming inactive.

But contrary to the others I tried, Carboncoder got a copy with absolutely none interlace issues, be it on the movements, pans or final titles. Everything was fluid, as was on the Avid timeline, except with a much better image quality, really HD.

In any case I will still replace the DV upscales, that were 1920x1080, for new ones: 1440x1080. I feel some of the problems I had in the conversion are related to that: having 1920 and 1440 material on the same timeline.

Even if there might be new chapters to this story, I wish to thank you all for the effort and generosity in helping me. In the future I will upload the final film, with subtitles and in HD, to Rapidshare so you can see what we could achieve.

Thanks again!

2Bdecided
16th April 2010, 16:02
Glad you made it.

It's surprising how flaky certain video tools are. AVIsynth is exceptionally good in this respect (unless abused).

x264, usually via MeGUI, is the mp4 encoder of choice for many around here. I'm not sure how to get MOV into it either.

Cheers,
David.

Bordo32
26th January 2011, 07:34
Carlmart,
It is been awhile you were experimenting with the script to upscale DV to HD.
Can you please share if you have made any improevements and post your final script.

carlmart
26th January 2011, 21:02
I'm sorry. But I think I did post my final script. In any case it was this:

AVISource("e:\file.avi")
converttoyv12(interlaced=true)
TempGaussMC_beta1mod(EDIMode="NNEDI2")
nnedi(field=0,dh=true).TurnRight().nnedi(field=0,dh=true).TurnLeft()
BlindDeHalo3(rx=3.2,ry=1.5)
#sharpen(0.3)
spline36resize(1440,1080)
return last
separatefields.selectevery(4,0,3).weave

As soon as I upload to Rapidshare a copy of the video with English subs, I will let you know. It will be a pleasure to have all people who helped me here have a look.


Carlos

Gavino
27th January 2011, 11:47
...
return last
separatefields.selectevery(4,0,3).weave
Because of the return statement, the last line of your script is not used - is that intentional?

carlmart
27th January 2011, 12:17
No. I think I was just lazy and didn't cut it. :)

2Bdecided
27th January 2011, 13:19
Anyone picking the script up and using it today should try qtgmc in place of TempGaussMC_beta1mod for a significant speed increase (essentially the same quality).

Cheers,
David.

Bordo32
28th January 2011, 21:27
Carlmart, thanks for keep developing this process.

QTGMC looks interesting, would be helpfull to get recomendations on an actual settings, as a starting point.

2Bdecided
3rd February 2011, 14:28
QTGMC looks interesting, would be helpfull to get recomendations on an actual settings, as a starting point.As a starting point, don't use any settings! Defaults are fine.

Cheers,
David.