Quantcast To Crop or Not to Crop! - Page 18 - digitalFAQ.com Forums [Archives]
  #341  
12-22-2002, 09:19 AM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
Note: For PAL users, use 25 instead of 24 for the value of SL and change the 24 to 25 in the formula. If any NTSC user has to encode at 29.97, then use a value of 30.
Are you sure? Does the GOP size change?
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #342  
12-22-2002, 09:46 AM
gonzopdx gonzopdx is offline
Free Member
 
Join Date: Dec 2002
Location: Corvallis, OR
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
So what should be added to the AVISynth script to implement the function Sampler(int movielength, int gop)?

I tried
Code:
function Sampler(int MovieLength, int GOP) {
  IL = MovieLength
  SL = GOP
  SelectRangeEvery(IL, SL)
}
and it didn't seem to work.. said that SelectRangeEvery was being fed invalid arguments

I tried adding
Code:
IL = round((Framecount/Framerate)/60) 
SL = round(Framerate) 
SelectRangeEvery(IL,SL)
to my test script, and when opened in TMPGEnc, it wants to encode a 23-minute sample (from a 128 minute movie)...is this correct?

Would I just change the Error Margin in KVCDP to 2% and go from there?
Reply With Quote
  #343  
12-22-2002, 09:48 AM
bman bman is offline
Free Member
 
Join Date: Apr 2002
Posts: 356
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by muaddib
Quote:
Originally Posted by muaddib
Wow, that's weird... Total frames/MovieTimeInMinutes? Can you explain it a little bit?
It's ok... I got it.
It would be easier to understand if it was:
Code:
MPEG size = ((Total frames/Framerate)/MovieTimeInMinutes) * (sample file size * .98 )
Or even easier (just for my understanding):
Code:
MPEG size = (sample file size / sample length) * movie length * .98
length in seconds
Anyway, I just needed to understand it to not get crazy... the formula is as good as always!
Nice work!
maybe u'll try this :
Total frames/Framerate/MovieTimeInMinutes = 60
so formula going to be :
60 * 0.98 * sample file size
or
file size = Sample file size * 58.8
Very simple , Right ?!!!
bman
Reply With Quote
  #344  
12-22-2002, 09:48 AM
Racer99 Racer99 is offline
Free Member
 
Join Date: Sep 2002
Location: Massachusetts
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
And here's the old ( hard core ) way
This is what you add to the end of your .avs script:

Code:
IL = MovieTimeInMinutes
SL = 24
SelectRangeEvery(IL,SL)
Or automatic:

Code:
IL = round((Framecount/Framerate)/60)
SL = round(Framerate)
SelectRangeEvery(IL,SL)
And then use the new formula:
Code:
MPEG size = (( Total frames/MovieTimeInMinutes)/24) * (MPEG sample file size * .98 )
Note: For PAL users, use 25 instead of 24 for the value of SL and change the 24 to 25 in the formula. If any NTSC user has to encode at 29.97, then use a value of 30.

And if I screwed up, SansGrip will fix it

-kwag
So we are basically doing a test encode of say appox 1/4 (90 min movie) to 1/5 (120 min movie) movie lenght as the sample. That leads to 1+ hour test samples encode times on my machine. Is this correct
Reply With Quote
  #345  
12-22-2002, 09:51 AM
muaddib muaddib is offline
Free Member
 
Join Date: Jun 2002
Location: São Paulo - Brasil
Posts: 879
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
And here's the old ( hard core ) way
This is what you add to the end of your .avs script:

Code:
IL = MovieTimeInMinutes
SL = 24
SelectRangeEvery(IL,SL)
Or automatic:

Code:
IL = round((Framecount/Framerate)/60)
SL = round(Framerate)
SelectRangeEvery(IL,SL)
Hi Kwag,

I believe that it's not right.
Remember... IL = Interval Length, not the quantity of samples.
If you want the number of samples to be equal the movie time in minutes, you have to do this:
Code:
MI = (Framecount/Framerate)/60
IL = round(Framecount/MI)
SL = round(Framerate)
SelectRangeEvery(IL,SL)
Reply With Quote
  #346  
12-22-2002, 09:55 AM
muaddib muaddib is offline
Free Member
 
Join Date: Jun 2002
Location: São Paulo - Brasil
Posts: 879
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Racer99
So we are basically doing a test encode of say appox 1/4 (90 min movie) to 1/5 (120 min movie) movie lenght as the sample. That leads to 1+ hour test samples encode times on my machine. Is this correct
We posted at the same time Racer99.

Try this and you'll get what you want:
MI = (Framecount/Framerate)/60
IL = round(Framecount/MI)
SL = round(Framerate)
SelectRangeEvery(IL,SL)
Reply With Quote
  #347  
