digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Experimental Revised prediction! (http://www.digitalfaq.com/archives/avisynth/4139-experimental-revised-prediction.html)

kwag 06-24-2003 08:12 PM

Quote:

Originally Posted by vhelp
That's just it. There's no resolution settings.

Of course, It's posted right there 8O :arrow: 528x480
And yes, download this: www.kvcd.net/video.en1 and put it in the Opt directory where you have ToK installed. Make sure you use ToK version 0.0.5.2

-kwag

Racer99 06-24-2003 08:18 PM

Quote:

Originally Posted by vhelp
@ Kwag..
That's just it. There's no resolution settings. Also, I remember seeing
someone's post showing their results, and their resolution was set at
* 704x480 ...(this is what I want to use in my future encodes)
Thanks again.
-vhelp

Hey Vhelp,

The way you get your resolution setting is via your avisynth script. The size you set in there determines the sample encode size for ToK. So if you want 704x480 then load you source in Moviestacker and choose Xvcd and copy and past the Bicubic (or your preference) lines and the Borders or Letterbox lines to the appropriate spots in your script.

So if you want 528x480 then choose 3/4 DVD(Small), etc.

Hope this helps.

Racer99

vhelp 06-24-2003 08:18 PM

@ Kwag... :mrgreen:

Thanks a bunch PAL !! hehe..

I'm sure we'll get it :banghead: or else
-vhelp

kwag 06-24-2003 08:22 PM

Quote:

Originally Posted by Racer99

The way you get your resolution setting is via your avisynth script.

I guess I'm too tired now, and I said "select in ToK 528x480" :oops: Sorry vhelp, thanks Racer :!:

-kwag

ovg64 06-24-2003 08:22 PM

Quote:

Another thing...
I also notice that ToK dumps a bunch of other files in my WORK folder.
Should I be deleting them fater every encode, or project or anything I'm
finished ?? Example:
* video.en1.txt
* video.avs
* video.tpr
* ToK log file

Is it ok to change anything in any of these files, that ToK will be able to
use, if I want to change thing (like you guys seem to be doing)



hey Vhelp toks will just overwrite the video avs n the tok log the others you live alone, infact live everything alone man. :twisted: :lol:

vhelp 06-24-2003 08:27 PM

@ all..

>> hey Vhelp toks will just overwrite the video avs n the tok log the
>> others you live alone, infact live everything alone man.

Alright.., will do everyone PAL's.. :confused:

I'm gonna do some playing around now :screwy:
-vhelp

kwag 06-24-2003 08:33 PM

I'm now starting my "K19" encode (again :twisted: ) at CQ=62.783.
Results in ~5 and a half hours :!:
Just finished prediction on K-Pax and "The Boondock Saints", and it seems the CQ is correct, based on previous CQ values.

@Tenra,
The 10% prediction is being thrown way off by "WHO_KNOWS_WHAT" :lol:
Either AviSynth 2.52, the MA script, Sampler(), or a combination of all :!:
It seems that right now we must stick to a full sampler cycle for prediction.

-kwag

DKruskie 06-24-2003 08:36 PM

I can't seem to find the link to ToK version 0.0.5.2


David

vhelp 06-24-2003 08:38 PM

@ Kwag..

Have you at least tried the scenario I laid out earlier w/ respect to this ??

You know..
Perform an AVIsynth v2.08 and an AVIsynth v2.52 encode, but this time,
leave out the MA parts. REM them out, and perform your CQ test.

If v2.52 performs similary to v2.08, then at least you have your culprit..
MA, ..and you can begin working on tuning it.

What does that sound like ?? feasable ??
-vhelp

vhelp 06-24-2003 08:40 PM

It's right here, DKruskie pal..

* http://www.kvcd.net/hedix/ToK_0.0.5.2.zip

DKruskie 06-24-2003 08:42 PM

Thanks vhelp


David

J-Wo 06-24-2003 08:57 PM

Kwag:
I had no problems with the Faster Tenra Prediction method for my encode of Chicago. This was an xVid, 01:48:52 long. Here were my settings and results:

Prediction Factor: 1.00
Length of Sample: auto (24)
1st group of passes: 1% precision, speed up by 10 times
Predicted CQ: 51.790
Required Video Size: 714,950,948
Final Video Size: 707,818,009
RESULT: 1% difference!

When I went back to full prediction with your modified settings, I got a predicted CQ of 51.250, which would have probably ended up in maybe a 2-3% difference. All this was done with your latest script, your video.en1 file, and ToK 0.0.5.2.

I'm going to try encoding a dvd rip of Superstar next and see what happens.

vhelp 06-24-2003 09:08 PM

hi J-Wo..

just curious.. but, what resolution did you use in that test ??

I asked, because I noticed that low CQ of 51.x and your final size was..
* Predicted CQ: 51.790
* Required Video Size: 714,950,948
* Final Video Size: 707,818,009

Just wondering how does the picuter so far ?? good ??
As I was saying.. I ask because I want to start using 704x480 (or higher)
in my encodes, but I'd like to know from those peoples who have done a
few of these w/ ToK, let me know how well it came out, so I know what to
expect. AT least in the ones (test encodes) I've done, I was quite pleased
w/ the results !! when using 704x480.

Thanks for any input.
-vhelp

J-Wo 06-24-2003 09:43 PM

vhelp:
I'm using 528x480 resolution. I think ever since I changed to avs 2.52 and the MA filtering, I end up with LOW cq's around the 50s or 60s. But the picture is now BRILLIANT. I can't believe how much crisper it is, brighter, more vivid, with hardly any noticeable artifacts (at least on my dinky 23" tv). It's comparable to encodes I did back in the day of avs 2.07 (let's all reminisce, shall we?) with CQ in the mid to high 70's. Kwag or anyone, care to explain why that is?

audi2honda 06-24-2003 09:47 PM

Quote:

Originally Posted by kwag
Quote:

Originally Posted by audi2honda

These aren't the default settings. Why did you choose these?

Because this way you run a full prediction sampler every time, with a .5% accuracy. It takes longer, but in the end, it should prove more accurate.
What settings did you use :?:

-kwag

I used the defaults like this. I'll keep on testing :D

http://www.digitalfaq.com/archives/error.gif

kwag 06-24-2003 10:15 PM

Quote:

Originally Posted by J-Wo
It's comparable to encodes I did back in the day of avs 2.07 (let's all reminisce, shall we?) with CQ in the mid to high 70's. Kwag or anyone, care to explain why that is?

It's all in the Motion Adaptive script, and the way the filters are used :)
It REALLY makes that much of a difference :D

-kwag

kwag 06-24-2003 10:16 PM

@audi2honda,

You're using 2% on that second pass :!:
I think that's too high :roll:

-kwag

J-Wo 06-24-2003 11:26 PM

Kwag:
I'm not noticing a large difference in CQ between the older vs. newer prediction method. I'm encoding Superstar right now, and with the new faster prediction I get CQ 63.566. With the older method 0.5% precision, 63.509. And finally older method 1.0% precision, 63.441. I'll encode all three tonight (1h 34min encode time each!) and see which one came the closest. All three CQs were calculated using prediction factor of 1.0.

audi2honda 06-24-2003 11:41 PM

Quote:

I'll encode all three tonight (1h 34min encode time each!) and see which one came the closest. All three CQs were calculated using prediction factor of 1.0.
I'm doing one after another myself. We'll figure this out one way or another. This MA script makes movies look so good, I j ust want to make the most of my bits :!: :D :D [/quote]

kwag 06-24-2003 11:44 PM

Quote:

Originally Posted by audi2honda
This MA script makes movies look so good, I j ust want to make the most of my bits :!: :D :D

I'm with you 100% :mrgreen:

Krassi 06-25-2003 01:05 AM

Quote:

Originally Posted by audi2honda
length of 15 with samples/minute of 4 or more is painfully slow even on fast prediction. The first pass on my 1.8ghz machine was over 20 minutes 8O

Yes i know :roll: . But its the only way to test prediction, otherwhise the samples are too short and CQ is not precise enough.

kwag 06-25-2003 01:10 AM

@Krassi,

Were you using "Full" prediction, or were you using the fast 100/10 prediction :?:
Because I got innacurate results using the "fast" prediction :!:

-kwag

Krassi 06-25-2003 01:56 AM

Quote:

Originally Posted by kwag
@Krassi,

Were you using "Full" prediction, or were you using the fast 100/10 prediction :?:
Because I got innacurate results using the "fast" prediction :!:

-kwag

I'm using the faster one at the moment. I'll change to the old one after some more tests with the faster one.

kwag 06-25-2003 02:19 AM

Here is my result on "K19" with CQ=62.783 using full prediction.
Wanted file size: 699,875.78
Encoded final size: 679,501 :)
Prediction accuracy of ~2.9%

