digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   SansGrip Filters: Sampler (http://www.digitalfaq.com/archives/avisynth/1883-sansgrip-filters-sampler.html)

SansGrip 12-21-2002 08:50 PM

Sampler
 
I just uploaded to my site a little Christmas present for y'all. Docs are included, but you guys should know what to do with it ;).

Merry Christmas!

kwag 12-21-2002 09:00 PM

Got it!
Thanks SansGrip :D

-kwag

muaddib 12-21-2002 09:17 PM

I think you forgot to change the readme.html title... it says LegalClip! :wink:

SansGrip 12-21-2002 09:18 PM

Quote:

Originally Posted by muaddib
I think you forgot to change the readme.html title... it says LegalClip! :wink:

:lol:

Oops ;).

SansGrip 12-21-2002 09:31 PM

New version 0.1a
 
Uploaded 0.1a with a fix for that and a couple of other oversights. I haven't been drinking so I can't even use that as an excuse...

:D

muaddib 12-21-2002 11:27 PM

Hi SansGrip,

I got an idea... :idea:
Is it possible to add a single frame to the end (or beginning) of the sample that the "sampler" is outputting?
In that frame you could show some information like Movie Length, Sample Length, Sample Size and the most important... Predicted Total Size :!:

You make a sample with the "sampler" and the "sampler" it self tells you what is the predicted mpeg size! :D

I know that first we have to find a stable formula for the prediction, but... well, just wondering. It would be nice. :wink:

SansGrip 12-21-2002 11:36 PM

Quote:

Originally Posted by muaddib
In that frame you could show some information like Movie Length, Sample Length, Sample Size and the most important... Predicted Total Size :!:

Showing the movie length, sample length, etc. at the end is a very good idea as long as it doesn't mess up the encoded size of the sample strip. I don't imagine one frame would make much difference at all...

Unfortunately it wouldn't be possible to calculate the predicted total size, since the filter has no way of knowing what size the clip will encode to in the end. Would've been nice, though ;).

muaddib 12-22-2002 01:01 AM

Quote:

Originally Posted by SansGrip
Showing the movie length, sample length, etc. at the end is a very good idea as long as it doesn't mess up the encoded size of the sample strip. I don't imagine one frame would make much difference at all...

That's what I thought...


Quote:

Originally Posted by SansGrip
Unfortunately it wouldn't be possible to calculate the predicted total size, since the filter has no way of knowing what size the clip will encode to in the end. Would've been nice, though ;).

Oh man... I can't believe how stupid I am! Of course it can't know what will be its own size! :oops: :oops:
Sorry for this nonsense... :(

kwag 12-22-2002 01:04 AM

Quote:

Originally Posted by muaddib
Quote:

Originally Posted by SansGrip
Unfortunately it wouldn't be possible to calculate the predicted total size, since the filter has no way of knowing what size the clip will encode to in the end. Would've been nice, though ;).

Oh man... I can't believe how stupid I am! Of course it can't know what will be its own size! :oops: :oops:
Sorry for this nonsense... :(

We're going too fast 8O. Our brains are going to blow apart :mrgreen:

SansGrip 12-22-2002 01:04 AM

Quote:

Originally Posted by muaddib
Oh man... I can't believe how stupid I am! Of course it can't know what will be its own size! :oops: :oops:
Sorry for this nonsense... :(

When it comes to this kind of extreme tweaking no idea is a stupid idea. You should see some of the file size prediction formulas kwag and I have been running over the last hour :mrgreen:.

muaddib 12-22-2002 01:25 AM

Quote:

Originally Posted by kwag
We're going too fast 8O. Our brains are going to blow apart :mrgreen:

GO! GO! GO! ... Don't slow down! :lol:


Quote:

Originally Posted by SansGrip
When it comes to this kind of extreme tweaking no idea is a stupid idea. You should see some of the file size prediction formulas kwag and I have been running over the last hour :mrgreen:.

I can only imagine... but I'm already scared! :mrgreen:

jorel 12-22-2002 07:13 AM

Re: Sampler
 
Quote:

Originally Posted by SansGrip
I just uploaded to my site a little Christmas present for y'all. Docs are included, but you guys should know what to do with it ;).

Merry Christmas!

simple question:

:? :? :? :? :? :? :? 8O 8O

what is this(God)?

:-@ :oops: :( :cry: :evil: :x :? :? :? 8O 8O 8O

SansGrip 12-22-2002 10:28 AM

Re: Sampler
 
Quote:

Originally Posted by jorel
simple question:
:? :? :? :? :? :? :? 8O 8O

It's an Avisynth filter to replace the

Code:

IL = Framcount / 100
SL = Round(Framerate)
SelectRangeEvery(IL, SL)

strangeness for file size prediction with a simple line like

Code:

Sampler(100, 24)
See "the big thread" for more information ;).

SansGrip 12-22-2002 12:32 PM

New version 0.2
 
Just uploaded a new version in which I added audio support and made miscellaneous unimportant tweaks. While we won't benefit directly from the audio support (though it is fun to play with :D) it does mean that TMPGEnc will now always see the correct length of the sample strip without us having to muck about with the source range dialog.

Let me know how it goes for you.

SansGrip 12-22-2002 04:39 PM

New version 0.2a
 
I uploaded yet another new version (probably my last for the day ;)): samples now defaults to movie length in minutes, and length now defaults to one second. Coincidentally, this is precisely what we need to use for our sample encoding :mrgreen:.

jorel 12-22-2002 04:48 PM

Re: New version 0.2a
 
Quote:

Originally Posted by SansGrip
I uploaded yet another new version (probably my last for the day ;)): samples now defaults to movie length in minutes, and length now defaults to one second. Coincidentally, this is precisely what we need to use for our sample encoding :mrgreen:.

