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

Reply
 
LinkBack Thread Tools
  #41  
12-16-2002, 06:10 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
Code:
AudioDub(Mpeg2Source("ap.d2v"), WavSource("ap.wav"))
Crop(13, 8, 696, 462)
LegalClip()
BilinearResize(528, 352)
FluxSmooth(temporal_threshold=8, spatial_threshold=0)
Blockbuster(method="noise")
AddBorders(0, 64, 0, 64)
LegalClip()
Encoding with KVCDx3 in TMPGEnc 2.58 non-plus. CQ_VBR 25. No masking/resizing in TMPGEnc.

Max GOP 15: 17.4mb
Max GOP 24: 16.3mb
Max GOP 36: 16.1mb

As you can see, with external resizing I obtain expected results, at least with this 1m25s clip. I'll try again with lower CQ_VBR and edit.

CQ_VBR 10:

Max GOP 15: 7.82mb
Max GOP 24: 7.91mb
Max GOP 36: 7.72mb

I'll leave analysis until later. Now I'm going to test internal resizing/letterboxing.
Now make the same samples by removing the resize and add borders from your script, and add under Video arrange method (Center custom size ) and put 528 x 352 and go to "Clip Frame" and "mask" , not clip, your four borders completely framed in black. See what you get now.

-kwag
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
  #42  
12-16-2002, 06:20 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 make the same samples by removing the resize and add borders from your script, and add under Video arrange method (Center custom size ) and put 528 x 352 and go to "Clip Frame" and "mask" , not clip, your four borders completely framed in black. See what you get now.
See my post above for resizing/letterboxing with TMPGEnc. I didn't mask because I already cropped the borders in Avisynth. I'm running another encode now using no cropping in Avisynth and masking in TMPGEnc.

I expect this one to be smaller because I now have black borders left and right, whereas before I didn't. That might be where your difference is coming from...

Edit: Yep, slightly smaller file size due to small black borders left and right. From the look of the clips you posted I'd say you're adding fairly wide borders left and right now, which are hidden by overscan on most analog TVs. My TV doesn't do that, however, and I have to encode right to the edges otherwise I have visible black borders on the TV.
Reply With Quote
  #43  
12-16-2002, 06:25 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
Incidentally, you can obtain the same result within Avisynth by resizing less wide, then using AddBorders to make up the missing width.
Reply With Quote
  #44  
12-16-2002, 06:32 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
From the look of the clips you posted I'd say you're adding fairly wide borders left and right now, which are hidden by overscan on most analog TVs. My TV doesn't do that, however, and I have to encode right to the edges otherwise I have visible black borders on the TV.
I'm only adding 2 overscan blocks for 528X resolutions and above. For 352x I add 1 overscan block. I haven't had a problem with 2 even on my HDTV, but 3 cuts off a little on the sides. But even the samples I encoded resizing with AviSynth, I had the same overscan blocks too. So the number of pixels being encoded was the same.

-kwag
Reply With Quote
  #45  
12-16-2002, 06:33 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
Test results on a fast-action scene, CQ_VBR 25, external resizing/letterboxing:

Max GOP 15: 6.28mb
Max GOP 24: 6.11mb
Max GOP 36: 6.08mb
Reply With Quote
  #46  
12-16-2002, 06:36 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
I'm only adding 2 overscan blocks for 528X resolutions and above. For 352x I add 1 overscan block. I haven't had a problem with 2 even on my HDTV, but 3 cuts off a little on the sides.
My TV is a Samsung "extra inch" model, which hides between 6 and 8 pixels left and right depending on the overall luminosity of that scene (brighter = fewer pixels hidden).

Quote:
Originally Posted by kwag
But even the samples I encoded resizing with AviSynth, I had the same overscan blocks too. So the number of pixels being encoded was the same.
Perhaps you were adding noise to the overscan borders too?
Reply With Quote
  #47  
12-16-2002, 06:36 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
Test results on a fast-action scene, CQ_VBR 25, external resizing/letterboxing:

Max GOP 15: 6.28mb
Max GOP 24: 6.11mb
Max GOP 36: 6.08mb
Are you using 2 B frames or 3
All the tests I did were using 3 B frames.

-kwag
Reply With Quote
  #48  
12-16-2002, 06:39 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
Are you using 2 B frames or 3
All the tests I did were using 3 B frames.
Same here -- everything else is standard KVCDx3.
Reply With Quote
  #49  
