Log in

View Full Version : ways to improve video quality in Gknot???


cogd115
13th October 2003, 18:29
I recently encoded L.A Confidential (about 145 minutes) and In the Name of the Father (133 minutes). I set the target output file size at 2100mb for both. The latter went well and came out at roughly at 2050mb with solid video quality. However, I can't say the same for LA Confidential. When I first encoded it some time ago, it came out at about 1750mb with video quality less than I was hoping for. So, I encoded it again with some changes in setting so that it has more pixels and bitrates (setting my target output size higher than 2100mb). But, I got about the same result. The output file of a bit less than 1800mb and no improvement in video quality. So, I gather that is the best you can get. Or, is there anyway to adjust Gknot setting to improve the quality? If that is the best I can get, then could anyone explain or show me a link as to why LA Confidential with bigger vob's (even after taking the time difference into consideration) and better looking in dvd playback than In the Name of the Father does not give out better encoded video quality?

Thanks in advance..

piscator
15th October 2003, 00:38
Make sure you run a compressability test before encoding. That gives you a good idea how well the final quality will be.

What you can do in GKnot is:
+ use smaller output resolution
+ use less bitrate for your audio.
+ use different filters, e.g. resize filters or if the thing
is interlaced make sure to de-interlace or it will compress
badly.

What you can do in DivX
+ use bi-directional frames
+ use GMC
+ use psy-vis
+ use QPel if you like (which I don't)
+ use slower encoding speed (5.1)
+ run multiple passes

As a general rule of thumb, I can encode:
+ 90 mins of video on 700MB with mp3-128 at proper quality.
+ 50 mins of video on 700MB with ac3 sound at high quality.

Make sure to check the guides on these options.

greetz,
Piscator

Soulhunter
15th October 2003, 17:54
What you can do in GKnot is:
+ use smaller output resolution
+ use less bitrate for your audio.
+ use different filters, e.g. resize filters or if the thing
is interlaced make sure to de-interlace or it will compress
badly.
Ok, using filters is a good idear...

But why using a smaller resolution ???

And why using less bitrate for the audio ???

Same question for mentioned DivX settings !!!

Because, it looks like cogd115 wrote that his/her resulting file size was already too low...

1800MB was it, but it should be 2100MB !!! :confused:

Maybe the codec is already "maxed-out" !?!

Info here !!! (http://forum.doom9.org/showthread.php?s=&threadid=24584)

I think use a higher res. would be a better idear...

If you have enough time, try this AviSynths script !

#
# INPUT()
#
# DCT FILTER()
# CROPPING()
#
# LancozResize # 150% of your desired size !
# Temporalsoften() # value depends on source !
# Unfilter() # usual value ! Example: (16,8)
# MSharpen() # slight value ! Example: (15,20)
# LancozResize # Your desired size ! (100%)
# AddGrain() # slight value ! Example: (1,0,0)
# Unfilter() # slight value ! Example: (8,4)
#
# Additional stuff...
#

I don't have this movie, so I don't know if this script works well with it... ;)

If not... I said, try it only when you have enough time ! :D

PS: This script should be used for non-interlaced (PAL) stuff !

Bye

Tuning
15th October 2003, 18:04
Hmm.....2 pass encoding in Gknot is meant to produce the required size files.Even if u have different compressibility,u can control final output size.

Can u specify what video type are these movies?

JensG.
15th October 2003, 21:44
I encoded LA Confidential a long time ago, but I remember it was highly compressible. So I understand why filesize is smaller than calculated, but I do not understand why it is worse quality than expected.

JensG.
15th October 2003, 21:52
@Soulhunter

What is the reason behind your avisynth script? As I understand it the video gets blown up, softened, cleaned from introduced artifacts, sharpened, shrinked, noised and artifact-cleaned again.
So you add artifacts and remove them again. Somewhere else in the forum I read a good depiction of the expected result: sharpened soup.

piscator
15th October 2003, 22:49
Ok, using filters is a good idear...

But why using a smaller resolution ???

And why using less bitrate for the audio ???

Same question for mentioned DivX settings !!!

Because, it looks like cogd115 wrote that his/her resulting file size was already too low...

1800MB was it, but it should be 2100MB !!!

Maybe the codec is already "maxed-out" !?!


@Soulhunter
I apparently misundertood the first post. I thought the problem was about too big filesizes (when I saw them) and the quality they had. Hence the suggestions. I see it's just about undersized files.
So my first point. Do a compressability check and you know what quality to expect. btw, I almost never see any point in making 2100MB. Targetting 2cd's if often more than sufficient to make high quality copies. If you take some much space, what's the point of converting MPEG2 to MPEG4? You always loose some kind of quality there.

And your point to use a target resolution of 150% of the original makes no sense to me at all. What quality gain can you expect to get if the detail is not in the source? It's about the same result as resizing at playback time.

The DivX settings I mentioned favor quality respected to filesize. If you want a max quality encode, I suggest that you do a 1-pass quality encode with Quantizer set to 2.

Of course, Lanczos is a good resize filter if you want to to go for a hight-quality copy. If you want to make smaller files, Neutral Bicubic is a better choice, since it makes the file better compressible (of course, at the cost of sharpness).

As for the rest of your filters, I think it might have some merit with noisy sources. But I don't think that DVD's fall into that category (I assume it was about DVD's).

Otherwise I've to agree with JensG: a bit of garbled soup.

I usually only use Lanczos and Undot (gives about 2% better compressability at almost no more encoding overhead).

greetz,
Piscator

Soulhunter
16th October 2003, 17:07
@JensG.
What is the reason behind your avisynth script? As I understand it the video gets blown up, softened, cleaned from introduced artifacts, sharpened, shrinked, noised and artifact-cleaned again.
So you add artifacts and remove them again.
Ohw... Where to start first ?

1st the processing is not...

-> blown up, softened, cleaned, sharpened, shrinked, noised, cleaned

Its more like this...

-> artifact-cleaning, blown up, noise cleaning, sharpen, sharpen, shrink, noising, sharpen

2nd... Whats the reason behind it ?

Simple, You blow up the picture, because this makes filtering more effective...

Sharpening looks better, when its processed on a larger res. and then gets resized back !

Denoising because, blowing up the res. means also blowing up the noise !!! :D (very bad... ;))

Why adding noise again ?

Its only very thin & slightly noise that is good to prevent blocking in uniform colored, flat areas !

Somewhere else in the forum I read a good depiction of the expected result: sharpened soup.
Ive used nearly the same script for a 4CD MATRIX encode... (res. was 960x384 !!!)

The result was everything else than a "sharpened soup" ! Really I swear it ! :D

We all know that MATRIX is good to compress, but Ive done lots of encodes with this movie... 1CD, 2CD, 3CD, 1/2DVD, 4CD and so on !

This 4CD version was the best so far...

Sure, maybe only for my eyes... (but sometimes even DVD quality is not enough for me ! ;))

