Log in

View Full Version : Bad deinterlacing?


street1030
26th December 2009, 03:54
I've been trying to encode some of my Naruto Shippuuden dvds with MeGUI and I'm not really sure how to choose the correct deinterlacing options.

I usually press "Analyze" and go with those settings but I find that it doesn't work the best.

I chose the settings that looked the best when I previewed the AVS file but the outcome is still not great. The picture looks decent at first but then when you maximize the picture the lines are really choppy. Kind of looks like there are crosses coming out of them.

http://i684.photobucket.com/albums/vv206/street1030/2.jpg

Not the best example but you can kind of see it. Just wondering if this is from bad deinterlacing or maybe codec settings.

I used the Unrestricted 2pass Anime_Toons preset and upped bitrate to 2000 for the encode.

Carpo
26th December 2009, 11:01
i have had this with some dvds i have backed up, megui picks TIVTC to de-interlace with, but the result are poor, if the dvds are interlaced (which i find out from DGMPGDec) i just select yadif to do the de-interlacing and get cleaner de-interlaced material, TIVTC seems to leave interlaced frames in there (i see lines on certain things still)

street1030
26th December 2009, 17:58
now that i think about it....every frame looks like this. Even frames with no motion. It shouldn't be a deinterlacing problem right?

Here's my avs script and encoder settings if anyone has a clue.

DGDecode_mpeg2source("F:\Encoding\DVD 1\DVD 1.d2v", info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
tfm(order=1).tdecimate(mode=1,hybrid=1)
crop( 4, 2, -4, 0)

BicubicResize(720,480,0.333,0.333) # Bicubic (Soft)
mergechroma(blur(1.3)) # Little Noise

--------------------------------------------------------------

program --profile high --preset fast --pass 2 --bitrate 2000 --stats ".stats" --slow-firstpass --thread-input --deblock 1:1 --bframes 16 --b-pyramid --no-weightb --direct auto --b-bias 0 --scenecut 40 --ref 16 --rc-lookahead 40 --no-mbtree --merange 32 --me tesa --subme 9 --partitions all --trellis 2 --psy-rd 0.6:0 --no-dct-decimate --output "output" "input"

Carpo
26th December 2009, 22:56
looks like TIVTC - tfm(order=1).tdecimate(mode=1,hybrid=1) - that to me says hybrid film/interlaced. Mostly interlaced, which i had issues with, select interlaced from the menu and yadif should be selected, do a test render with that and see if you find it more acceptable, if so do the whole film that way :)

quantum5uicid3
27th December 2009, 04:06
program --profile high --preset fast --pass 2 --bitrate 2000 --stats ".stats" --slow-firstpass --thread-input --deblock 1:1 --bframes 16 --b-pyramid --no-weightb --direct auto --b-bias 0 --scenecut 40 --ref 16 --rc-lookahead 40 --no-mbtree --merange 32 --me tesa --subme 9 --partitions all --trellis 2 --psy-rd 0.6:0 --no-dct-decimate --output "output" "input"

i dunno anything about deinterlacing but i can tell you that your x264 settings are very illogical. i would use the newest megui/x264 and change it to.

program --tune animation --pass 2 --bitrate 2000 --stats ".stats" --slow-firstpass --thread-input --bframes 16 --b-pyramid normal --ref 16 --merange 32 --me umh --direct auto --subme 9 --partitions all --trellis 2 --output "output" "input"

and if it's too slow, i would start by turning off --slow-firstpass

Carpo
27th December 2009, 15:31
i would just use program --profile high --level 4.1 --preset veryslow --tune animation --pass 2 --bitrate 2000 --stats ".stats" --thread-input - and leave the rest as x264 will handle all the rest, that's what the profiles are for :) Obviously you can change the level and pre-set to suit you hardware

street1030
28th December 2009, 20:01
Ok I changed the settings to

program --profile high --preset veryslow --tune animation --pass 2 --bitrate 2000 --stats ".stats" --slow-firstpass --thread-input --output "output" "input"

Had a few errors but I found the solutions on the googlebot.

With the new x264 settings the video turns out the same. I've tried so many deinterlacing combinations and it turns out the same. Anyone know of any deinterlacing guides I could follow? I'd really like to learn how to do it myself instead of guessing.

