PDA

View Full Version : Help with AVCHD deinterlacing


bloodem
17th March 2010, 21:01
Hello guys! I just bought a new video camera (a Canon HF200) and once again I started playing with deinterlacing methods.
I'm recording at 1920 x 1080 / 50i / 24 Mbps

A few years ago I was using a great deinterlacing plugin which - I though at that time - was giving the best results. It was called MVBOB. It did a great job with deinterlacing and kept the motion smooth (while doubling framerate). Now I'm using MeGUI + AviSynth + x264 but unfortunately mvbob doesn't work anymore.
Is there some other, new plugin I could use to achieve the same "mvbob" results (good quality deinterlacing + smooth video)? I haven't done this in a while now, so I'm not up-to-date with the latest tools... Thanks!

bloodem
17th March 2010, 21:39
And after some research... the winner is.... TempGaussMC :)
Although... jeez I need an upgrade. My poor Core2Duo E7200 @ 3.8 GHz is really struggling to reach 1 FPS...

Atak_Snajpera
17th March 2010, 21:47
You better check plain Yadif. Quality is good but it is alot faster!

Guest
17th March 2010, 21:47
I like sbdeint() also.

LoRd_MuldeR
18th March 2010, 00:05
You better check plain Yadif. Quality is good but it is alot faster!

Yadif is my favorite "real time" deinterlacer, but it doesn't give "archiving quality" in my opinion.

I prefer YadifMod+NNEDI2 for encoding purpose. Can't compete with TempGaussMC in certain situations, but it's a bit faster and works very well for me most of the time ;)

Well, give it a try and decide yourself...

bloodem
18th March 2010, 06:26
Thanks guys! After I get home from work I'll give them a try. I'll let you know about my final decision. ;)

bloodem
18th March 2010, 09:06
I tried a simple script for sbdeint:

DirectShowSource("C:\test.mts")
sbdeint()

The result is pretty strange, I get a lot of stuttering during playback. Am I missing some special parameters for AVCHD?

nm
18th March 2010, 09:58
Maybe the field order is wrong since you're using DirectShowSource. Try changing the order with AssumeTFF() or AssumeBFF() before sbdeint.

bloodem
18th March 2010, 10:01
Yep. I was about to write that. Indeed. AsumeTFF() was the solution... :)

bloodem
18th March 2010, 13:37
Well, after trying all of them, I have to say that YadifMod+NNEDI2 works best for me, it has the greatest visual BANG relative to encoding time. Thank you LoRd_MuldeR for the suggestion and a big thanks to all of you for the quick answers. On my machine, enconding a 10 minute 24Mbps AVCHD to x264 and at the same time deinterlacing it with YadifMod+NNEDI2 takes about 4-5 hours (processing at about 2 FPS) which is OK by me.

Here is the script I use for deinterlacing AVCHD content, just in case anyone else is interested:

DirectShowSource("F:\test.mts")
AssumeTFF()
interp=nnedi2(field=3)
yadifmod(order=1, field=-1, mode=1, edeint=interp)

If someone has more suggestions, I'm all ears! :D


Edit: I came across another issue. After encoding, the video has more brightness. I think it has something to do with the color space. The original AVCHD is in YUY2 and after encoding it's YV12. Is there some way to keep the original brightness?

poisondeathray
18th March 2010, 15:18
Edit: I came across another issue. After encoding, the video has more brightness. I think it has something to do with the color space. The original AVCHD is in YUY2 and after encoding it's YV12. Is there some way to keep the original brightness?

HF200 shoots AVCHD, which is YV12 4:2:0 subsampling ; AVC-Intra 100 is YUY2 4:2:2 (but I doubt you are using that). So I don't think it's a color space issue

It's likely something else, eg. playback issue, levels issue, configuration issues

How are you determining the "brightness" ?

aegisofrime
18th March 2010, 15:38
TGMC is *not* slow, depending on what settings you use. The speed of TGMC has been address in it's own thread by Didee himself, who did a speed and quality comparison vs Yadif+NNEDI2 using the Stockholm clip and this TGMC setting:

tempgaussmc_beta2(1,1,0,0,0,0,edimode="--",SVthin=0.0,pelsearch=1)

I would link you to his post, but for some reason I can't find it. In any case the speed result was that TGMC is faster, or at least comparable to Yadif+NNEDI2.