Best is you try this script by your self, and THEN tell your opinion !!!


@piscator
And your point to use a target resolution of 150% of the original makes no sense to me at all. What quality gain can you expect to get if the detail is not in the source? It's about the same result as resizing at playback time.
Read my post again please... ! ;)

Theres no target res. of 150% !!! :rolleyes:

It gets only upsized to 150% for "slight" denoising and "slight" sharpening, then back to 100% !!! :D

And as small side info...

Resizing before encoding, is a complete different thing than using the fullscreen-resize of a software player !

The quality gain would come exactly from the details that is already in the film...

Because even with Q2, not all details over-live the compression from MPEG2 to MPEG4 !

As for the rest of your filters, I think it might have some merit with noisy sources. But I don't think that DVDs fall into that category (I assume it was about DVD's).
Uhm...

- Watch what Ive wrote about the "Temporalsoften()" values again... !

- Then read my post to JensG. why Ive used it... !

- And then rethink your post... !

Temporalsoften() with small values (like 2,3,3) does no harm to the most DVD sources !

But all DVD sources are different, so I wrote "value depends on source" !!!

So, also for you... Try this script by your self, and then tell your opinion !!!

If you don't like the result, you don't have to... ;)

If you like it, be happy with it ! :D

Bye

len0x
16th October 2003, 17:20
Originally posted by Soulhunter
It gets only upsized to 150% for "slight" denoising and "slight" sharpening, then back to 100% !!! :D


I don't think you should do that - most of the time you'll be resizing over the maximum resolution (your width is definitely more than 480 pixels) and hence instroducing more artifacts than removing by denoisers...

