PDA

View Full Version : After heavy testing I think I hit upon something for encoding


markrb
18th March 2002, 08:05
AS you can see in my other thread I have been testing heavily on the same chapter trying to come up with the best settings I can. I have made over 35 seperate encodes at different settings and compared them all against the original VOB file. My two biggest complaints when doing a direct compare was video softness and added noise. Whenever I reduced one I tended to increase the other. I started searching for other filters to use and tried several of them with varying results. The most promising was Donald Graft's plugins, but these needed the video to be converted to RGB so that forced me to use yet another filter to return the color back to the original. After all of the filters the CCE speed dropped way down to less then 25% of original. There had to be something better that would give me better speed yet give decent results. I started playing with some of the native Avisynth filters and finally came upon what I think is by far the most promising settings so far. I ended up using 2 Avisynth filters and used CCE's noise reduction as well.

So far the best results have been achieved using these settings.

Bicubic .60
TS 3,1
CCE Noise 12
Sharpen (.6) (This is an Avisynth native filter you need to manually add to the AVS file after the mpeg and TS)

When I compared this against the original VOB file it looked very close. There were some slight jaggies around round objects and background noise was much greater then the original VOB, but compared against an encode without Sharpen and the difference to my eyes was immediate. I intend more tests as I am reporting this after only 2 tests with using Sharpen. Some tweaking of the settings might help.

The encoding speed is much faster then using Vdub plugins, but about 50%-60% slower then not using TS or Sharpen.

I hope that others will test using these settings as a basis and see what you think. Make adjustments when you feel they are needed.

Give this a shot it may change the way you have encoded in the past or it may turn out to be a bust.

Mark

mrbass
18th March 2002, 11:33
I've been using 0.60 per DDogg's posts for quite awhile now. I uncheck anti-noise since dvd source is clean. But if you think a setting of 12 helps I'll try that. Never done TS and don't intend too. Did you shoot some eagle and steal the eyes from the poor bird or what?

saber
18th March 2002, 18:15
Markrb, may I ask (sorry, never played with the AVS script before) the proper sintax and in wich line to include the SHARPEN ?

IGuaNAdoN
18th March 2002, 18:29
Me too ...I cannot seem to get Sharpen to work. I searched the forum...but had not luck. I tried putting it before and after resize and other places... but no luck.

Thanks a million for all your testing.

*EDIT* i can view the avs with sharpen added in media player... but cce crashes when avs tries to load.


peace,

IgGy :D

markrb
18th March 2002, 18:38
This is my avs script with the important addition of sharpen.

LoadPlugin("C:\PROGRA~1\DVD2SVCD\MPEG2Dec\mpeg2dec.dll")
mpeg2source("F:\tweak1\DVD2AV~1.D2V")
TemporalSmoother(3,1)
Sharpen(.6)
BicubicResize(480,360,0.00,0.60)
AddBorders(0,60,0,60)
Edit: Wierd, it worked perfect last night and it plays in media player fine, but CCE only shows a red bar. I gotta work on this.

Remember to change the path to meet your needs.
I haven't decided if this is the best settings yet. I just have liked what the outcome was so far. In the end it may prove to be another bust, but it does show promise.
Remember to compare the final results against the original and not another encode.

Thanks for trying this and if you tweaked the results please tell me what you did and if you think the results where better.

@mrbass This started so innocently. I just wanted to see if at higher bitrates would TS give better results then without. I then did something stupid. Instead of comparing against the first encode I compared against the original VOB. I then compared all the results I had done to that point and found that in every case the image was softer by a good bit then the original no matter what I tried. I decided to see if I could find some setting that would give results closer to the original. Whenever I got rid of the softness I introduced much more noise. Until I started to work with Donald Graft's filters, but they slowed the system way, way down. I then looked into native Avisynth filters and found Sharpen. After testing with it the results look very promising, while speed is slow, but acceptable.

Mark

IGuaNAdoN
18th March 2002, 19:15
this still causes cce to crash... the avs will just not load. the quest is on. i do like the idea of sharpen... very strange that it will not work. i will do some testing.


thank you again.

IgGy

markrb
18th March 2002, 19:59
Sharpen must come after TS. If I don't have it this way CCE will cause a GPF. If I have it the right way CCE will only encode a red line on the bottom of the screen if I use a clean avs file.

I do have the same problem if I use a clean avs file. The file I used successfully had some lines rem'ed out. I tried it again with the lines rem'ed out and without the lines at all. The clean one doesn't work and I have no idea why not. I have posted this bizarre problem in the avisynth forum to see if any of the experts there can help me. In the mean time this really nasty looking avs file works for me:

#Import("xsharp.avs")
LoadPlugin("C:\PROGRA~1\DVD2SVCD\MPEG2Dec\mpeg2dec.dll")
#Loadplugin("D:\DVD\Tweak\tweak.dll","tweak")
mpeg2source("F:\tweak1\DVD2AV~1.D2V")
#tweak(hue=-5,sat=.9,bright=15,cont=.9)
#ConvertToRgb()
#VD_Xsharpen
TemporalSmoother(3,1)
Sharpen(.5)
BicubicResize(480,360,0.00,0.55)
AddBorders(0,60,0,60)


Mark

Holomatrix
18th March 2002, 20:50
markrb, I just need to clarify a bit. Did you only use Bicubic or did you try all and ended up best with Bicubic? because I was always under the impression that if you were downsizing the video (DVDtoSVCD) then Bilinear give best results. http://rilanparty.com/vbb/showthread.php?s=&threadid=13553&highlight=bicubic
Also are you using 1passVBR,3pass...?
Thanks