-kwag

audioslave 06-25-2003 03:55 AM

@kwag
Shouldn't we be able to correct this percent difference by setting the prediction factor to "1,02" instead of "1,00", and by using your previous settings for ToK prediction for the other parameters?
From what I've read about your previous encodes it seems the final encoded file always become ~2.5-3% smaller than predicted. That's why I'm wondering about changing the prediction factor to "1,02". So if we change the factor to "1,02" we should still have a small safety margin.

audi2honda 06-25-2003 04:08 AM

Quote:

Originally Posted by kwag
Here is my result on "K19" with CQ=62.783 using full prediction.
Wanted file size: 699,875.78
Encoded final size: 679,501 :)
Prediction accuracy of ~2.9%

-kwag

eh. will we ever get this right? I assume the reason for the inaccuracy is that the MA script is gaining sometimes huge and sometimes not compression savings on certain scenes depending on how much blur is applied.

Well unless the sampler happens to sample all those scenes the prediction will allways be off won't it? Unless we sample every single frame which isn't possible,

Without the MA script and staic filters relatively the same compression is applied to each frame, but now it's impossible to tell.

sigh :?

Boulder 06-25-2003 04:18 AM

The prediction isn't accurate even with a non-motion adaptive script. I've had correction factors ranging from 0,9 to 1,12 in my many encodes. (PAL in question :wink: )