at the end of the day i learn one thing:
:wink: :?
you and Kwag are driving me crazy!!!!! 8O 8O (kidding)
i don't understand how to use it! :(

@muaddib,vou contar contigo meu amigo,help me!

and the link to download don't work!
thanks. :)

SansGrip 12-22-2002 05:06 PM

Re: New version 0.2a
 
Quote:

Originally Posted by jorel
and the link to download don't work!

Ack, the first time I announce without checking the link and wouldn't you know it... ;) Fixed now.

jorel 12-22-2002 05:09 PM

Re: New version 0.2a
 
Quote:

Originally Posted by SansGrip
Quote:

Originally Posted by jorel
and the link to download don't work!

Ack, the first time I announce without checking the link and wouldn't you know it... ;) Fixed now.

yeah works......thanks !! :D

muaddib 12-22-2002 10:08 PM

Re: New version 0.2a
 
Quote:

Originally Posted by SansGrip
I uploaded yet another new version (probably my last for the day ;)): samples now defaults to movie length in minutes, and length now defaults to one second. Coincidentally, this is precisely what we need to use for our sample encoding :mrgreen:.

Wait a min... now I get lost.
Should we use lenght = 24 or lenght = 1sec :?:

SansGrip 12-22-2002 10:20 PM

Re: New version 0.2a
 
Quote:

Originally Posted by muaddib
Wait a min... now I get lost.
Should we use lenght = 24 or lenght = 1sec :?:

With the current formula all you need is Sampler(). By length=1sec what I mean is length=frame_rate, which is the same thing.

muaddib 12-22-2002 10:25 PM

Re: New version 0.2a
 
Quote:

Originally Posted by SansGrip
With the current formula all you need is Sampler(). By length=1sec what I mean is length=frame_rate, which is the same thing.

Yes, I know that... but what about that discussion of the length been related to the GOP or the Framerate?

SansGrip 12-22-2002 10:45 PM

Re: New version 0.2a
 
Quote:

Originally Posted by muaddib
Yes, I know that... but what about that discussion of the length been related to the GOP or the Framerate?

Right now the sample length is the same as the GOP length, and I think it'll probably stay that way. But since Sampler has no way of knowing what the GOP length is, I decided to make the default sample length be equal to the frame rate, which right now is the same as the GOP length.

If we ever change the GOP length and decide to change the sample length along with it, then we'll have to start specifying the sample length explicitly to Sampler.

Hope that made sense :).

muaddib 12-22-2002 10:59 PM

Re: New version 0.2a
 
Quote:

Originally Posted by SansGrip
I decided to make the default sample length be equal to the frame rate, which right now is the same as the GOP length.

It's not true if your source is interlaced. I'm doing an NTSC Interlaced @ 29.970fps right now. Should I leave sampler's default, or should I set the length to 30? What will be better for the prediction? Or will it make any accuracy difference?

Quote:

Originally Posted by SansGrip
If we ever change the GOP length and decide to change the sample length along with it, then we'll have to start specifying the sample length explicitly to Sampler.

Hope that made sense :).

It sure did. :)

kwag 12-22-2002 11:05 PM

Re: New version 0.2a
 
Quote:

Originally Posted by muaddib
It's not true if your source is interlaced. I'm doing an NTSC Interlaced @ 29.970fps right now. Should I leave sampler's default, or should I set the length to 30? What will be better for the prediction? Or will it make any accuracy difference?

It shouldn't make a difference because the formula is based on the size of the GOP, which is 24 frames, no matter what frame rate you encode.

Edit: Man!, KVCD.Net is beginning to drive me nuts :lol: . I can't even go get a beer, and when I come back, I find 2 or 3 new posts 8O . I haven't even been able to visit the spanish forum today 8O . Switching over there now, brb :D

-kwag

SansGrip 12-22-2002 11:06 PM

Re: New version 0.2a
 
Quote:

Originally Posted by muaddib
It's not true if your source is interlaced. I'm doing an NTSC Interlaced @ 29.970fps right now. Should I leave sampler's default, or should I set the length to 30? What will be better for the prediction?

If the source is interlaced Sampler will use a sample length of 30, so you'll need to manually set it to 24. Right now the theory is that the sample length should always match the GOP length.

