Quantcast To Crop or Not to Crop! - Page 16 - digitalFAQ.com Forums [Archives]
Go Back    digitalFAQ.com Forums [Archives] > Video Production Forums > Video Encoding and Conversion

Reply
 
LinkBack Thread Tools
  #301  
12-21-2002, 02:48 PM
black prince black prince is offline
Free Member
 
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
@SansGrip,

SansGrip wrote:
Quote:
Try encoding some sample strips with that Avisynth script I posted (including a crop) instead of masking in TMPGEnc. I think you'll find the results to be almost identical to the extra compression you obtained through masking.
I did and except for using Tmpgenc's resize the results were similar.
I tried to figure out how you determined the resize and crop values, but
was at a loss. Still, adding Tmpgenc's resize decrease file size even more,
so I went for it. I gained ~1.5MB per 90 seconds of encode time and
that allowed for a significant increase for CQ_VBR.

-black prince
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
  #302  
12-21-2002, 03:45 PM
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
Hmmm, Resident Evil came out way over target at 760mb . I'm running some more strips now with 75/48 to see if that helps.
Very important:
I got tired of this "Unpredictable" file size, depending on the resolutions. I did a test at 352x480, and the file size was WAY off . So here's my latest findings and analysis. Just like the sampling theory, where you sample "at least" twice your highest frequency, a higher sampling rate with smaller windows should give a higher resolution than less samples of a larger window. The principle is that you have a finer grain resoution, the higher you go in sampling, and more "visibility" of the real material analyzed So I'm now testing 256 snapshots of 6 frames each . It seems to give me almost the same sample file size, no matter what resolution I use
So theoretically, this should be more than enough for ANY film of just about any size. You might as well set prediction factor to 1.0, because what I see is that the final size is now almost 100% accurate with the formula.
Here are my three tests at different resolutions:

Code:
352x240, Sample size=7,010KB, CQ_VBR=29.88
352x480, Sample size=7,300KB, CQ_VBR=13.88
704x480, Sample size=7,212KB, CQ_VBR=5.72
Feedback please. Please try this as soon as possible and let us know your results

My own feedback. This doesn't work!. 256/6. Back to the drawing board. Now trying 128/24 ...

-kwag
Reply With Quote
  #303  
12-21-2002, 04:00 PM
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 black prince
I tried to figure out how you determined the resize and crop values, but was at a loss.
I used FitCD .

Quote:
Still, adding Tmpgenc's resize decrease file size even more
In my tests it didn't -- it increased the file size slightly, at least compared to Avisynth's bilinear. When you say it decreased, which of the resize filters were you comparing it to?

Quote:
I gained ~1.5MB per 90 seconds of encode time
Then something's still not right .
Reply With Quote
  #304  
12-21-2002, 04:04 PM
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
now testing 256 snapshots of 6 frames each .
I was going to reply and say "shouldn't the sample length be closer to the GOP?" but now I realize that since we're not using scene-change detection it doesn't matter what size the sample is provided it's not too short. We're concerned about the GOP after encoding, not before it. Do you see what I mean?

Quote:
It seems to give me almost the same sample file size, no matter what resolution I use
Unfortunately the method I used for Resident Evil worked great for both American Pie and Untouchables, so it seems to depend on the source material too.

Quote:
Please try this as soon as possible and let us know your results
My tests will have to wait until tonight, since we're going to my brother-in-law's place for supper and I think they'd frown upon me using my laptop at the dinner table .
Reply With Quote
  #305  
12-21-2002, 04:34 PM
black prince black prince is offline
Free Member
 
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
@SansGrip,

SansGrip wrote:
Quote:
I used FitCD .
I used FitCD and tried to adjust left and top borders to match Tmpgenc's
mask settings. The numbers would not take and defaulted to 0.
For DVD 3/4 small a output (528x480) and TV-overscan 2 the resize
is BilinearResize(496,352,22,0,676,480) and AddBorders(16,64,16,64).
Not sure how to get this setting in FitCD. I tested Tmpgenc's resize vs
avs script resize with no filters and there is a decrease. I will test another
movie and see if the results are them same.



