digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   To crop or not to crop! (http://www.digitalfaq.com/archives/encode/1841-crop-crop.html)

christopher 12-20-2002 12:24 PM

Quote:

Originally Posted by kwag
"The Green Mile" is done.

Roll the drums .|.|.|.|.|.|.
Here is the result:

Predicted file size: 662MB
Final file size ->>> 660,765KB :mrgreen:

Too early for a beer, but I'll have a couple tonight :lol:

-kwag

Great! Just had a Beamish Irish Stout. Its 1:30pm here....

kwag 12-20-2002 12:37 PM

Quote:

Originally Posted by christopher
Quote:

Originally Posted by kwag
"The Green Mile" is done.

Roll the drums .|.|.|.|.|.|.
Here is the result:

Predicted file size: 662MB
Final file size ->>> 660,765KB :mrgreen:

Too early for a beer, but I'll have a couple tonight :lol:

-kwag

Great! Just had a Beamish Irish Stout. Its 1:30pm here....

I'll settle for a "Samuel Adams" later on :D

-kwag

christopher 12-20-2002 12:50 PM

I've got some SA Cream Stout, Love it. Have your tried their Lite beer yet?

kwag 12-20-2002 01:00 PM

Quote:

Originally Posted by christopher
I've got some SA Cream Stout, Love it. Have your tried their Lite beer yet?

Never heard of that one :)

-kwag

rendalunit 12-20-2002 01:02 PM

I'm working on my fourth Meister Brau right now and it's 11 AM here- just kidding! :lol:

Hey Kwag,

have you tried Lanczos resizer with the LBR template? I'm really blown away by the sharpness of it. Lanczos is built into avisynth 2.06 and is a resizing option in the latest FitCD too :wink:

thanks,
ren

SansGrip 12-20-2002 01:03 PM

Great result, kwag! I'd have a beer right now, if there were any in the house ;).

This might be a little premature, but I'm getting some promising results with 50/48 and scene change detection OFF for this 1h59m movie...

kwag 12-20-2002 01:04 PM

Quote:

Originally Posted by rendalunit
I'm working on my fourth Meister Brau right now and it's 11 AM here- just kidding! :lol:

Hey Kwag,

have you tried Lanczos resizer with the LBR template? I'm really blown away by the sharpness of it. Lanczos is built into avisynth 2.06 and is a resizing option in the latest FitCD too :wink:

thanks,
ren

I forgot to try that in my script. I'll run another prediction now to see how the sample comes out on "The Green (kilometric :lol: )Mile". I'll post result here :D

-kwag

kwag 12-20-2002 01:07 PM

Quote:

Originally Posted by SansGrip
Great result, kwag! I'd have a beer right now, if there were any in the house ;).

Here, have a virtual beer :D

Quote:

This might be a little premature, but I'm getting some promising results with 50/48 and scene change detection OFF for this 1h59m movie...
I always leave scene change detection OFF, because I've seen TMPEG insert false I frames where there's no actual scene change. So I just leave it off. Same with "Soften Blocks". It works in reverse as advertized. If you turn it on and set 100-100, you see sharper macroblock edges. I've reported this to Pegasys, Inc, and they never responded :?

-kwag

SansGrip 12-20-2002 01:15 PM

Quote:

Originally Posted by kwag
I always leave scene change detection OFF, because I've seen TMPEG insert false I frames where there's no actual scene change.

I might be mistaken here, but I'm pretty sure it's enabled in the x3 template. Might want to check that when you release with the new GOP structure.

I just finished sampling with a new technique I'm using (basically the same kinda deal, just slightly more accurate I think) and will know in 3h34m how close it is...

By the way, do you know any details on exactly how much overhead there is on a VCD? VCDEasy seems to use a figure of muxed_size + around 11mb for its prediction.

kwag 12-20-2002 01:31 PM

Quote:

Originally Posted by SansGrip
I might be mistaken here, but I'm pretty sure it's enabled in the x3 template. Might want to check that when you release with the new GOP structure.

Turn it OFF 8O. And sorry about that. ALL templates should be set to OFF. I probably screwed up when I made the last update.
Quote:

I just finished sampling with a new technique I'm using (basically the same kinda deal, just slightly more accurate I think) and will know in 3h34m how close it is...
We'll be here drinking beer waiting for your result :D
Quote:

By the way, do you know any details on exactly how much overhead there is on a VCD? VCDEasy seems to use a figure of muxed_size + around 11mb for its prediction.
That number is about right. I don't have any references, but ~10 to ~11 MB is the fixed overhead structure on a VCD. That total will always be added to your mpeg files, no matter what size they are.

-kwag

SansGrip 12-20-2002 02:14 PM

Quote:

Originally Posted by kwag
We'll be here drinking beer waiting for your result :D

Bah :P. I'm going to call my wife and tell... er, ask her to pick up some on the way home :D.

Quote:

That number is about right. I don't have any references, but ~10 to ~11 MB is the fixed overhead structure on a VCD. That total will always be added to your mpeg files, no matter what size they are.
That explains why I had to overburn my last "100% accurate" encode :mrgreen:.

If my current test proves to be on the money I think I might have come up with an even more accurate way of doing it that shouldn't require an error margin (or, if it does, it should be very small). Basically instead of doing calculations in seconds I'm doing it with frames:

Target media = 80 minutes = 836,640,000 bytes
Frames in movie = 171,774
Audio size = 114,633,253 bytes
Padded audio size = 115,628,333 bytes
Sample points = 50
Sample length = 48 frames
Frames in sample = 2424 (:?: still don't know how SelectEvery arrives at this figure... it also gives 4848 for 100/48... any ideas? If we can't come up with a formula to duplicate its frame count I'll have to look at the source, or ask dividee ;))

Compensate for overhead:
836,640,000 - 11,534,336 = 825,105,664
Compensate for system stream:
825,105,664 * (2018 / 2048) = 813,019,155
Compensate for audio:
813,019,155 - 115,628,333 = 697,390,822

Final encode size = 697,390,822 bytes
Bytes per frame = 4,060
Target sample size = 4,060 * 2424 = 9,841,440 bytes

Theoretically this should bring us as close as possible to the correct result. I have a feeling that disabling scene change detection will help a great deal, and might explain why you always get more accurate predictions than me ;).

Does anyone see a problem with my theory/math?

black prince 12-20-2002 02:40 PM

Hi SansGrip and Kwag,

@SansGrip

Quote:

That number is about right. I don't have any references, but ~10 to ~11 MB is the fixed overhead structure on a VCD. That total will always be added to your mpeg files, no matter what size they are.
I believe this is true for VCDEasy, but Nero's padding is larger. :)

@Kwag

I have been using the script below and have a question about using
multiples of 30 for each hour of movie time (i.e. 2hrs * 30 = 60)?
Minority Report is 139 minutes or 2 hours 19 minutes.
I see some scripts using 50????? What's the rule and are you still
trying to determine the factor being used (i.e. 0.95, 0.98, 0.95555, etc.)

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")
#
IL = Framecount / 60
SL = round(Framerate) * 2
SelectRangeEvery(IL, SL)
#
LegalClip()
LanczosResize(496,448)
Blockbuster( method="noise", detail_min=1, detail_max=10, variance=1, seed=1 )
AddBorders(16,16,16,16)
LegalClip()



-black prince

black prince 12-20-2002 03:37 PM

Hey SansGrip,

Just did a test file prediction using Tmpgenc's Clip Frame. The test file
size using Clip Frame is 18,483,997 and without 20,305,188. I believe
you felt there should be no significant decrease in file size just by
masking borders. This shows a 2MB decrease with no change in
picture quality. What could be happening during Tmpgenc's mask
that accounts for this decrease :?

-black prince

SansGrip 12-20-2002 03:39 PM

Quote:

Originally Posted by black prince
I believe you felt there should be no significant decrease in file size just by masking borders. This shows a 2MB decrease with no change in picture quality. What could be happening during Tmpgenc's mask that accounts for this decrease :?

I'm really not sure. If your Avisynth script is correct, theoretically there should be no difference whatsoever. Could you post your complete script?