Boulder 06-25-2003 05:53 AM

PAL in question again:

I just did some experimenting and noticed that if you set the max number of frames in GOP to 25, TMPGEnc still puts max 24 frames in it. This is probably because the 25. frame would be a P frame. If you use the automatic sample size in ToK, it will take 25-frame samples but you'll encode 24 frames in GOP at maximum when you do the final encode (and also in the sample encode).

Maybe this is the thing screwing the PAL prediction up?

audioslave 06-25-2003 06:09 AM

@Boulder
Does TMPGEnc encode PAL movies with 24 GOP even if you run it through ToK? That could be a reason why it's so hard to predict PAL mvies, as you said :wink: !
Maybe there's a way of configuring the video.en1 file so the GOP will be correct for PAL? I don't know...

Boulder 06-25-2003 08:01 AM

TMPGEnc encodes 24-frame GOPs even if you use it manually. You can see this yourself, set the max number of frames in GOP to 25 and encode a clip. Open the encoding log while encoding and you'll see that the last frame in a GOP is a B frame most of the time whereas it should be a P frame if the GOP was 25 frames long. Bitrate Viewer will also tell that the GOPs are 24 frames long. Scene changes are different, of course.

Krassi 06-25-2003 08:21 AM

Quote:

Originally Posted by Boulder
TMPGEnc encodes 24-frame GOPs even if you use it manually. You can see this yourself, set the max number of frames in GOP to 25 and encode a clip. Open the encoding log while encoding and you'll see that the last frame in a GOP is a B frame most of the time whereas it should be a P frame if the GOP was 25 frames long. Bitrate Viewer will also tell that the GOPs are 24 frames long. Scene changes are different, of course.

Yep, you're right 8O . TmpGEnc settings have GOP's of 25, Bitrate Viewer shows 24....
Thats really a strange thing :cry: .

Jellygoose 06-25-2003 09:19 AM

Prediction for PAL is very accurate for me using 24 samples instead of 25 in ToK with a factor of 1.01 and 0.5% precision. :D
I actually always predicted that way, and never had any problems with it...

J-Wo 06-25-2003 09:20 AM

Here are my results for encoding Superstar. The movie was only 1:21:46 long so I set ToK to run 2 samples per minute.

New Faster Prediction (factor 1.00)
Final CQ: 63.556
Required Video Size: 740,688,000
Encoded Video Size: 727,075,060 = 1.8% difference

Full Prediction (factor 1.00, 0.5% precision)
Final CQ: 63.509
Required Video Size: 740,688,000
Encoded Video Size: 724,292,701 = 2.2% difference

Full Prediction (factor 1.00, 1.0% precision)
Final CQ: 63.441
Required Video Size: 740,688,000
Encoded Video Size: 720,945,475 = 2.7% difference