@Kwag,
Kwag wrote:
Quote:
Here are my three tests at different resolutions:
Code:
352x240, Sample size=7,010KB, CQ_VBR=29.88
352x480, Sample size=7,300KB, CQ_VBR=13.88
704x480, Sample size=7,212KB, CQ_VBR=5.72
Feedback please. Please try this as soon as possible and let us know your results
-kwag
I'm confused. How should I setup file prediction test :

IL = Framecount / 50
SL = round(Framerate) * 2
SelectRangeEvery(IL, SL)


Are the CQ_VBR values a starting point

-black prince
Reply With Quote
  #306  
12-21-2002, 04:48 PM
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 black prince
@Kwag,
Kwag wrote:
Quote:
Here are my three tests at different resolutions:
Code:
352x240, Sample size=7,010KB, CQ_VBR=29.88
352x480, Sample size=7,300KB, CQ_VBR=13.88
704x480, Sample size=7,212KB, CQ_VBR=5.72
Feedback please. Please try this as soon as possible and let us know your results
-kwag
I'm confused. How should I setup file prediction test :

IL = Framecount / 50
SL = round(Framerate) * 2
SelectRangeEvery(IL, SL)


Are the CQ_VBR values a starting point

-black prince
Start a CQ_VBR of ~20 and use:

Code:
IL=Framecount / 256
SL=6
SelectRangeEvery(IL,SL)
Here you're taking 256 samples of 6 frames each. Try it and let me know

-kwag
Reply With Quote
  #307  
12-21-2002, 05:18 PM
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
now testing 256 snapshots of 6 frames each .
I was going to reply and say "shouldn't the sample length be closer to the GOP?" but now I realize that since we're not using scene-change detection it doesn't matter what size the sample is provided it's not too short. We're concerned about the GOP after encoding, not before it. Do you see what I mean?
Yes, but the thing I see is that very small samples are very random. So the more, the better. Each "window" can hit more B and P frames, because there are more Bs and Ps than I frames. Still, there should be I frame hits too. I tried 300 snapshots of 6 frames, and got basically the same result. So I think 256 is a pretty good amount of sampling points on a movie. We just need to find out if the results are consistent with different types of movies. Maybe I'm wrong

Quote:
My tests will have to wait until tonight, since we're going to my brother-in-law's place for supper and I think they'd frown upon me using my laptop at the dinner table .
How about using a small PocketPC or PALM to evaluate formulas under the table. It's small enough, and you can hide it under the napkin

-kwag
Reply With Quote
  #308  
12-21-2002, 05:20 PM
black prince black prince is offline
Free Member
 
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
Hi SansGrip,

SansGrip wrote:
Quote:
In my tests it didn't -- it increased the file size slightly, at least compared to Avisynth's bilinear. When you say it decreased, which of the resize filters were you comparing it to?
Here's my latest resize tests:

Test #1
Using avs resize LanczosResize(496,352) and AddBorder(16,16,16,16)
with Clip Frame only in Tmpgenc.

File Size = 18,547,704

Test #2
Using Tmpgenc's resize of 496x352 and Clip Frame. LanczosResize and
AddBorders are commented and not being used.

File Size = 17,252,889

The savings are 18,547,704 - 17,252,889 = 1,294,815 or 1.3MB

Picture quality and resolution are the same and of course excellent
I'm using LanczosResize and maybe that's why it decreases

-black prince
Reply With Quote
  #309  
12-21-2002, 06:02 PM
black prince black prince is offline
Free Member
 
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
Hey Kwag,

Kwag wrote:
Quote:
Code:
IL=Framecount / 256
SL=6
SelectRangeEvery(IL,SL)
The file prediction formula must have changed:

Old = ((movie length / 100) * (test file size * .95)) = Total Video file Size

New = ((movie lenght / 256) * (test file size * .98 )) = Total Video File Size

-black prince
Reply With Quote
  #310  
12-21-2002, 06:44 PM
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 black prince
I'm using LanczosResize and maybe that's why it decreases
Yep... I think that you are right.
LancosResize gives more sharpness, and that increase the file size.
Reply With Quote
  #311  
12-21-2002, 06:55 PM
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 black prince
Hey Kwag,

Kwag wrote:
Quote:
Code:
IL=Framecount / 256
SL=6
SelectRangeEvery(IL,SL)
The file prediction formula must have changed:

Old = ((movie length / 100) * (test file size * .95)) = Total Video file Size

New = ((movie lenght / 256) * (test file size * .98 )) = Total Video File Size