cogd115
16th October 2003, 18:40
Hmmm, interesting yet out-of-grasp-for-this-newbie talks.. :D

JensG, the video quality of some parts of LA Confidential was less than what I am accustomed to when it comes to rather newer movies (as opposed to classics). Some scenes are relatively blurry, which was the motivation to re-encoding it with bigger target bitrates and pixels.

What I do not understand it that when you do compressiblity check, does it indicate the maximum quality attainable or the maximum quality given the bitrates, the pixels, and what not's? When I did the compressibility check, it did exceed the max (or expressed in red). But, I thought it only said the max quality given bitrates and etc. Quite confusing... To me.. :)

Thanks once again for the comments, guys...

JensG.
16th October 2003, 18:41
Thanks for the detailed answer, soulhunter!

I think about cosmetics as an analogy to your video processing formula. A face with make-up looks good. And so on... ;)

JensG.
16th October 2003, 18:49
@cogd115

If you want to have a filesize of 2100 MB and the compressibilty test gives you a value of more than 100 %, then you simply cannot reach the 2100 MB with the tested parameters. Because you already reach perfect quality with less than 2100 MB. The encode cannot get better than 100 %.
But you can change the parameters of your encode, which is mainly resolution and resizing method. Then you probably will get a comp test of less than 100 % and reach your desired file size.

Soulhunter
16th October 2003, 18:50
@len0x

I know you are a "PRO", so I don't want (or even try) to talk against you... :D

Maybe Ive done lot of test encodes, but I bet You have already done more...

Don't get me wrong, but for ME the results, with this method where good !

So I thought its a try... ;)


PS:

I use this method because Ive used it already for picture/photo stuff a long time ago !

Make a test... Use a sharp resizer for a picture with its normal res. and then the same pic with the 150% (or even 200% or 400%) sharpening -> back to normal method ! Think you will see that the 2nd result is more pleasant...

But as I said before... Different PPL, different favors ! ;)


Bye

len0x
16th October 2003, 18:53
Are you telling that by commenting out first line (first lanczos resize) the result will be significally worse ?

Soulhunter
16th October 2003, 19:05
@JensG.
A face with make-up looks good.
Yap ! And also the prettiest one, looks even better with make-up... :D

@len0x
Are you telling that by commenting out first line (first lanczos resize) the result will be significally worse ?
Sorry ! With "sharp resize" I meant the whole procedere... :D

I meant, you should use a sharpening filter for this test... ;)

PS: Already confused by my own words... :D

Bye

len0x
16th October 2003, 19:14
Well, what I meant is that this script looks good, but if you don't resize first time it will be even better (well, it should, for the reason I said earlier)

piscator
17th October 2003, 00:15
Originally posted by Soulhunter
@JensG.
@piscator

Read my post again please... ! ;)

Theres no target res. of 150% !!! :rolleyes:

It gets only upsized to 150% for "slight" denoising and "slight" sharpening, then back to 100% !!! :D

And as small side info...

Resizing before encoding, is a complete different thing than using the fullscreen-resize of a software player !

The quality gain would come exactly from the details that is already in the film...

Because even with Q2, not all details over-live the compression from MPEG2 to MPEG4 !


Uhm...

- Watch what Ive wrote about the "Temporalsoften()" values again... !

- Then read my post to JensG. why Ive used it... !

- And then rethink your post... !

Temporalsoften() with small values (like 2,3,3) does no harm to the most DVD sources !

But all DVD sources are different, so I wrote "value depends on source" !!!

So, also for you... Try this script by your self, and then tell your opinion !!!

If you don't like the result, you don't have to... ;)

If you like it, be happy with it ! :D

Bye

Ok, I didn't read careful enough. Always difficult ;)
I now see, that you blow up the resolution and shrink it back to desized size later, which sounds dubious to me too. There's bound to be quality loss there. Especially if the first 150% would go over the max source resolution (as also Len0x stated). I fail to see why the filters would have more detail to work on, if you hit over the max source res.

As for temporal soften, I used it before and didn't like it much (blurring as such). But the parameters you use look ok. I guess I've been a bit too aggressive with those in the past. Tweaking around for very DVD is not my taste, though. And since you recompensate later with MSharpen; it sounded to me as blurring and sharpening.