12-22-2002, 10:05 AM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by grivad
So what should be added to the AVISynth script to implement the function Sampler(int movielength, int gop)?
Sorry, forgot to mention where to get Sampler . Try here. It really is much easier than the old SelectRangeEvery method.
Reply With Quote
  #348  
12-22-2002, 10:17 AM
gonzopdx gonzopdx is offline
Free Member
 
Join Date: Dec 2002
Location: Corvallis, OR
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by SansGrip
Sorry, forgot to mention where to get Sampler . Try here. It really is much easier than the old SelectRangeEvery method.
Nice, got it.

Another quick question -- I realize this probably isn't the thread to post it in, but this thread is hot and I'd like this answered immediately so I can get on with my encoding =)

When using
Code:
BB_Resolution = 352 * 480

BB_StrengthConstant = 352 * 240 * 20
StrengthValue = round(BB_StrengthConstant / BB_Resolution)

BlockBuster(method="noise", detail_min=1, detail_max=10, variance=1, cache=1024)
BlockBuster(method="sharpen", detail_min=20, detail_max=90, strength=StrengthValue)
for BlockBuster, do I want BB_Resolution to be the resolution that the movie WILL be encoded at (ie: 352x480), or the resolution that AviSynth is feeding to TMPGEnc after AviSynth cropping and before TMPGEnc resizing (ie: 480x279 or whatnot)..?
Reply With Quote
  #349  
12-22-2002, 10:23 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by SansGrip
Quote:
Originally Posted by kwag
Note: For PAL users, use 25 instead of 24 for the value of SL and change the 24 to 25 in the formula. If any NTSC user has to encode at 29.97, then use a value of 30.
Are you sure? Does the GOP size change?
No, I'm not, but it was too late for me too think

Good morning
-kwag
Reply With Quote
  #350  
12-22-2002, 10:46 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by muaddib
Quote:
Originally Posted by kwag
And here's the old ( hard core ) way
This is what you add to the end of your .avs script:

Code:
IL = MovieTimeInMinutes
SL = 24
SelectRangeEvery(IL,SL)
Or automatic:

Code:
IL = round((Framecount/Framerate)/60)
SL = round(Framerate)
SelectRangeEvery(IL,SL)
Hi Kwag,

I believe that it's not right.
Remember... IL = Interval Length, not the quantity of samples.
If you want the number of samples to be equal the movie time in minutes, you have to do this:
Code:
MI = (Framecount/Framerate)/60
IL = round(Framecount/MI)
SL = round(Framerate)
SelectRangeEvery(IL,SL)
It's exactly the same
If we have:
Code:
IL = MovieTimeInMinutes
SL = 24
SelectRangeEvery(IL,SL)
Then IL=107 ( rounded time for Red Planet in my example )
SL=24 ( rounded frame rate )

And if done like this:
Code:
IL = round((Framecount/Framerate)/60)
SL = round(Framerate)
SelectRangeEvery(IL,SL)

Then my total frames are 153233 / 23.976 / 60 = 106.51832 which will round to 107.
And the SL will be 24 ( round 23.976 )

Edit: I see where the confususion is. IL was wrongly labled. It's not "Interval Length". It's really "Every Interval"

Code:
SelectRangeEvery(clip,every,length[,offset]) 
Select length frames every every frames, starting after offset. 
SelectRangeEvery(every,length,offset) is the same as SelectRangeEvery(Trim(offset,0),every,length)
So IL is really the "every" field, and in the example above, every is 107 which is what we want. 107 samples of 24 "length" frames each

-kwag
Reply With Quote
  #351  
12-22-2002, 10:51 AM
muaddib muaddib is offline
Free Member
 
Join Date: Jun 2002
Location: São Paulo - Brasil
Posts: 879
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by SansGrip
Sorry, forgot to mention where to get Sampler . Try here. It really is much easier than the old SelectRangeEvery method.
And more accurate to!

For my test I'm using an 86min film, so I'm using an 86:24 sample.
The sample with Sampler has 2063 frames, and the sample with avs has 2087. The exact value should be 2064 frames (86x24). I don't know why Sampler always produce 1 frame less then the total, but it's much more accurate than avs.

Now the strange part: after encoding the sample, TMPG is producing 1243 frames, instead of 2063! I don’t know if I made my self clear, but what I mean is at TMPG Source Range the sample has 2063 frames, but after the encode it end up with 1243 frames. I can’t understand… is that supposed to be happening?
Reply With Quote
  #352  
12-22-2002, 11:01 AM
muaddib muaddib is offline
Free Member
 
Join Date: Jun 2002
Location: São Paulo - Brasil
Posts: 879
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
It's exactly the same
If we have:
Code:
IL = MovieTimeInMinutes
SL = 24
SelectRangeEvery(IL,SL)
Then IL=107 ( rounded time for Red Planet in my example )
SL=24 ( rounded frame rate )

