digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   Optimal Script V3: here it is... (http://www.digitalfaq.com/archives/encode/5591-optimal-script-v3.html)

Dialhot 09-14-2003 06:07 PM

Optimal Script V3: here it is...
 
Okay. While answering to a lot of threads there (and screwing up a post from vmesquita - I appologize again ;-)), I was working on a new script to use with AVi->KVCD encoding.

There is the script :
Code:

AviSource("movie.avi",false)
BlindPP(cpu=4)
Blockbuster(method="noise",detail_min=1,detail_max=3,variance=0.1,seed=1)
ATC(2,3,5,0.5,false)
GripCrop(HEIGHT, WIDTH, overscan=1, source_anamorphic=false)
GripSize(resizer="LanczosResize")
Undot()
TemporalSoften(2,7,7,3,2)
DCTFilter(1,1,1,1,1,1,0.5,0)
GripBorders()

I tested it with a 480x480 target resolution. You must turn off all postprocessing done by codecs (Divx or Xvid) to use this script. That is important.

Here are the results of benchmark I did :

benchmark 1: Finding CQ with CQMatic for a 1h30 Divx movie

Script V1 : CQ = 74.62
Script V2 : CQ = 71.2
Script V3 : CQ = 74.13

benchmark 2: time and file size of the encoding of one minute from an Xvid movie (CQ=70 for all)

Script V1 : time : 2'47" - file size : 3370
Script V2 : time : 2'39" - file size : 3530
Script V3 : time : 2'46" - file size : 3362

benchmark 3: visual evaluation of the results of the benchmark #2

Script V1 : Some blocks presents but lot of details are killed (berely impossible to see eyes of people in second plan)

Script V2 : Lot of blocks, lot of details. But quality is somehow poor.

Script V3 : Same blocks than V1 but picture a lot more sharpen (close to V2).

I let you play with this.

Dialhot 09-14-2003 08:24 PM

Please note that I've just modified some values in the script. I you took it before this present post, check the new script.
Thanks !

(the new values result in less mosquitoes and a smaller file. In fact I deed a mistake in the previous post on the variance of the noise - 1 insteed of 0.1 !)

vmesquita 09-15-2003 08:50 AM

Dialhot,

Update the Optimal Script post. :D I have been using this combination of filters for a while (the same filters you suggest, just different order and an extra blockbuster, and some different parameters) and they were giving me great results. I guess that with this script you suggested results should be even better! I can't wait to try! :D

[]'s
VMesquita

Dialhot 09-15-2003 10:05 AM

In fact yesterday when I saw you used this combination, I was smiling as you told you should not use it, and I know you were a little wrong. After you post an other thread telling that in fact, that's a good combination : that removed part of the surprise of "my" new script :-).

n fact you're right, all is in the order and values. My goal was to have a visual result on sharpening close to V2 but with file size and block removal of V1. I think I find somethign correct.

But everything ask to be enhanced. So... go to work :-)

incognito 09-15-2003 01:15 PM

Whenever I try to encode at 480x480 with any script I end up with a stretched picture. Im currently working with an avi encoded at 640x256. What can I do to the script to get it to fit my target value of 480x480 without stretching the picture? Also how do I turn off all postprocessing done by codecs?

Dialhot 09-15-2003 03:27 PM

Steched ? Did you think to put "source_anamorphic=false" into the gripcrop line ? Because I do not know a lot of avi that are anamorphic :-)

bigggt 09-15-2003 03:35 PM

Having trouble with Blind PP line

Tmpge error

Quote:

Blind PP need mod 16 width
I just copied and pasted and left as blind pp(cpu=4),don't know if i have to change anything also how do you shut off the divx and xvid post processing

thanx

Dialhot 09-15-2003 03:38 PM

How, didn't know that. My soruce was already with a width mod 16.

In this case, put all filters (blinbPP, blockbuster and ATC) after gripcrop and gripsize. But this solution has to be tested : result can't be predicted.

vmesquita 09-15-2003 03:49 PM

I guess blindpp() won't work right if you resize the clip, because it uses the DCT blocks of the picture to do post-processing. What I do in this cases is change the avisource line for something like this:

AVISource("mymovie.avi").addborders(0,8,0,0)

Please check the size of your source to see if it is the height or the width that is not divisible by 16, and add 8 pixels in that direction.

This extra 8 pixels of black borders will eventually be removed during gripcrop.