As for Unfilter and Addgrain, I don't have much experience with that. I think I might give this a shot, since I'm quite curious :confused:
# Unfilter() # usual value ! Example: (16,8)
# MSharpen() # slight value ! Example: (15,20)
# LancozResize # Your desired size ! (100%)
# AddGrain() # slight value ! Example: (1,0,0)
# Unfilter() # slight value ! Example: (8,4)
Perhaps a bit TemporalSoften. But as a matter of principle, I don't like the idea to do something with a filter and later recompensate that with another filter.

A while ago, I did some quality test (2 pass) DivX 5.02 slowest, 5.1 standard and 5.1 slowest both passes. And the 5.1 slowest really rocks. Currently I'm trying a 3- and 4-pass with only the last pass to slowest and the other passes to standard speed.

And yes, I know that software player resizers don't compare to to the resize filters in Avisynth. But being always optimistic for future, I expect when higher speed processors get around there will be playback resize filters which do resampling on-the fly :) Or, even better, GPU's that have a DCT for that.
And using ffdshow, you can also do a bit of sharpening up during playback.


quote:A face with make-up looks good.

Yap ! And also the prettiest one, looks even better with make-up...
But it helps a lot, when you don't have to pay for it... :rolleyes:

greetz,
Piscator

Soulhunter
17th October 2003, 15:30
@len0x
Well, what I meant is that this script looks good, but if you don't resize first time it will be even better (well, it should, for the reason I said earlier)
Maybe I do a comparison with some more sources... ! ;)

Could be that this method looks only good for some special movies (like MATRIX) !?!

PS:

Have you tryed mf's SharpTools ???

Gives a even better result when increasing the resolution... ! :D


@ piscator
I fail to see why the filters would have more detail to work on, if you hit over the max source res.
No, not more detail to work with...
But interpolated sharpening looks much better than normal sharpening ! ;)
Perhaps a bit TemporalSoften. But as a matter of principle, I don't like the idea to do something with a filter and later recompensate that with another filter.
Ok, but when you don't use "TemporalSoften()" I think its better to use "Blockbuster()" instead of "AddGrain()" ! ;)
I almost never see any point in making 2100MB. Targetting 2cd's if often more than sufficient to make high quality copies.
If you really see no point in making 3CD encodes...