Edit: I'm glad you brought this up again. I really want to thrash this out, because that's a serious gain in compressibility...

black prince 12-20-2002 03:46 PM

Hey SansGrip,

Quote:

Could you post your complete script?
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")
#
IL = Framecount / 60
SL = round(Framerate) * 2
SelectRangeEvery(IL, SL)
#
LegalClip()
LanczosResize(496,448)
Blockbuster( method="noise", detail_min=1, detail_max=10, variance=1, seed=1 )
AddBorders(16,16,16,16)
LegalClip()


I ran this script using CQ_VBR=11 and without Clip Frame file size = 20,305,188
With Clip Frame file size = 18,483,997. This is KVCDx3 (528x480) :)

-black prince

SansGrip 12-20-2002 03:48 PM

Quote:

Originally Posted by black prince
I ran this script using CQ_VBR=11

I notice you're not cropping in the script. How big are the "black" borders around the original, non-resized frame?

black prince 12-20-2002 03:57 PM

@SansGrip,

Quote:

I notice you're not cropping in the script. How big are the "black" borders around the original, non-resized frame?
I believe LanczosResize will automatically crop to resize :) When I
view this script with Tmpgenc Clip Frame the borders for masking
seem correct for the aspect ratio from FitCD (16,16,16,16) or
TV-overscan #2. :)

-black prince

SansGrip 12-20-2002 04:02 PM

Quote:

Originally Posted by black prince
I believe LanczosResize will automatically crop to resize :)

The Avisynth resizing filters only resize -- none of them crop. Make a simple .avs with just the following:

Code:

Mpeg2Source("...")
and load it into TMPGEnc. Use the mask dialog to figure out the size of the existing borders on the frame, then let me know what they are and I'll post an updated version of your script to crop them in Avisynth. I think this might be what's causing the difference.

SansGrip 12-20-2002 04:57 PM

The results are in :). Untouchables, 1h59m, new GOP, no scene-change detection, 50/48.

Target file size of video: 706,804kb
Actual size of video: 697,068kb
Difference: 9,736kb = 1.39%

Not bad -- looks like I can go ahead and code this new method up and then play a little more with the sample points/sample length settings...

kwag 12-20-2002 05:12 PM

Quote:

Originally Posted by SansGrip
The results are in :). Untouchables, 1h59m, new GOP, no scene-change detection, 50/48.

Target file size of video: 706,804kb
Actual size of video: 697,068kb
Difference: 9,736kb = 1.39%

Not bad -- looks like I can go ahead and code this new method up and then play a little more with the sample points/sample length settings...

How does "Untouchables" look SansGrip :?:

-kwag

kwag 12-20-2002 05:21 PM

@rendalunit

Hi ren,

I tried the LanczosResize on "The Green Mile", and the result looks worse than BilineraResize 8O . Maybe the added sharpness around the edges makes this difference. I didn't like the result, compared to the test sample that came out with BilinearResize. Looks more like the original LBR sample. Maybe Mr. Lan C. Zos ( :lol: ) doesn't like low bit rates :twisted:

-kwag

SansGrip 12-20-2002 05:30 PM

Quote:

Originally Posted by kwag
How does "Untouchables" look SansGrip :?:

Take a look :). This sample includes, at the beginning, about the worst Gibbs I could find in the whole clip...

kwag 12-20-2002 05:47 PM

Quote:

Originally Posted by SansGrip
Quote:

Originally Posted by kwag
How does "Untouchables" look SansGrip :?:

Take a look :). This sample includes, at the beginning, about the worst Gibbs I could find in the whole clip...

That looks VERY good for 2 hours 8O
I viewed it with WMP, so I guess fully stretched in my TV it will look even better :D
I can see the Gibbs effect, but it's very little and blurred. I rather see this encode on my TV than the same thing encoded at 352x240. Look at the horses on the far background. You can even see some detail! At 352x240 they would look like "Something" moving in the background :lol:

-kwag

SansGrip 12-20-2002 06:46 PM

Quote:

Originally Posted by kwag
That looks VERY good for 2 hours 8O