12-16-2002, 07:57 PM
rendalunit rendalunit is offline
Free Member
 
Join Date: Apr 2002
Location: san jose, Ca
Posts: 1,148
Thanks: 0
Thanked 0 Times in 0 Posts
I tested a sample of "Lolita" (black and white) with KVCDx2 with GOP-
Code:
I  P      B  interval     max
1  5823   3  1            36        15,569 kb
1  5823   3  1            24        14,920 kb
1  5823   3  1            15        14,834 kb
I used the traditional method (bilinear resize, add borders)

edit: I did another test sample at 1,5823,3,1,8 filesize= 13,898kb
-ren
Reply With Quote
  #50  
12-16-2002, 08:41 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 rendalunit
I tested a sample of "Lolita" (black and white) with KVCDx2 with GOP-
Code:
I  P      B  interval     max
1  5823   3  1            36        15,569 kb
1  5823   3  1            24        14,920 kb
1  5823   3  1            15        14,834 kb
I used the traditional method (bilinear resize, add borders)
-ren
This is bizarre. What am I doing that you're not, or vice versa?

Edit: Maybe it's the different template...?
Reply With Quote
  #51  
12-16-2002, 10:39 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 Kwag,

Here my test results for LBR (352x240) CQ_VBR=36.97 movie length = 8465 secs.
Note Bilinear and AddBorder are commented.

LoadPlugin("E:\DVD Backup\2 - DVD2SVCD\MPEG2DEC\MPEG2DEC.dll")
LoadPlugin("E:\DVD Backup\2 - DVD2SVCD\BlockBuster\BlockBuster.dll")
LoadPlugin("E:\DVD Backup\2 - DVD2SVCD\LegalClip\LegalClip.dll")
mpeg2source("D:\Temp\movie.d2v")
#
LegalClip()
#LanczosResize(336,192)
TemporalSmoother(1,2)
Blockbuster( method="noise", detail_min=1, detail_max=10, variance=.5, cache=1024 )
#AddBorders(8,24,8,24 )
LegalClip()
#
IL = Framecount / 100 # interval length in frames
SL = round(Framerate) # sample length in frames
SelectRangeEvery(IL,SL)


Results:

GOP...........Test file size

1,6,3,1,6 = 9,920,774
1,7,3,1,7 = 9,933,956
1,8,3,1,8 = 8,437,159
1,9,3,1,9 = 8,459,455
1,10,3,1,10 = 8,460,316
1,11,3,1,11 = 9,026,206
1,12,3,1,12 = 8,665,136
1,13,3,1,13 = 8,672,708
1,14,3,1,14 = 8,674,234
1,15,3,1,15 = 9,105,185
1,16,3,1,16 = 9,642,647
1,18,3,1,18 = 9,651,592
1,24,3,1,24 = 8,644,753

The GOP 1,15,3,1,15 had a file size difference of –0.023%. The wanted file size
is 732,280,000. I am not sure what you mean by optimal GOP, but it’s certainly didn’t
produce the smallest test result.


-black prince
Reply With Quote
  #52  
12-16-2002, 11:10 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
Hi black prince,

Yes, I was just talking to Christopher on a PM about this , and it seems that there's an optimal GOP for every specific resolution. The GOP 1-15-3-1-15 gave me optimal results on 704x480 resolution. We must make more test and find out if the GOP is not affected by the CQ_VBR value. As Christopher suggested to me on a PM, probably we're going to end up with a GOP prediction system and a file size prediction system ( WOW, This is getting fun now )
So more tests have to be conducted at various resolutions to find out if we can do this. Probably for zeroing in on a GOP size, some small 10 second samples should be enough. Looking forward to this stuff

-kwag
Reply With Quote
  #53  
12-16-2002, 11:16 PM
heyitsme heyitsme is offline
Free Member
 
Join Date: Jun 2002
Location: pullman, WA
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to heyitsme
Geez i remember when i first came to this site and it was just load the .d2v and audio in tempgenc and selct your template and bam we are done. now we are venturing into predicting gop's wow. I have used tempgenc to resize and used the new gop 1 15 3 1 15 and it looks damn good. The only prob is i have a 50% increase in encode time which is like an additional 4 hours. The additional bit rate is worth it. I am glad your never stop plugging away, always searching for way to increase the quality and playtime. Many thanks go your way.