Adub
28th December 2009, 22:24
Sounds like you have a crappy source. Post a sample of the original DVD's and we shall see what scripts we can rangle up in order to fix your problem.

street1030
28th December 2009, 22:47
Link to the source is a few posts down.

quantum5uicid3
29th December 2009, 00:51
! C:\Users\me\AppData\Local\Temp\Sample-1.rar: CRC failed in VTS_01_1.VOB. The file is corrupt

please use dgindex to demux a clip of the video out of the VOB

Carpo
29th December 2009, 10:52
http://neuron2.net/dgsplit/dgsplit11.zip <-- use that to split a bit of the vob

street1030
30th December 2009, 01:23
Ok heres another upload of the source. demuxed video link

http://www.megaupload.com/?d=IQ88W7FW

Watching the source it still looks pretty doodoo maybe it is a bad source. What do you guys think?

turok
30th December 2009, 02:22
Bad source/DVD. Yadif on that looks horrid jagged lines very present... Get rid of slow first pass it will not help you. Also noticed you are using BicubicResize(720,480,0.333,0.333) # Bicubic (Soft) any reason why you don't want to do a LanczosResize instead? You might make it look better with LanczosResize than Bicubic. Lastly the resolution is 720x480 the bitrate being 2000 is quite unreasonable why are you doing that???? Waste of Video Bitrate and ur gonna make ur file a bit too big. make it at least 1300-1500 and 1500 being the max u will increase it lol I backed up a dvd whose duration is much longer (something like 27-30 minute total video) and its end bitrate was 1309 or something like that lol came out perfect.

Well enough of that well yeah drop Bicubic, go with Lanzcos. Change that Bitrate to somewhere around 1300-1500. After reviewing ur sample source although it is decent to look at it could well be a bad source. If ur gonna denoise make it more than little don't do merge chroma it may do more worse than good. other than that thats all I guess maybe change in the x264 settings the me:uhm to esa or tesa that helps a bit.

(Edit) I forget to ask this but... What did you choose for a Constant Rate Factor? btw its crf=## if ur wondering.

street1030
30th December 2009, 02:58
I did some reading and I heard Bicubic was a good resize filter for anime. Then again a bunch of people were saying Lanczos also. I myself have no clue what the difference is so that's why.
Thanks for the recommendations. I'll give them a shot and see...but I do think the source is crap.

I guess I can change to tesa also because I'm looking for high quality...don't really care about encoding time.

and the constant rate question...I did unrestricted 2 pass encoding not constant quality so they don't have a CRF right?

turok
30th December 2009, 03:32
I did some reading and I heard Bicubic was a good resize filter for anime. Then again a bunch of people were saying Lanczos also. I myself have no clue what the difference is so that's why.
Thanks for the recommendations. I'll give them a shot and see...but I do think the source is crap.

I guess I can change to tesa also because I'm looking for high quality...don't really care about encoding time.

and the constant rate question...I did unrestricted 2 pass encoding not constant quality so they don't have a CRF right?

..... What -_-'? Where did you hear that? Thats a load of BS. Maybe for doing upscales on anime but other than that Bicubic terrible for anime. With Lanzcos the picture is more defined and sharper than bicubic which most anime watchers prefer.

2pass encoding does use crf. crf can decide whether the video looks good or bad depending on source and what value do you set it. Let me know what crf did u set and I will tell you if its good or not. I encode mostly Anime so I know what I speak of.

[Edit] almost forgot about the jagged lines they need to be antialiased. People tell me that it is just one is not using the right DeInterlacer but that's BS. Well with Yadif u will get them jagged lines try KernelDeInt NOT THE ONE MEGUI PROVIDES, google that filter. and read its readme u may find that it deinterlaces just fine and doesn't come up with the cursed jagged lines. how did u first deinterlace?

street1030
30th December 2009, 06:29
Still not seeing the CRF anywhere. here's the x264 settings megui spits out at me.