Yep :). I decided to take a chance with x3 given the Cinemascope aspect ratio. I think had it been regular 16:9 I probably would've had to use too low a CQ_VBR for one disc. However, I won't know until I try it... :D

Quote:

I rather see this encode on my TV than the same thing encoded at 352x240. Look at the horses on the far background. You can even see some detail! At 352x240 they would look like "Something" moving in the background :lol:
Exactly. I'm willing to put up with a little Gibbs (a little, mind you ;)) and encode at 528x480. I find the sharpness very pleasing. That said, even going from 352x240 to 352x480 makes a huge difference for me. I think it's that doubling of the vertical resolution that's the most important part.

Overall it looks like this encode came out well, and I can't wait to try it on the TV when the kids have gone to bed :).

syk2c11 12-20-2002 06:51 PM

Hi guys,
Just got up and back to business. Yes, I did use FitCD to resize, and yes I did set Block TV overscan to 2, and yes I did use the new GOP (1-12-2-1-24). I used Flux, LegalClip, and Blockbuster as well. I just don't know what went wrong.

So, is the prediction script in FitCD still valid or we can now switch to:

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

kwag 12-20-2002 06:53 PM

Quote:

Originally Posted by SansGrip
Overall it looks like this encode came out well, and I can't wait to try it on the TV when the kids have gone to bed :).

Tell me about it 8O , I've been waiting for the TV to test my burned CD-Rs of "The Green Mile" and "Red Planet". My wife and my brother in law are watching a movie on the HDTV, and my kids are on the 60" old Magnavox playing Dreamcast :? :x So I'm 3'rd in queue :P

-kwag

black prince 12-20-2002 07:09 PM

@SansGrip,

Quote:

Use the mask dialog to figure out the size of the existing borders on the frame, then let me know what they are and I'll post an updated version of your script to crop them in Avisynth. I think this might be what's causing the difference.
Tmpgenc's Clip Frame mask is top=73, bot=78, left=19, and right=17 for
resize 496x448 with borders (16,16,16,16) :)

-black prince

alfredini 12-20-2002 07:40 PM

Are these values valid for pal too?
I want to encode Brain Dead :twisted:
Movie lenth is 99 min

Is this ok?:
IL = Framecount / 30 # interval length in frames
SL = round(Framerate)*2 # sample length in frames
SelectRangeEvery(IL,SL)

And what is the constant now? 0.89?

SansGrip 12-20-2002 07:45 PM

Quote:

Originally Posted by black prince
Tmpgenc's Clip Frame mask is top=73, bot=78, left=19, and right=17 for resize 496x448 with borders (16,16,16,16) :)

If that's the size of the borders before resizing then here's the script you can try:

Code:

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")
#
IL = Framecount / 60
SL = round(Framerate) * 2
SelectRangeEvery(IL, SL)
#
Crop(27, 73, 668, 328)
LegalClip()
LanczosResize(496,256)
Blockbuster( method="noise", detail_min=1, detail_max=10, variance=1, seed=1 )
AddBorders(16,112,16,112)
LegalClip()

Those are mighty big borders that you weren't cropping. No wonder the file size is so different :).

SansGrip 12-20-2002 07:46 PM

Quote:

Originally Posted by alfredini
I want to encode Brain Dead :twisted:

Don't worry, that's how I encode most of the time too :mrgreen:.

Quote:

IL = Framecount / 30 # interval length in frames
I would use 50 instead of 30, at least until we've thrashed out good values for this new GOP.

SansGrip 12-20-2002 07:53 PM

Quote:

Originally Posted by kwag
Tell me about it 8O , I've been waiting for the TV to test my burned CD-Rs of "The Green Mile" and "Red Planet". My wife and my brother in law are watching a movie on the HDTV, and my kids are on the 60" old Magnavox playing Dreamcast :?

Very simple solution: buy another TV -- maybe a 50" plasma widescreen? :mrgreen:

Quote:

:x So I'm 3'rd in queue :P
Just tell them it's an encoding emergency... ;)

alfredini 12-20-2002 07:54 PM