IGuaNAdoN
18th March 2002, 22:01
yup... i got it to load one time...not sure how :) and cce was going 2.5+ ...way outta my range of RT. I let it finish (only doing 1 chapter) and all i got was a red mess at the bottom. now i cannot even reproduce this result and i know ive tried it many ways. -strange- Good luck with the post in AVIsynth forum! :D


peace,

IgGY :D

markrb
19th March 2002, 01:08
Holomatrix I don't like Bilinear as to my eyes it softens the image way too much. I have heard the same thing that when upsizing use Bicubic, but when Downsizing use Bilinear. I think that does not apply to these type of video's. I have no idea why that started, but I have never once liked any Bilinear encode.

I just found out that if I run TS or Sharpen alone without out the other the AVS file works fine. It's just when they are both in there that it screws up. I haven't seen the results yet to say if it's worth it, but that is the way for now to get Sharpen to work. Remove TS.

Update: Just finished a quick encode with Sharpen (.5) and CCE noise at 10 and it's not bad. A little better then bicubic by itself, but I think I can do better. I am trying it at (.6) now with CCE still at 10. Nice thing is that without TS the encode is faster. Not the full 1.45 or so I normally get, but around .85, which is better then .6 that I got with TS and Sharpen.
It's definately worth a serious look without TS.

Mark

Holomatrix
19th March 2002, 20:46
Cool, I'm going to try an encode soon with these new settings, but, do you keep Image Quality for CCE at 17 and noise is 10?
Can I add the sharpen command when dvd2avi processing is done?
And how many passess are you using with CCE?
Thanks

markrb
19th March 2002, 23:30
I have been doing the testing with CBR since it's much faster and just as good as VBR. I don't care about filesize since I am not planning to burn the tested video and I am only doing a chapter.

Play with the Sharpen Strength it can be anywhere from -1 to 1 and anywhere in between (.1,.2,.3,.45,.55 etc...)and also the amount of CCE noise reduction. You should be able to find a nice combination.
So far CCE noise of 10-15 seems about the best.

I have tried it both before the resize and after, but before the addborder. The one after the resize is a little faster, but common thinking says you get better results before.

You can edit the Avisynth at either of the possbile places in DVD2SVCD, but prefer at video since if I want to make changes and use crash recovery I simply just have to select that point and the edit window pops up.
This is about what your Avisynth file should look like after you edit it.

LoadPlugin("C:\PROGRA~1\DVD2SVCD\MPEG2Dec\mpeg2dec.dll")
mpeg2source("F:\tweak1\DVD2AV~1.D2V")
Sharpen(.6)
BicubicResize(480,360,0.00,0.60)
AddBorders(0,60,0,60)

Mark

pacohaas
21st March 2002, 07:16
first, thanks for all the testing mark.
However, I have found that VFAPI doesn't like your Sharpen code

I couldn't figure outo why VFAPI couldn't finish, I commented out the sharpen command, then everything was ok. Is there just some small thing I am missing here, or is Sharpen just not compatible with VFAPI for some reason? Both avs files play fine in media player btw.

LoadPlugin("C:\PROGRA~1\DVD2SVCD\MPEG2Dec\mpeg2dec.dll")
mpeg2source("E:\trash\DVD2AV~1.D2V")
Blendfields()
# Sharpen(.6)
Crop(6,124,712,258).BicubicResize(476,190,0.00,0.60).AddBorders(2,145,2,145)

markrb
21st March 2002, 20:11
I have never tested it with VFAPI, only with native AVIsynth and CCE 2.5. Never tried it with safe mode.
I have come across much wierdness. It stopped working for me before the resize and I can only use it after the resize now. I have been able to get TS to work if that is before the resize and sharpen is after.

I am speculating that something that DVD2SVCD does is causing this because I can load the AVS file manually into CCE with the way I posted before and it works. I don't know how this could be though because I thought it just loaded the files in and didn't do allot more with CCE.

I found this Sharpen in the Avisynth FAQ on Dividee's page www.videotools.net There are many other filters native to Avisynth that I had no idea about and I want to try them all.

@pacohaas Try it this way instead:

LoadPlugin("C:\PROGRA~1\DVD2SVCD\MPEG2Dec\mpeg2dec.dll")
mpeg2source("E:\trash\DVD2AV~1.D2V")
Blendfields()
Crop(6,124,712,258)
BicubicResize(476,190,0.00,0.60)
Sharpen(.6)
AddBorders(2,145,2,145)

I don't know why, but in regular(not safe) mode this way will work for me while the way you had it won't. It should, but it doesn't.


Mark

IGuaNAdoN
21st March 2002, 20:44
Originally posted by markrb

I am speculating that something that DVD2SVCD does is causing this because I can load the AVS file manually into CCE with the way I posted before and it works. I don't know how this could be though because I thought it just loaded the files in and didn't do allot more with CCE.
Mark


I too thought d2s just loaded the files... but then I thought about... how does d2s know what matrix I have loaded into CCE 2.5?

this may be just another question...

IgGy :D

markrb
22nd March 2002, 00:11
I got a response to my questions regarding the sharpen issue in the Avisynth forum. It seems I am not the only one having this problem and it's not specific to DVD2SVCD. Sometimes it will work one way and at other times it won't. I think this is specific to the Sharpen filter. So if you can't get it to work you are not the only one, but try it at different points in the AVS file before you give up as that seems to make a difference too.

Mark