[]'s
VMesquita

Dialhot 09-15-2003 04:32 PM

Quote:

Originally Posted by vmesquita
This extra 8 pixels of black borders will eventually be removed during gripcrop.

Hey, that's right :-D ! That is very smart. Well done ! :-)

bigggt 09-15-2003 04:37 PM

i tried it with a few different avi's and it works fine the avi i'm having trouble with has a framerate of 23.988,could this be the problem.

@ vmesquita

which is height and width in the addborders(0,8,0,0)
:imstupid:

this is what it says in tmpge MPEG-1 356x56 24fps CQ 63.53

Dialhot 09-15-2003 05:55 PM

Quote:

Originally Posted by bigggt
which is height and width in the addborders(0,8,0,0)

AddBorders(clip, int left, int top [, int "right", int "bottom"] [, int "color"])

But be carreful to that :

Letterbox(clip, int top, int bottom, [int left], [int right], int "color")

Quote:

:imstupid:
The best way to change it is to RTFM of avisynth.
It's delivered with avisynth or you can find it on the avisynth.org site.

incognito 09-15-2003 05:56 PM

Quote:

Originally Posted by Dialhot
Steched ? Did you think to put "source_anamorphic=false" into the gripcrop line ? Because I do not know a lot of avi that are anamorphic :-)

I've tried that and the film is still streched. Any other ideas?

Dialhot 09-15-2003 06:00 PM

With or without the source_ana=false, you have the same streching, or does the thing change between the two ?

Can you copy exactly the script use use there ?

Do you have a 4:3 or a 16:9 TV set ?

incognito 09-15-2003 07:59 PM

I have both a 16:9 and 4:3 and the image is the same. Here is my avs:
Code:

AviSource("G:\Ripps\Current\sample2.avi", false)
BlindPP(cpu=4)
Blockbuster(method="noise",detail_min=1,detail_max=3,variance=0.1,seed=1)
ATC(2,3,5,0.5,false)
GripCrop(480, 480, overscan=1, source_anamorphic=false, dest_anamorphic=false)
GripSize(resizer="LanczosResize")
Undot()
TemporalSoften(2,7,7,3,2)
DCTFilter(1,1,1,1,1,1,0.5,0)
GripBorders()

And I've tried other scripts. Ive also gave links pics so you can see for yourself.

SOURCE

STRETCHED

Thanks for any help.

Dialhot 09-15-2003 08:19 PM

Lol. Okay. Excuse me but the picture is not stetched at all.

480*480 is a square. Your TV set is rectangular. The final picture on your TV set will be the equivalent of 640*480 on you PC screen (480*4/3).
So don't worry : everythign is normal there :-)

You can see this in zoomplayer by forcing the A/R to 4:3 for instance.

incognito 09-15-2003 08:23 PM

I never thought to actually burn it and watch it. :lol: It always looked terrible so I tried other things. Thanks. Sometimes the easiest answer is in front of our face.

incognito 09-16-2003 11:57 AM

The script looks fantastic.

Dialhot 09-16-2003 12:48 PM

Okay. So today I change the post "latest optimal script for AVI" and if it's possible, I will reset the poll.

As I go in hollidays tomorrow for 3 weeks, I let you work and/or play with the present script :-).

bigggt 09-16-2003 06:39 PM

@ Dialhot

Quote:

The best way to change it is to RTFM of avisynth
What does RTFM mean

Just Kidding :D ,sometimes its too easy to ask instead of looking on my own

Have a great Holliday

clickit 09-17-2003 12:17 AM

where is the v.3 ?
 
sorry if i'm mistaken but the v3 of optimal script here http://www.kvcd.net/forum/viewtopic....245&highlight=
isn't the same with v2 of optimal script here http://www.kvcd.net/forum/viewtopic....069&highlight=

incognito 09-17-2003 04:12 AM

Re: where is the v.3 ?
 
Quote:

Originally Posted by clickit
sorry if i'm mistaken but the v3 of optimal script here http://www.kvcd.net/forum/viewtopic....245&highlight=
isn't the same with v2 of optimal script here http://www.kvcd.net/forum/viewtopic....069&highlight=

UMM... Ver. 3 and Ver. 2 are different.

J-Wo 09-20-2003 12:03 AM

has anyone tried this with making KDVDs in CCE? I'm wondering if there is a big difference between this one and the one in vmesquita's guide