program --profile high --preset veryslow --tune animation --pass 2 --bitrate 1500 --stats ".stats" --slow-firstpass --thread-input --deblock 1:1 --bframes 16 --direct auto --b-bias 0 --scenecut 40 --ref 16 --rc-lookahead 40 --no-mbtree --merange 32 --me tesa --subme 9 --partitions all --trellis 2 --psy-rd 0.6:0 --no-dct-decimate --b-pyramid normal --output "output" "input"

And for deinterlacing I just selected random stuff in megui till it looked the best to be honest. came out with

tfm(order=1).tdecimate(mode=1,hybrid=1)

i tried a few different ones and it still didn't work. tried the one you suggested a while back didnt work. Going to search for this new one in your last post.

Carpo
30th December 2009, 13:39
http://neuron2.net/kerneldeint/kerneldeint.html - although it says

Kurt B. Prünner has created an evolved version of KernelDeint() called LeakKernelDeint(). It is low-level optimized and provides some useful new functionality. His is the preferred version to use. My original version is retained here for academic and historic purposes. Following is Kurt's distribution, which includes source code.

up to you to decide :)

@turok - seeing as you know a bit about encoding anime - you ever use the noise filter on it?

street1030
30th December 2009, 19:32
Ok I tried deinterlacing with LeakKernelDeint and the result was far worse than when i was trying TDeint. I even fooled around with the threshold settings and whatnot but no luck. This is a good challenge but now I remember why I never stick to encoding lol. I have to be a perfectionist.

turok
30th December 2009, 19:46
http://neuron2.net/kerneldeint/kerneldeint.html - although it says

Kurt B. Prünner has created an evolved version of KernelDeint() called LeakKernelDeint(). It is low-level optimized and provides some useful new functionality. His is the preferred version to use. My original version is retained here for academic and historic purposes. Following is Kurt's distribution, which includes source code.

up to you to decide :)

@turok - seeing as you know a bit about encoding anime - you ever use the noise filter on it?

@ carpo

On the sample or in General? After reviewing the video at least 3 times I don't think it would need a noise filter but maybe an undot filter for dot crawls wouldn't hurt (to be on the safe side). btw thx for putting that link up I forgot where I got that filter from was gonna add that link myself. Well as long as yadif isn't used for DeInt then no noise filter is required but if street1030 does plan on it then a noise filter is required. Some jagged lines get help from noise and so even if let's say that street1030 uses SangNom or TIsophote or some Antialiasing script the jagged lines could still be present by noise alone.

@ street1030
I see your issue. Either I am looking for it wrong or I can't find it either that is wierd why is it not on MeGUI? Well unless you feel like switching a GUI good luck to you I don't use MeGUI I'd recommend StaxRip for all video encoding. If your gonna stick with MeGUI then the settings ur using are okay dont mod the x264 settings u just recently put its good. TIVTC alot of dudes tell me or Decomb is a must for anime as anime not interlaced it's usually "telecined". Do an analyse again and tell me what megui suggests to use. Also if you weren't reading the above text try out some AntiAliasing filters the jagged lines issue. I might do an encode on ur sample but just to see what your problem is.

[edit] I thought I said NOT to use megui's kerneldeint..... more accurately LeakKernelDeint that one u should never use.

Carpo
30th December 2009, 20:40
@Turok - as to the noise thing, i mean in general, or do you mean if megui says to use TIVTC then don't bother, but if it says yadif then use undot() , planning on doing some anime encodes, think on most it said TIVTC before, but some yadif, so just want to be sure, don't want go wasting my time, Ghost in the shell + 2nd gig and ergo proxy, if that helps, they should be quite clean and free of noise, i just want to get a good image :)

turok
30th December 2009, 21:01
@ carpo

Some dvds were handled bad. I haven't encoded the names u just put up so I wouldn't know how they are the quality and noise varies. The last two anime dvds I've worked with had some serious issues. the first one being that Not only noise was a problem but so was jagged lines which I still couldn't fix as of today as the jagged lines aren't created from deinterlacing they were there to begin with D:. So yeah With those two dvds I worked with Yadif was the worst option to take and TIVTC could be handled only wih the 2nd dvd while I just went with Kernel DeInt with the other but both had to be TIsophoted. Like I said noise varies as far as dvds. Maybe GitS and EP wont have it I don't now never worked with those series but maybe it won't hopefully for u it won't. and if you ask what year the dvds I worked with the 2nd one released a month ago while the other was 3 months ago.