In any case, do give the above code a try. I get around 40 fps on a lossless rendering run with DVD footage on my Phenom II 955.

bloodem
18th March 2010, 16:14
Well surprise, surprise!
I just got home (after working via remote desktop, from work) and guess what... the stuttering is even WORSE than before. I tried various scripts:

1)
DirectShowSource("F:\test.mts")
AssumeTFF()
sbdeint()


2)
DirectShowSource("F:\test.mts")
AssumeTFF()
interp=nnedi2(field=3)
yadifmod(order=1, field=-1, mode=1, edeint=interp)


3)
DirectShowSource("F:\test.mts")
AssumeTFF()
TempGaussMC_beta1u(tr2=0, EdiMode="nnedi2")

They all give the same result... video stutters like hell!

Here is the test sample:
http://www.megaupload.com/?d=QYF11YFJ

What do you guys think? What am I missing here?

sneaker_ger
18th March 2010, 16:32
How about you post a sample of the source.

bloodem
18th March 2010, 17:02
'Course! Here is the source sample:
http://www.megaupload.com/?d=NGG7OHX3

bloodem
18th March 2010, 17:31
Well, just found out that this problem occurs only when the Media Player Classic renderer is either VMR9 or Haali. On "System Default Renderer" the framerate is smooth and there is no stuttering.
This is really starting to bug me....
PS: I'm using CoreAVC 2.0 for x264 decoding.

PPS: What's even stranger, is the fact that if I open the AVCHD file in Windows Media Player 12 (Windows 7 64Bit) the quality is INCREDIBLE... I mean, it's like some kind of ultra-expensive realtime hardware deinterlacer. I have no idea what codec it uses to achieve this...

sneaker_ger
18th March 2010, 17:47
Strange. ffmpeg2source produces awkward "jumps" on that sample, but DirectShowSource() with ffdshow seems to work fine.

nm
18th March 2010, 19:55
PPS: What's even stranger, is the fact that if I open the AVCHD file in Windows Media Player 12 (Windows 7 64Bit) the quality is INCREDIBLE... I mean, it's like some kind of ultra-expensive realtime hardware deinterlacer. I have no idea what codec it uses to achieve this...

It uses "hardware" deinterlacing provided by your graphics card (drivers). Quality is probably somewhere between YadifMod+NNEDI2 and TGMC, if you have a fast GPU and the driver is set to use the best filter.

If you have an Nvidia GPU, I'd suggest buying DGDecNV (http://neuron2.net/dgdecnv/dgdecnv.html) so that you can use hardware decoding and deinterlacing when importing video to AviSynth. You'll also get a reliable, frame-accurate video source.

bloodem
18th March 2010, 20:50
Awesome! Thanks for the valuable info, nm! That's exactly what I wanted to know. I would certainly like to put my little 8800GT to good use :D
Now, the thing that bothers me now is that for some unknown reason, when using any kind of bobber to double the framerate, the video stutters like hell. If I use a switch such as SelectEven() video plays normally (but the smoothness is gone).
If I figure this out... the case would be closed.

Boolsheet
18th March 2010, 21:14
the video stutters like hell.
Can you pin down the cause of the stutter? Source, processing/Avisynth, encoding, playback...

Do you see this problem in the encoded test sample you posted earlier? It plays fine for me with the DivX decoder (with and without DXVA).

Guest
18th March 2010, 21:23
When bobbing, make sure you set the field order correctly for your subsequent processing chain.

bloodem
18th March 2010, 21:26
It's a codec related issue. As I said in a previous post, the stuttering appears only when using the VMR9 or Haali media renderers in Media Player Classic. If I select the "System Default" renderer the video plays fine...

bloodem
19th March 2010, 08:32
I give up... This stuttering occurs only when converting to 50FPS... If I keep it at 25FPS (although the original smoothness is gone) I can watch it without problems on either renderer (VMR9, Haali, etc). It's driving me crazy!

bloodem
17th July 2010, 14:41
Well, I forgot about this thread. Just in case someone else has the same problem as the one mentioned above here is the solution: DISABLE CUDA Decoding in CoreAVC Settings and the stuttering will be gone. It looks like CUDA has some problems with 1080p 50 FPS (at least on some GPUs like mine: nVidia 8800GT)