incognito 09-20-2003 12:14 AM

I just encoded a 2 hour movie with the Ver3 script. DAMN it looks great. Thanks for the script.

vmesquita 09-20-2003 06:22 AM

This script is probably better than the one in my guide since it's actually a tweak from the original Girv script with BlindPP which provides post-processing. I have been using the script in the guide with extra BlindPP in the beginning with great results, so I assume the results with this script will be even better, but I still didn't get a chance to test it.

[]'s
VMesquita

girv 09-22-2003 06:51 AM

Re: Optimal Script V3 : here it is.
 
Woa, see what happens when youre away for a while? A whole new forum just for mpeg4 conversions! Yay :)

BlindPP(cpu=4)
I tried BlindPP when I was doing my original experiments with BB/ATC and thought it only blurred out details (a little) without adding to quality. What advantage did you see with adding it?

ATC(2,3,5,0.5,false)
1,2,4 or even 1,2,3 can be used on high quality sources; ATC can be a little heavy handed at times and introduce temporal blurring artefacts so I try to use the miniumum amount of ATC I can get away with.

Undot()
DCTFilter(1,1,1,1,1,1,0.5,0)
Just curious, what advantage do these give?

/girv

vmesquita 09-22-2003 02:33 PM

Re: Optimal Script V3 : here it is.
 
Quote:

Originally Posted by girv
Woa, see what happens when youre away for a while? A whole new forum just for mpeg4 conversions! Yay :)

Welcome back, Girv!
Quote:

BlindPP(cpu=4)
I tried BlindPP when I was doing my original experiments with BB/ATC and thought it only blurred out details (a little) without adding to quality. What advantage did you see with adding it?
It does post-processing in the image, removing macroblocks and ring artifacts. It does blur the image a little, but definatelly it is worth it.
Quote:

ATC(2,3,5,0.5,false)
1,2,4 or even 1,2,3 can be used on high quality sources; ATC can be a little heavy handed at times and introduce temporal blurring artefacts so I try to use the miniumum amount of ATC I can get away with.
Interesting! I'll do some tests with different parameters to see if it is really bluring too much! :wink:
Quote:

Undot()
DCTFilter(1,1,1,1,1,1,0.5,0)
Just curious, what advantage do these give?

/girv
DCTFilter does a DCT transform and then an IDCT transform. It seems to give more compressibility with no visible effects on the output.

[]'s
VMesquita

Wolfi 09-24-2003 09:05 AM

ATC(2,3,5,0.5,false), should it be used on poor sources only?

If I have a "high quality" divx source, witch values should I use with ATC?

//Wolfi

Siku 09-25-2003 11:23 AM

Quote:

Originally Posted by Wolfi
ATC(2,3,5,0.5,false), should it be used on poor sources only?

If I have a "high quality" divx source, witch values should I use with ATC?

IMO you don't even need to use ATC if you have a hi-quality AVI source. If I have a hi-quality AVI source, I usually drop out some filters which blurs the picture e.g. TemporalSoften.

Of course if you need a good compressibility you can use it, but you'll also lose some details.

Regards,
Siku

girv 09-25-2003 11:31 AM

Quote:

Originally Posted by Wolfi
If I have a "high quality" divx source, witch values should I use with ATC?

The Blockbuster/ATC combination is for sources that exhibit "dancing block" artefacts in areas of flat colour (eg: walls, backgrounds). Turn up the contrast on your source (use VDub to add a brightness+contrast filter for example) and step trhough frame by frame watching flat areas - if you don't see small, 8x8(?) square blocks dancing around then you dont need Blockbuster/ATC.

However most divx/xvid sources I've seen have this problem, so what I do is find an area where the dancing blocks are visible then increase the ATC "strength" from 1,2,3 / 1,2,4 / 2,3,5 / ... until the blocks go away.

Wolfi 09-26-2003 05:45 PM

Newbie quest :twisted: Does the avs. file when I play it in Vdub or WMP show how the m2v output file will look?

You do mean I should view the divx source in viritual dub and not the avs. file ( and look for"dancing block") ?

Why should I turn up the contrast, how much and why should I do it? :)

//Wolfi

vmesquita 09-26-2003 06:23 PM

Quote:

Originally Posted by Wolfi
Newbie quest :twisted: Does the avs. file when I play it in Vdub or WMP show how the m2v output file will look?