New Faster Prediction (factor 1.03)
Final CQ: 63.813
Required Video Size: 762,909,111
Encoded Video Size: 738,346,386 = 3.2% difference

The reason I did another encode at factor 1.03 is that I like to overburn my discs to squeeze just a biiiiit higher CQ in my encodes. The mpgs at factor 1.00 would all fit perfectly on an 80 min cd, the one at 1.03 just barely requiring overburning. However knowing my CD burner well I know I could've squeezed another 14 megs or so onto my video size. But I guess that's a bit unimportant at this point... :)

So my conclusion? I'm having no problems with the faster prediction! I'm not sure where you're getting problems Kwag. And a factor between 1.0 and 1.03 seems to work for me. At least on this movie.

"....and so it begins."

J-Wo 06-25-2003 09:24 AM

oh, just an addendum to my previous post... I tried DVD2AVI v1.77.3 after reading one of Kwag's post saying to use that with the new avs 2.52 or something, but it didn't seem to work with GripCrop. I didn't bother to try excluding GripCrop because I wasn't quite sure where to put the AddBorders line (ever since the scripts got updated that line is gone!). so I went back to v1.76 and everything worked fine.

audi2honda 06-25-2003 09:34 AM

Quote:

Originally Posted by J-Wo
New Faster Prediction (factor 1.03)
Final CQ: 63.813
Required Video Size: 762,909,111
Encoded Video Size: 738,346,386 = 3.2% difference

So my conclusion? I'm having no problems with the faster prediction! I'm not sure where you're getting problems Kwag. And a factor between 1.0 and 1.03 seems to work for me. At least on this movie.

"....and so it begins."

I don't understand. You are happy with 3.2% short? that's a lot of wasted space. That also seems to be your worse result.

Here are my results.

factor 1.0 .5% precision (Movie is 2 hours and 32 minutes long on 2 CDs. 'The Firm')
Final CQ: 71.379
Required Video Size: 1,492,749,184
Final Encoded Size: 1,458,146,800 = 2.3% short of target.

I'm going to try a factor of 1.01 today, but the thing is if it works for this movie why would it work with any other?

For a movie of this length and a 2CD encode I guess I'm happy with 2.3%, but I'm gonna keep testing to help everyone figure this out.

J-Wo 06-25-2003 09:44 AM

Quote:

Originally Posted by audi2honda
I don't understand. You are happy with 3.2% short? that's a lot of wasted space. That also seems to be your worse result.

Well I don't care so much for how short I am but rather what my final video size is. The accuracy at factor 1.00 with the faster prediction was spot on, that is if I wanted it to fit perfectly on an 80min cd. But I like to overburn, so I generally have to raise my prediction factor a bit, and in this case 1.03 gave me my desired result.

audioslave 06-25-2003 09:49 AM

@Boulder
Would it help to use a shorter GOP for PAL movies to get correct prediction? I've read about the shorter values for the GOP's for the different types of movies (NTSCFilm, PAL, NTSC) but I can't remember where. Could someone please post them?

Boulder 06-25-2003 09:59 AM

Quote:

Originally Posted by audioslave
@Boulder
Would it help to use a shorter GOP for PAL movies to get correct prediction? I've read about the shorter values for the GOP's for the different types of movies (NTSCFilm, PAL, NTSC) but I can't remember where. Could someone please post them?

I'm not sure if that would be worth it. We did experiment with different GOP sizes when the last revolution was introduced (=the current GOP) and shorter GOP lengths often produced lower quality encodes. I think that the 24-frame GOP is the sweet spot, at least for the quantization matrix and filtering technique that's currently available. I think that this all was in the same more-than-40-page long thread but some of that stuff has been deleted - the thread would probably be a hundred pages long if it hadn't been compressed to contain only the essential facts.

I'd say that the main target is to get a steady prediction for the current templates. There is a formula for that, no one's just figured it out yet :wink: I think the time has come that we called the Canadian wizard back to the game..you all probably know who I'm talking about 8)

audioslave 06-25-2003 10:04 AM

@Boulder
Okay. So do you recommend using a GOP of 24 regardless of the source - even for PAL? I'm confused here...

Boulder 06-25-2003 10:59 AM

Yep, that's what I'd recommend.


All times are GMT -5. The time now is 12:12 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.