Log in

View Full Version : MVtools and HD footage


Mug Funky
7th August 2007, 01:13
hey y'all.

i've been playing around with some HD footage (10-bit RGB stuff), and would like to run a really brutal noise reduce on some 500T 16mm (translation: grainy as hell, esp. in the blue channel).

no matter how carefully i do the mvtoolage, i can't make it work for more than a few frames without "unknown exception" spoiling things.

what i'd like to do:

- separate r, g, and b into greyscale YV12 clips, and possibly make another for the motion search (i'm using green for all 3 atm)

- overlapped-block compensate at least 2 frames in either direction

- merge RGB

- temporal soften

- output to dpx/tiff/whatever sequence for later output to 35mm.

i'd also like some artefact protection obviously :) i have a script that works wonderfully on standard def, YV12, but no matter how much i prod at it it'll just run out of memory.

i'd love to share some source with y'all, but that's probably not legal. you could simulate it with any old HD footage + converttoRGB (and possibly addgrain).

i'm just about to fish around for any possible latest versions of avs/mvtools, but i'm pretty sure i'm on the latest.

Pookie
8th August 2007, 05:21
Hi Mug Funky :D

* Post the script you've tried so far - perhaps someone will see an obvious error.

* 10 Bit RGB = BlackMagic codec MOV ? Using the QTsource plugin? What happens with a regular Mpeg2 HD clip - Memory crash as well?

Mug Funky
9th August 2007, 05:01
here's what i have so far...

importuncompressedsequence("%06d.dpx","dirtycineon",0,750, 1920,1080,25,8192,0 )

crop(0,0,1024,560)

red=showred().converttoyv12()
green=showgreen().converttoyv12()
blue=showblue().converttoyv12()

vf2=mvanalyse(green,blksize=16,overlap=8,isb=false,delta=2)
vf1=mvanalyse(green,blksize=16,overlap=8,isb=false)
vb1=mvanalyse(green,blksize=16,overlap=8,isb=true)
vb2=mvanalyse(green,blksize=16,overlap=8,isb=true,delta=2)

cleanred=interleave(red.mvcompensate(vf2),red.mvcompensate(vf1),red,red.mvcompensate(vb1),red.mvcompensate(vb2)).converttorgb32()
cleangreen=interleave(green.mvcompensate(vf2),green.mvcompensate(vf1),green,green.mvcompensate(vb1),green.mvcompensate(vb2)).converttorgb32()
cleanblue=interleave(blue.mvcompensate(vf2),blue.mvcompensate(vf1),blue,blue.mvcompensate(vb1),blue.mvcompensate(vb2)).converttorgb32()

#cleanred
mergergb(cleanred,cleangreen,cleanblue)

temporalsoften(2,255,255)
selectevery(5,2)

source is a sequence of dpx files at 1920x1080

the crop line is my way of finding out at what point it falls over.

i'm just encoding the unfiltered sequence with HC to see how it handles that - however, downsampling to 4:2:0 is not an option - even going to 8 bits is an issue, but it's okay so long as the grain is above -48dB (which is very much is).

[edit]

yep, loading it as mpeg-2 then converting to RGB will reproduce this. only difference was it loaded faster :)

Fizick
9th August 2007, 05:47
why you do not use idx=1 in all green.mvanalyse lines and green compensations, idx=2 for all red compensations, and idx=3 for all blue compensation??

Pookie
10th August 2007, 05:38
Yup, it seems to work with smaller dimensions. 1024x576 works, but 1920x1080 errors out (unrecognized exception).

squid_80
10th August 2007, 09:13
At 1920x1080 it chews up about 1.1 gig of memory here. Doesn't work at all with mt avisynth. Even with setmemorymax(100) it uses around 750 meg.

Mug Funky
10th August 2007, 14:10
@ Fizick: i want to use the same compensation for all 3 (green channel for now, i'll use greyscale when i get it working :))

i thought idx was only relevant when you were keeping the compensation made in mvanalyse, which as i understand is no longer the default behaviour (i could easily be wrong - i'm not sure which version of the help file i've been reading).

Didée
10th August 2007, 15:00
@ Fizick: i want to use the same compensation for all 3 (green channel for now, i'll use greyscale when i get it working :))
Attention, we don't want to mix up the meanings of "compensation" with that of "halfpel interpolation". The halfpel interpolation (being 400% the size of the input) is the starting point from which the compensation is created.

As it's posted, your script uses 16 different halfpel interpolations, see below. Guess where your memory goes. :D

i thought idx was only relevant when you were keeping the compensation made in mvanalyse
When not specifying idx, every instance of either MVAnalyze or MVCompensate creates its own halfpel interpolation.

Try to make it like Fizick advised:

vf2=mvanalyse(green, ..., idx=1)
vf1=mvanalyse(green, ..., idx=1)
vb1=mvanalyse(green, ..., idx=1)
vb2=mvanalyse(green, ..., idx=1)

cleangreen = interleave(green.mvcompensate(vf2,idx=1), ... ) .converttorgb32()
cleanred = interleave(red .mvcompensate(vf2,idx=2), ... ) .converttorgb32()
cleanblue = interleave(blue .mvcompensate(vf2,idx=3), ... ) .converttorgb32()

This way you're using the minimum number of halfpel interpolations.

reepa
10th August 2007, 22:45
Sorry this is a bit offtopic, but could you post a sample frame? I'd love to see how 16mm film scales up to high-definition.

Blue_MiSfit
11th August 2007, 03:40
Mug might not be able to post, due to non-disclosure agreement.

However, I assure you that 16mm film goes to HD VERY nicely. Especially Super 16, since the aspect ratio works out quite well.

I was involved with an indie film that shot a mixture of Super 16, uncompressed 1080p24 from an XL-H1 over HD-SDI :D, and some misc HDV / DVCPRO HD / DV footage. The Super16 looks very nice at 1080p. Very film-like, with accurate grain representation and fantastic detail.

~MiSfit

scharfis_brain
11th August 2007, 10:25
@Mug Funky:
for the YV12 to RGB conversion ensure to use PC-Scale.
ie. converttoyv12(matrix="PC.601")

this will ensure, that luma isn't sqeezed from 0...255 to 16...235 and then back to 0...255.

Mug Funky
16th August 2007, 04:55
thanks for the tip scharfi - i hadn't thought of that. it didn't seem to be shifting the colours at all, but i'm outputting to quicktime, so it's a tough call to make (i think there's a chroma-off-by-one shift toward green happening somewhere though - i'll tackle that later).

the idx trick worked - i'm able to go 3 frames in each direction at fullpel, or 2 frames in halfpel now. for HD footage there's not that much use for halfpel though - especially considering how floaty 16mm is anyway. a post-sharpen could tame the slight blur if it becomes a problem.

now... i'll have to figure out how to make it go faaast. just loading the dpx files is slow enough. a 30 sec ad took me 2-3 hours to denoise :) maybe i'll have a shot parallelising it a tad.

IanB
16th August 2007, 13:20
@Mug Funky,

Also you might try cutting your hugh frames into, say 6, pieces, perhaps with a small overlap, processing the fragments serially, then finally stacking the bits back together. This could increase L2 cache perf a lot, best if you could get a full slice all in L2 at once.

morsa
17th August 2007, 06:43
I was doing the same MugFunky is telling now.

Denoising 500T 16mm stuff.

Simillar problems, and the denoising of a 30 seconds add also took me hours.....