Ill bet, something like this (http://forum.doom9.org/showthread.php?s=&postid=382500) will shock you ! :D

PS:

About ffdshow's intern resize...

Its really fine...

Resizing the picture to 1024' res. with luma/chroma sharpen rocks !!! :D

But its a CPU-killer to... :(

Bye

piscator
19th October 2003, 07:41
Originally posted by Soulhunter
If you really see no point in making 3CD encodes...

Ill bet, something like this (http://forum.doom9.org/showthread.php?s=&postid=382500) will shock you ! :D

PS:

About ffdshow's intern resize...

Its really fine...

Resizing the picture to 1024' res. with luma/chroma sharpen rocks !!! :D

But its a CPU-killer to... :(

Bye

Yes, I saw the discussion. A lot of filter-happy :p people! Though, it doesn't have anything to do anymore with retaining the quality of the source. Looks more like editing the source to get something you like more. I would bet that if you start working on a decent existing encode and go filter-happy and blow it up again, you could get about the same results. I've a revolutanary idea. Why not use uncompressed AVI. I bet you could hit the 7 DVD limit instead of a 7 CD limit :D But, I'll try to play around a bit with the above filters.

btw, I use 3 or 4 CD encodes but usually only for movies more than 3 hours, which are rare.

Ah, and it's good to put your processor a bit to work during the luma/chroma playback. That puts your lazy processor a bit to work. Otherwise you would get the feeling that you bought your fast processor for no purpose at all :devil:

greetz,
Piscator

Tuning
19th October 2003, 08:33
I've a revolutanary idea. Why not use uncompressed AVI. I bet you could hit the 7 DVD limit instead of a 7 CD limit

:D :D :D :D :D

Include UncompressedPCM WAV as sound.;) ........

........And get into Guiness Book of world records for creating a 2hr movie in 13(may be greater) DVD discs.:D :D

Soulhunter
20th October 2003, 17:00
I've a revolutanary idea. Why not use uncompressed AVI. I bet you could hit the 7 DVD limit instead of a 7 CD limit
No need, no need for uncompressed AVI... We have HuffYuv !!! :D

But for the future...

Encoding HD-contend from blueray-Disc's to DivX6 on 3x DVD-R !!! :D

Who knows... ! ;)


I think we should stop aiming for 1x,2x,3x CD-R encodes, and head over to 1/2 or 1x DVD encodes... !!!

DVD burners are cheap now, and blank DVD-Rs also !!!

So why aiming for CD size ??? :confused:

Just save up some money, and buy a DVD burner... ! ;)

Bye

Beastie Boy
20th October 2003, 20:07
I think we should stop aiming for 1x,2x,3x CD-R encodes, and head over to 1/2 or 1x DVD encodes... !!!

I agree. All my recent encodes are 1/2 or 1 x DVDr size, full resolution with AC3 soundtrack. Why compromise.

Cheers, Beastie.

Buddy Casino
21st October 2003, 00:55
I had that problem of sucky-quality-at-high-bitrates too. Simple solution: turn off psy-vis (the computer-manipulated colors of "Minority Report" gave me something that was even to big for a DVD-R, i had to cut some of the credits in order to burn it), i usually used about 4 CDs for a very good encode (with 2*5.1 AC3 streams, of course). The solution i found to be much easier and less time-consuming: buy a DVD burner and InstantCopy and never use DivX again. *g* No subtitles anymore with subrip, no experimenting around with the best DivX settings, no software compatibility problems etc. I don't want to miss it anymore.

Tuning
21st October 2003, 04:06
Welcome Buddy Casino,

I have same opinion as yours.If u have a rip of 1xDVD size then what is the purpose of MPEG-4 Compression.Just burn the original DVD to another one.Time savings,CPU usage savings...and no need of more complex thinking of- what will be the best option in XviD config....to get a perfect rip. :D

i usually used about 4 CDs for a very good encode
I think you are in immediate necessity of one such burner.


-Tuning

Beastie Boy
21st October 2003, 07:37
If u have a rip of 1xDVD size then what is the purpose of MPEG-4 Compression

It would be interesting to see which gave the best quality. Lets say your source VOBs are 7GB, too much for 1 disc. Would it be better to recompress/transcode with MPEG2 or fill 1 DVD using DivX/Xvid/WMV/whatever.
As an example, I experimented with Terminator 2 using DVDShrink. The transcoded result looked very blocky in places. The same movie recompressed using MPEG4 was absolutely perfect.
I didn't try recompressing to MPEG2 and it would be good to see how comparable the quality was.

Cheers, Beastie.

Buddy Casino
21st October 2003, 13:34
If we talk about 1 DVD-R encodes, MPEG-4 wins in those cases where the pure videodata of the mainmovie is really about 7GB (and not just a ton of extras), as it is the case with "Apocalypse Now Redux". Thats why i decided to use DVDFab and split this one to 2 DVD-R. But i noticed something else: on DVDs that are already not very well encoded, lets say on blocky cheap single-layer discs, the post-processing of MPEG-4 can improve the perceived quality very much. The quality seems better than the original DVD! (example: german version of "Akira", bad "Laser Paradise" disc)
Of course, your results can vary greatly depending on the source material: as we all know, DivX has problems with big surfaces that have a very similar color. I noticed this on an encode of "Traffic" in the desert scenes. They used a filter there that makes everything orange-colored, and it is incredible how blocky these scenes are in DivX. It also depends on the encoder/transcoder you use for DVD-backups, i found DVDShrink to be far inferior to InstantCopy with "High Quality" on. Maybe you should try this one...

Soulhunter
21st October 2003, 18:24
About DivX's problems to encode stuff with big uniform/similar colored arears...

Have you tried "Blockbuster()" or "AddNoise()" to prevent blocking in this areas ???

Blockbuster for medium bitrates... (2000kbps or less @ 720x* res.)

AddNoise for high bitrates... ( 3000kbps or more @ 720x* res.)

Could help to prevent this blocking ! ;)

Not always, but often... Try it for your self !!! :D

Bye

Maxim Maximov
22nd October 2003, 19:18
How I can use avs filters like "Blockbuster" in Gordian Knot?

Soulhunter
23rd October 2003, 19:10
@Maxim Maximov

First you have to download them... :D

Then add them in your AVS ! ;)

Like this:

BlockBuster(method="noise",block_size=8)

Or this:

AddGrain(2,0,0)

Bye