Not exactly, because you won't be seeing how the file will look after compression. You should encode a sample and play using VirtualDub(Mod) or any player.
Quote:

You do mean I should view the divx source in viritual dub and not the avs. file ( and look for"dancing block") ?

Why should I turn up the contrast, how much and why should I do it? :)
Dancing blocks is the main reason DivX files looks great on the monitor and awful (in dark areas) on TV. Put the contrat to the maximmum you might see the dancing blocks, you can do that using even the monitor adjust, just don't forget to turn back when you're done.

[]'s
VMesquita

Markymoo 09-29-2003 09:19 PM

Is it not better to use GripSize(resizer="BiCubicResize") instead of GripSize(resizer="LanczosResize") to speed up encoding in this script?

Siku 09-30-2003 11:05 AM

Quote:

Originally Posted by Markymoo
Is it not better to use GripSize(resizer="BiCubicResize") instead of GripSize(resizer="LanczosResize") to speed up encoding in this script?

It might give a little speed-up but LanczosResize gives sharper result than BicubicResize. I think that's why LanczosResize is used in this script.

Regards,
Siku

Wolfi 10-03-2003 06:00 PM

Quote:

Originally Posted by girv
However most divx/xvid sources I've seen have this problem, so what I do is find an area where the dancing blocks are visible then increase the ATC "strength" from 1,2,3 / 1,2,4 / 2,3,5 / ... until the blocks go away.

Do you mean I should find an area with dancing blocks and encode my movie three times, with different values of ATC, and compare the three m2v files? :roll:

//Wolfi

TCB 10-04-2003 03:40 AM

Quote:

Originally Posted by Siku
Quote:

Originally Posted by Markymoo
Is it not better to use GripSize(resizer="BiCubicResize") instead of GripSize(resizer="LanczosResize") to speed up encoding in this script?

It might give a little speed-up but LanczosResize gives sharper result than BicubicResize. I think that's why LanczosResize is used in this script.

Regards,
Siku

I prefer to use the script without gripfit. I'm using the LanczosResize, but fill in the right, prefered dimension (as MovieStacker gives them). This way I know for sure that the aspectratio is always perfect.

So what the advantage of using Gripfit over resizing without using Gripfit?

incredible 10-04-2003 06:32 AM

Hi Phil,

Blockbuster makes "noise" just to give the encoder "informations" when encoding surfaces, just to avoide visible "blocks" during encoding.
... is this right?

So what I don't understand is that you put this Filter in front of your script and perform on the other hand denoisers like temporalsoften etc. afterwards. I mean, ... would'nt kill this the sense of Blockbuster??

:D Thanx

Jellygoose 10-04-2003 09:46 AM

Actually I think so too incredible... I read an explanation for this somewhere from girv I think... I'm not that familiar with DivX Sources, so I really don't know... :wink:

Siku 10-04-2003 12:33 PM

Quote:

Originally Posted by TCB
So what the advantage of using Gripfit over resizing without using Gripfit?

If I understood your question right, you're doing resizing without Gripfit using parameters given by MovieStacker, right? Well, the main reason why I use Gripfit, is that it'll do all the maths automatically. And as far as I know, it's doing the resizing perfectly keeping the right aspect ratio. So all you need to do is to determine the right output resolution and Gripfit will take care of the rest. :)

Regards,
Siku

incredible 10-04-2003 01:57 PM

Quote:

Originally Posted by Jellygoose
Actually I think so too incredible... I read an explanation for this somewhere from girv I think...

So let's check this out ...
I tried to use Blockbuster at the end of the picture-handling routines and it gives me perfect results as explained in the readme of its author. Also when preparing DVD sources to encode them to one CD.
I encoded the first part of a science fiction Saga we all know where much scenes are playing in a dune with light blue sky ...
When I used the Script as shown above it resulted containing some artefacts in the sky and the dune, ... shure cause of the clear fading surfaces within the picture.
Then I put the Blockbuster at the end of the script the artefacts where gone.
Only luck??
Well it ended up with a little less CQ, ... shure when adding a little noise to plane surfaces as Blockbuster does. But the encoding result was very good anyway.

But you never know ... maybe something tricky is going on. :wink:

Where's Phil? Still in Holydays?
Well I think sometime you really need Holydays even from CD Encodings ;-)


All times are GMT -5. The time now is 02:35 PM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2026 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2026 Jelsoft Enterprises Ltd.