Well in any case am encoding the sample to see how it would span out and its a bit similar to the first dvd which I kernel Deinted. Damn street1030 without a doubt bad source even if its from a dvd.

Carpo
30th December 2009, 21:26
ok thanks for the info

turok
30th December 2009, 21:32
@ street1030 stick with TIVTC, kernelDeint on this sample was a bad idea lol. Left some Interlaced lines it appears.... If you don't want to use TIVTC then Yadif is ur only sfe bet but if u are gonna use Yadif be sure to add a noise filter and make it moderately strong. Am encoding it again but this time with TIVTC and noise level at heavy to see the result lol.

turok
30th December 2009, 22:22
Here is that encode I came up with from the sample u provided street1030 does it look any better than urs? I doubt it maybe it will maybe it wont but some jagged lines are meant to be there all I did was get rid of the ones that aren't supposed to be there. Encoded sample (http://www.multiupload.com/O9LJ36FNT7)

street1030
30th December 2009, 22:26
Ah well I went to http://neuron2.net/kerneldeint/kerneldeint.html and the author said that LeakKernelDeint was the suggested and better than his so i replaced the one in my Avisynth plugin directory with that one. I guess it's the same.

I read the part you posted about antialiasing. I guess I'll do some searches on that when I get back from work later. I wouldnt mind trying out StaxRip also.

Turok the sample encode you did doesnt look much different than mine. It has to be the source. what deinterlace settings did you use? just curious for when/if i find a better source.

turok
30th December 2009, 23:44
I did TIVTC. Yadif will come out similar if not same result but otherwise like I stated earlier its the source. I'm sorry to say that its the source's fault that it looks the way it is. Get a better source if possible. Is there not blu ray for naruto yet? Once again, btw my settings involved leaving deblock at 0:0 no need to mod it street1030. You said not much difference between mine and urs care to go into detail?

Carpo
31st December 2009, 11:27
@turok - you know you said yadif isn't that good (don't know if you meant on that clip or in general) i tried staxrip last night and it decided to use yadif for ergo proxy ep i did as a test, where as megui used TIVTC :p - staxrip isn't bad but takes so getting used to :)

turok
31st December 2009, 17:29
@turok - you know you said yadif isn't that good (don't know if you meant on that clip or in general) i tried staxrip last night and it decided to use yadif for ergo proxy ep i did as a test, where as megui used TIVTC :p - staxrip isn't bad but takes so getting used to :)

StaxRip takes gettings used to? StaxRip was designed to be noob proof lol so everyone from noobs to pros should be able to use it without a tutorial. Yadif on the sample it created more jagged lines than what was already there although I think SangNom and TIsophote can handle that fine I'd recommend TIVTC. StaxRip I do not think in my experience using it analyses the source it just selects yadif as default. Only thing I recommend MeGUI for is the analysing video source to see what de int or tel would be required, save the script, then load unto staxrip for everything else like.

StaxRip's Quality, filesize and bitrate dialog really helps with encoding especially when trying to achieve 100% quality. Also its a bit up to date with x264 so thats a bonus. You can find the crf on staxrip's gui on 2pass encoding on the last tab on the settings menu for x264 don't know why megui doesn't have it really don't know. Last note carpo u may want to have a go with MeGUI's recommendation u said it chose TIVTC? You could have saved some bitrate and saved like 1-10mb plus the video looking and going much smoother than going with yadif.

Carpo
31st December 2009, 17:52
here's one for you, what crf would you advise for anime, have been doing tests all day and so far im at 12 (from 20) for most things i use 16 (mainstream) but the ep im doing now came out at 60meg (video only) at that setting, if i use crf 10 its near 250meg (video only)

turok
31st December 2009, 18:12
First off how are you encoding the episodes and at what resolution? crf at 10 for me is rather unheard of. that will increase the filesize greatly.

Carpo
31st December 2009, 19:03
have been doing tests using megui all day as i have been reading that anime would require a higher crf value than mainstream films, so i have been doing a few tests dropping down by 2 each time to see what the quality would be, and also how big it would make the files.