-black prince
That would be right if SL was 1 sec (framerate). But the SL is just 6 frames.
You can calculate the Total Video File Size like this: (sample size / sample lenght ) * movie lenght * .98

note: movie lenght and sample lenght in seconds
Reply With Quote
  #312  
12-21-2002, 08:26 PM
gonzopdx gonzopdx is offline
Free Member
 
Join Date: Dec 2002
Location: Corvallis, OR
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
I just finished my first squeeze of a 120+ minute film onto one disc.

KVCD Predictor predicted 796 mb (CQ_VBR10.5), actual size 820mb (d'oh!).

Used TMPGEnc's resizing, clipping, encoded at 480x352 (widescreen), new GOP.

Quality is decent -- blocks are apparent on my 27" HDTV -- but for a 133 minute high-action film squished onto ONE 80-minute CD-R, I'm pleased =) It looks alright if you sit at a normal distance from the TV (6-8+ feet).

I'll probably do two discs to improve the quality.

EDIT: WOW! I was finally able to post on the board! =)
Reply With Quote
  #313  
12-21-2002, 08:42 PM
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
Welcome grivad

-kwag
Reply With Quote
  #314  
12-21-2002, 08:56 PM
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 black prince
I used FitCD and tried to adjust left and top borders to match Tmpgenc's mask settings. The numbers would not take and defaulted to 0.
Enter the "real" width and height first. For example if you have 16-pixel borders left and right, the real width is 688. You'd enter that in the "film pixel" box.
Reply With Quote
  #315  
12-21-2002, 08:56 PM
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 black prince
I'm confused. How should I setup file prediction test
Hmmm... Might want to check the Avisynth forum...
Reply With Quote
  #316  
12-21-2002, 08:58 PM
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
How about using a small PocketPC or PALM to evaluate formulas under the table. It's small enough, and you can hide it under the napkin
Ah, I wish. Mine was the victim of an unfortunate washing machine incident .
Reply With Quote
  #317  
12-21-2002, 09:01 PM
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 black prince
The savings are 18,547,704 - 17,252,889 = 1,294,815 or 1.3MB
I might be starting to sound like a broken record, but if you're getting that much of a difference between Avisynth cropping/resizing and TMPGEnc masking/resizing then your Avisynth script isn't right .

Make sure you crop ALL borders from the source in Avisynth before running any filters on it (to reduce the work they have to do and thus speed things up significantly) and then resize within Avisynth using FitCD's suggestions.

I'm certain that if you do this you'll find only a very slight difference in the two methods (and the difference will be due to the different resizing algorithms being used: TMPGEnc's is apparently slightly less "soft" than bilinear, at least according to my tests).
Reply With Quote
  #318  
12-21-2002, 10:17 PM
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
Testing.... Testing ..... Encoding.....

-kwag
Reply With Quote
  #319  
12-21-2002, 11:40 PM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Just watched Resident Evil (352x480, CQ_VBR 15.55) and it looks very good -- not DVD quality due to the relative softness, but still very watchable and of course a lot sharper than standard VCD. Also the bitrate was high enough that there was hardly any noticible Gibbs...

Again, though, I had that freezing at the beginning of the disc. However this time there was very bad corruption at the end, video and audio, but only in the last 5 minutes or so.

Is this another symptom of too-low minimum bitrate?
Reply With Quote
  #320  
12-22-2002, 12:09 AM
black prince black prince is offline
Free Member
 
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
Hi SansGrip,

SansGrip wrote:
Quote:
Make sure you crop ALL borders from the source in Avisynth before running any filters on it (to reduce the work they have to do and thus speed things up significantly) and then resize within Avisynth using FitCD's suggestions.
Finally figured out how to get FitCD to crop and the results were the
same as yours. I used LanczosResize which add sharpening, so when
I commented it and used Tmpgenc's resize the file size decrease was
due to no sharpening. I'll switch to BilinearResize in the future.
Thanks for being patient in answering my questions

-black prince
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 08: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 04:14 PM
TMPGEnc: crop without resize? rupan Video Encoding and Conversion 5 03-06-2004 10:36 PM
Avisynth open failure: Crop: you cannot use crop to enlarge or 'shift' a clip nicksteel Avisynth Scripting 0 11-22-2003 06:10 PM




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