Quote:

Originally Posted by SansGrip
Quote:

Originally Posted by alfredini
IL = Framecount / 30 # interval length in frames

I would use 50 instead of 30, at least until we've thrashed out good values for this new GOP.


First of all... thank u verry much for the help.
But i still have some questions... :lol:


Quote:

Originally Posted by alfredini
Are these values valid for pal too?

And what is the constant now? 0.89?

Sorry but i don't get it yet

btw the quality is really superb with the new GOP

SansGrip 12-20-2002 07:58 PM

Quote:

Originally Posted by alfredini
Are these values valid for pal too?

I can't think of a reason why not.

Quote:

And what is the constant now? 0.89?
I'm not sure -- best ask kwag about that one :).

alfredini 12-20-2002 08:02 PM

Thank you Sansgrip.
I'll just give it a try and post the results tommorrow. it's 3.00 AM in Germany :D

kwag 12-20-2002 08:09 PM

50:48, or better yet:
Code:

(MovieTimeInMinutes / 2) : NTSC=48 or PAL=50
Where Snapshots will vary, depending on the movie time, and 48 is a fixed window width of 48 frame for NTSC or 50 for PAL
The factor i'm using is now .98, and seems to be pretty accurate.

-kwag

SansGrip 12-20-2002 09:40 PM

Quote:

Originally Posted by SansGrip
I can't wait to try it on the TV when the kids have gone to bed :).

Little did I know my wife would decide to order Divine Secrets of the Ya-Ya Sisterhood on PPV. DIVINE SECRETS OF THE YA-YA SISTERHOOD! For this I'm waiting...

kwag 12-20-2002 09:55 PM

Quote:

Originally Posted by SansGrip
Quote:

Originally Posted by SansGrip
I can't wait to try it on the TV when the kids have gone to bed :).

Little did I know my wife would decide to order Divine Secrets of the Ya-Ya Sisterhood on PPV. DIVINE SECRETS OF THE YA-YA SISTERHOOD! For this I'm waiting...

How about a trip to your circuit breaker box and 8O :oops: , power fail :lol:

-kwag

syk2c11 12-20-2002 10:32 PM

Hi there,
I downloaded SansGrip's sample and watched in PC and TV, I now know it is called "Gibbs". This is the thing that I have been trying to describe to you people. What causes "Gibbs" and can we get rid of it??

kwag 12-20-2002 10:38 PM

Quote:

Originally Posted by syk2c11
Hi there,
I downloaded SansGrip's sample and watched in PC and TV, I now know it is called "Gibbs". This is the thing that I have been trying to describe to you people. What causes "Gibbs" and can we get rid of it??

That's the next target :D
Quantization Matrix optimization :wink:, improvements on the KVCD Q. Matrix.

-kwag

SansGrip 12-21-2002 12:21 AM

Well, I just finished watching Untouchables on the TV and all I can say is 8O, even though that's not a word ;).

It really does look very close in quality to a DVD (at least on my TV), with the only noticible artifacts being caused by the Gibbs effect -- not so much visible mosquito noise as a "shimmering" of very high-frequency areas. It's barely noticible, though, once you stop looking for flaws and start enjoying the movie: my wife, who is untrained in the art of critical viewing, did not notice it at all :D. I'd really love to try one of these encodes on an HDTV, but no-one I know has one. kwag, could you do me a favour by burning that clip onto CD-RW and testing it on your high-definition system?? I'd be fascinated to hear if the quality stays so good on such a setup...

One problem not related to the new GOP: three times during the very beginning of the movie, separated by perhaps a minute or two, the video and audio froze for about a second, then resumed as normal. Beyond roughly five minutes into the movie it didn't happen again. I know I need to replay and see if this occurs in the same places every time (indicating perhaps a media failure), but if it doesn't, what could be causing it? Since it's only right at the start could that signal a too-low minimum bitrate?

Anyway, apart from those two very minor issues the thing looks incredible considering it's on one disc (heck, it looks better than most of my old encodes that were on 3 discs for a 2-hour movie). Naysayers be damned :mrgreen:.


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