Branden
__________________
Eat drink and be merry for tomorrow we die
Reply With Quote
  #54  
12-16-2002, 11: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
Let the new GOP prediction party begin

Oh, btw heyitsme, every time I read your signature, something pops up in my mind. I would write it like this:
Eat drink and be merry, then get married, then divorce. Re-marry and divorce again. Get screwed in court, for tomorrow we die

Just kidding

-kwag
Reply With Quote
  #55  
12-16-2002, 11:24 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
As Christopher suggested to me on a PM, probably we're going to end up with a GOP prediction system and a file size prediction system
If that's what it comes to I can certainly add it to the Predictor . However I have a feeling that we'll find an optimal GOP size for each of the templates/resolutions rather than having to adjust the GOP for specific source material.

At least, it would be much simpler that way...
Reply With Quote
  #56  
12-16-2002, 11:32 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
As Christopher suggested to me on a PM, probably we're going to end up with a GOP prediction system and a file size prediction system
If that's what it comes to I can certainly add it to the Predictor . However I have a feeling that we'll find an optimal GOP size for each of the templates/resolutions rather than having to adjust the GOP for specific source material.

At least, it would be much simpler that way...
I just had the feeling you were going to say that SansGrip
Let the party begin To do it manually, it's a hassle, but I can see that definitively a different GOP is needed for each template/resolution.
It's your call I have a feeling I won't go to sleep tonight until I'm exhausted doing GOP tests . I'm off to 7-Eleven to get some beers now BRB....
Hint: I just tried 1-10-4-1-10 with the 704x480 template and I got a sample size of 10.6MB . With the 1-15-3-1-15, the same sample was 12.776MB and I can't see any quality difference on my monitor. Other values with 4 B frames gave me larger file sizes.

Edit: Drop the idea of 4 B frames. I just took a very close look and there are slight artifacts more visible. So the MAX of 3 B frames should be left alone. It gives better compression than 2, and quality stays the same. The ideal thing is to find the optimal number of P's

-kwag
Reply With Quote
  #57  
12-16-2002, 11:54 PM
christopher christopher is offline
Free Member
 
Join Date: Jun 2002
Location: North Carolina
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
I have been trying various different GOP structures using 352x480 resolution and have found the following.

One minute clip with external clipping and resizing.....

CQ of 20

GOP 1-36-3-1-36 = 9,151KB

GOP 1-10-3-1-10 = 5,981KB

Difference of (9,151 - 5,699 = 3,170KB )

-Christopher
Reply With Quote
  #58  
12-16-2002, 11:55 PM
heyitsme heyitsme is offline
Free Member
 
Join Date: Jun 2002
Location: pullman, WA
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to heyitsme
Quote:

Eat drink and be merry, then get married, then divorce. Re-marry and divorce again. Get screwed in court, for tomorrow we die
ROFL

Hmmmm....about the 4 b frames. I have only a 25 inch tv at home. Would it be alright if i changed it to 4 frames as long i am not watching it on a 60 inch hdtv. Would i notice a difference between 3 and 4?

Branden
__________________
Eat drink and be merry for tomorrow we die
Reply With Quote
  #59  
12-16-2002, 11:57 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 Kwag and SansGrip,

If your developing an optimal GOP for each resolution, wouldn't it be
easier to post a certain movie with its information (i.e. Widescreen,
minutes, etc.), an avs script you'll be using and let some of us divide
the testing among those willing to get involved. Assign pairs of testers
the same resolutions to test. This will provide for verification. I will
volunteer for LBR or x3 testing. Also, I suggest you pick filters that will
give the same results when repeating a test. This will help to establish
a Baseline. Later other filters (i.e. Blockbuster noise) can be added to
your testing.

-black prince
Reply With Quote
  #60  
12-16-2002, 11:58 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 christopher
I have been trying various different GOP structures using 352x480 resolution and have found the following.

One minute clip with external clipping and resizing.....

CQ of 20

GOP 1-36-3-1-36 = 9,151KB

GOP 1-10-3-1-10 = 5,981KB

Difference of (9,151 - 5,699 = 3,170KB )

-Christopher
So it seems the lower the resolution, the tighter the GOP
Did you try other different settings, with the MAX frames per GOP set to 8, 9, 10, 11, 12, etc., to find the exact minimum file size spot?
I'll try some tests in a little while at 352x240.

-kwag
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 05:34 PM  —  vBulletin © Jelsoft Enterprises Ltd