And if done like this:
Code:
IL = round((Framecount/Framerate)/60)
SL = round(Framerate)
SelectRangeEvery(IL,SL)

Then my total frames are 153233 / 23.976 / 60 = 106.51832 which will round to 107.
And the SL will be 24 ( round 23.976 )

-kwag
Yep... they are both the same, and are both wrong.

If you use IL=107 (your red planet example) and SL=24, them you are getting 24 frames of every 107!! This would result in an HUGE total sample!
If you want 107 samples, then you have to do Framecount/107 !!
Reply With Quote
  #353  
12-22-2002, 11:05 AM
muaddib muaddib is offline
Free Member
 
Join Date: Jun 2002
Location: São Paulo - Brasil
Posts: 879
Thanks: 0
Thanked 0 Times in 0 Posts
But I think that we should start to use the Sampler from SansGrip.
It IS more accurate.
Reply With Quote
  #354  
12-22-2002, 11:09 AM
jorel jorel is offline
Invalid Email / Banned / Spammer
 
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
......i need a "resume" to understand it all. "i'm flying"
Reply With Quote
  #355  
12-22-2002, 11:15 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by muaddib
Quote:
Originally Posted by kwag
It's exactly the same
If we have:
Code:
IL = MovieTimeInMinutes
SL = 24
SelectRangeEvery(IL,SL)
Then IL=107 ( rounded time for Red Planet in my example )
SL=24 ( rounded frame rate )

And if done like this:
Code:
IL = round((Framecount/Framerate)/60)
SL = round(Framerate)
SelectRangeEvery(IL,SL)

Then my total frames are 153233 / 23.976 / 60 = 106.51832 which will round to 107.
And the SL will be 24 ( round 23.976 )

-kwag
Yep... they are both the same, and are both wrong.

If you use IL=107 (your red planet example) and SL=24, them you are getting 24 frames of every 107!! This would result in an HUGE total sample!
If you want 107 samples, then you have to do Framecount/107 !!
I must go back to sleep
You are correct. Maybe I should step away from the computer for a couple of hours

Edit:
And the correct lines are what you posted:

MI = (Framecount/Framerate)/60
IL = round(Framecount/MI)
SL = round(Framerate)
SelectRangeEvery(IL,SL)


Thanks,
-kwag
Reply With Quote
  #356  
12-22-2002, 11:34 AM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by muaddib
I don't know why Sampler always produce 1 frame less then the total, but it's much more accurate than avs.
Sampler always produces samples * length frames. You might be looking at the "end point" figure in the TMPGEnc Source Range dialog, which is the last frame rather than the total frames. Since they start from 0, this will be one less than the total.

If you look at how many frames TMPGEnc sees when it's actually doing the encode, it should be right on the money.
Reply With Quote
  #357  
12-22-2002, 11:35 AM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
There's a new Sampler out. I posted details here. No more monkeying about with Source Range now .
Reply With Quote
  #358  
12-22-2002, 11:37 AM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
Maybe I should step away from the computer for a couple of hours
Reply With Quote
  #359  
12-22-2002, 11:38 AM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
And the correct lines are what you posted:

MI = (Framecount/Framerate)/60
IL = round(Framecount/MI)
SL = round(Framerate)
SelectRangeEvery(IL,SL)
Also correct is:

Sampler(minutes, 24)

Reply With Quote
  #360  
12-22-2002, 11:41 AM
muaddib muaddib is offline
Free Member
 
Join Date: Jun 2002
Location: São Paulo - Brasil
Posts: 879
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by SansGrip
Sampler always produces samples * length frames. You might be looking at the "end point" figure in the TMPGEnc Source Range dialog, which is the last frame rather than the total frames. Since they start from 0, this will be one less than the total.

If you look at how many frames TMPGEnc sees when it's actually doing the encode, it should be right on the money.
Yep! Right on target!

And I just thought that this "supposed" missing frame would be the "information" frame that we talk on the other thread.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Commande de crop oublié :p tamahome Conversion et d'Encodage de Vidéo (Français) 8 12-17-2004 07:22 AM
Overscan com CROP não funciona. ginoboy Conversão e Codificação de Vídeo (Português) 6 08-10-2004 01:12 PM
Crop divx zagor Convertire e Codifica dei Video (Italiano) 6 03-07-2004 03:14 PM
TMPGEnc: crop without resize? rupan Video Encoding and Conversion 5 03-06-2004 09:36 PM
Avisynth open failure: Crop: you cannot use crop to enlarge or 'shift' a clip nicksteel Avisynth Scripting 0 11-22-2003 05:10 PM

Thread Tools



 
All times are GMT -5. The time now is 05:12 AM  —  vBulletin © Jelsoft Enterprises Ltd