Edit: What I should have said is that Sampler will always use a sample length of 1 second by default unless you override it by specifying a length. If you know that your frame rate is not 24 (which is the value we're using right now for the formula) then you'll need to specify length=24 when you run Sampler.

muaddib 12-22-2002 11:15 PM

Re: New version 0.2a
 
Quote:

Originally Posted by SansGrip
If the source is interlaced Sampler will use a sample length of 30, so you'll need to manually set it to 24. Right now the theory is that the sample length should always match the GOP length.

oops! :oops:
That's what I mean... "Should I leave sampler's default, or should I set the length to 24?"
I just have to stop drinking... :mrgreen:

muaddib 12-22-2002 11:24 PM

Re: New version 0.2a
 
Quote:

Originally Posted by kwag
It shouldn't make a difference because the formula is based on the size of the GOP, which is 24 frames, no matter what frame rate you encode.

I got it... :D
So, if my source is 30fps, I have to set Sampler to 24 manually. Right?

note: wouldn't be better if the default was fixed to 24?

muaddib 12-23-2002 01:44 AM

Re: New version 0.2a
 
Quote:

Originally Posted by jorel
@muaddib,vou contar contigo meu amigo,help me!

Hi jorel,
Do you still need some help, or did you find your way... :?: :wink:

jorel 12-23-2002 01:58 AM

Re: New version 0.2a
 
Quote:

Originally Posted by muaddib
Quote:

Originally Posted by jorel
@muaddib,vou contar contigo meu amigo,help me!

Hi jorel,
Do you still need some help, or did you find your way... :?: :wink:

yes, need tons of help my friend, i'm really flying,
but reading (cross-eyed) and try to understand! 8O 8O :?

SansGrip 12-23-2002 02:00 AM

Re: New version 0.2a
 
Quote:

Originally Posted by muaddib
So, if my source is 30fps, I have to set Sampler to 24 manually. Right?

Yep. Sampler(length=24)

Quote:

note: wouldn't be better if the default was fixed to 24?
I was going to do that, but I really don't want to have to do a new release every time the GOP size changes. Setting a default of 24 seems rather arbitrary since perhaps others will use it apart from the KVCD crowd, so I decided that the best defaults would be samples=minutes and length=1sec. I'd rather have two defaults that are computed and useful than one default computed and the other fixed at a certain value that's useful only to us.

That was my reasoning at the time, anyway ;).

muaddib 12-23-2002 09:43 AM

Re: New version 0.2a
 
Quote:

Originally Posted by SansGrip
Setting a default of 24 seems rather arbitrary since perhaps others will use it apart from the KVCD crowd, so I decided that the best defaults would be samples=minutes and length=1sec.

It's great!
Anyway it's a lot simpler than the old way.
But you know... how about just type "S" do to the job? :mrgreen:

SansGrip 12-23-2002 10:53 AM

Re: New version 0.2a
 
Quote:

Originally Posted by muaddib
But you know... how about just type "S" do to the job? :mrgreen:

heheh yes, in theory you could: just a line with an S on it. Wouldn't be too readable though ;).

Jellygoose 12-24-2002 08:41 AM

Ok I think I got it. With the new GOP I just use "Sampler ()" ... right?
Well what's the formula then we're talking about?

SansGrip 12-24-2002 11:40 AM

Quote:

Originally Posted by Jellygoose
Ok I think I got it. With the new GOP I just use "Sampler ()" ... right?

Yep, if your source frame rate is 23.976.

Quote:

Well what's the formula then we're talking about?
I use one that's different from the canonical version, so I'd better let kwag answer this ;).

Jellygoose 12-27-2002 10:23 AM

:D No, my Framerate is 25 fps... what's the script then?

SansGrip 12-27-2002 04:10 PM

Quote:

Originally Posted by Jellygoose
:D No, my Framerate is 25 fps... what's the script then?

As the "length of sample" parameter, if none is provided, Sampler will use the movie's frame rate rounded to the nearest integer. This means that when run with no arguments on a 23.976fps 92-minute movie, Sampler will produce 92 samples each 24 frames long. On a 25fps 105-minute movie, Sampler will produce 105 samples each 25 frames long.

With the current prediction method, however, our sample length should match the GOP length we're using. At the moment our GOP length is 24 for all templates, so we want to tell Sampler to make samples with a length of 24 frames, regardless of the frame rate we're using.

To accomplish this, simply supply the "length" parameter to Sampler in this way:

Sampler(length=24)

This is of course only necessary when your frame rate is not the same as the GOP length being used.

deltaboy 12-29-2002 10:46 PM

and what scale factor are we using now in the Predictor?

0.85 is my cup o tea...

SansGrip 12-29-2002 10:50 PM

Quote:

Originally Posted by deltaboy
and what scale factor are we using now in the Predictor?

0.85 is my cup o tea...

We're currently using 1.0 in the manual formula, so that should equate to 0% in KVCDP. Let us know if you get bad results with that...

kwag 12-29-2002 10:50 PM

Quote:

Originally Posted by deltaboy
and what scale factor are we using now in the Predictor?

0.85 is my cup o tea...

With the new GOP 1-12-2-1-24, use a factor of 1.0. :wink:

-kwag

kwag 12-29-2002 10:51 PM

Cross post :mrgreen:


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

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