As for size, i never resize so its at the dvds 720 x 480 resolution

turok
31st December 2009, 19:59
Unless u crop that 720x480 may change. crf 16-18 is recommended by me lol 16 is as close ur gonna get attaining near lossless encoding not doing a lossless. sorry if that sentence confuses. anything lower than 16 may give u better quality but the differences are negligible or little at best. crf 18-24 for anything 1280x720 or higher.

street1030
31st December 2009, 20:07
Quick question before I have to go back out. If you do crop from 720x480 do you recommend resizing at all? if so upscaling or downscaling. Most animes I see are at a lower res than 720x480 which means they downscaled. Been wonder about this whole Clever Anamorphic Encoding where it scales to be mod16. I was reading and the only benefit i could see is that it made the video compatible on more hardware.

turok
31st December 2009, 20:43
Quick question before I have to go back out. If you do crop from 720x480 do you recommend resizing at all? if so upscaling or downscaling. Most animes I see are at a lower res than 720x480 which means they downscaled. Been wonder about this whole Clever Anamorphic Encoding where it scales to be mod16. I was reading and the only benefit i could see is that it made the video compatible on more hardware.

Thats a pretty good question you asked there street1030. Well... Hm... It's pretty much up to you man. Personally its alright to upscale since a cropped 704x464 back into a 720x480 isn't really that noticeable only to few but otherwise yeah go for it if ya ant but any higher than 16 upscale then its noticeable. Downscaling is never a problem just make ur whatever resolution or DAR u decide upon reflects the anime ur doing. If Naruto is widescreen sd then make the resolution widescreen like 720x480 or 848x480 although I find 848x720 ridiculous. Well anywho once again its really up to the person encoding I can't tell you ur own preference thats the thing.

creamyhorror
1st January 2010, 01:13
For quality, do not resize. Resizing damages detail, except maybe in 2x resizes. Simply crop to mod4 and encode anamorphic. If a source is anamorphic, make an anamorphic encode.

For deinterlacing/IVTCing properly, you're asking in the wrong forum. The right folks to ask are in the Avisynth Usage forum.

turok
1st January 2010, 02:20
For deinterlacing/IVTCing properly, you're asking in the wrong forum. The right folks to ask are in the Avisynth Usage forum.

Really? Just about all the encoders I know tell me to come here for Help including Avisynth help. Especially this one guy I know who encoded since VHS lol.

creamyhorror
1st January 2010, 15:01
Really? Just about all the encoders I know tell me to come here for Help including Avisynth help. Especially this one guy I know who encoded since VHS lol.
"Here"? This is a subforum for MPEG-4 GUIs, not Avisynth, and deinterlacing and IVTC are handled by Avisynth in most of these GUIs. The Avisynth Usage subforum has the people who know how to deal with any kind of source issue.

dstln
1st January 2010, 17:52
have been doing tests using megui all day as i have been reading that anime would require a higher crf value than mainstream films

Some people say it's extremely compressible and others say it's really hard, eh? :P Honestly it would just completely depend on what you're doing.

Standard simple tv animation/anime should be extremely compressible (eg: stuff you see on tv which looks like it's made in flash)

Detailed, heavy motion, grainy anime movies would be just as hard to compress as detailed, grainy, heavy motion live-action movies (eg: something like Akira)

street1030
1st January 2010, 21:22
For quality, do not resize. Resizing damages detail, except in 2x resizes. Simply crop to mod4 and encode anamorphic. If a source is anamorphic, make an anamorphic encode.

For deinterlacing/IVTCing properly, you're asking in the wrong forum. The right folks to ask are in the Avisynth Usage forum.

Ok so crop to achieve mod4. and about the wrong forum thing...i myself was wondering which I should post in before I did...chose the wrong one i guess. If we could only get it moved.

turok
1st January 2010, 21:58
Ok so crop to achieve mod4. and about the wrong forum thing...i myself was wondering which I should post in before I did...chose the wrong one i guess. If we could only get it moved.

you could always ask a moderator...

Guest
22nd March 2010, 19:40
@street1030

Do not delete entire threads after others have responded.