'Ello all,
While not strictly a problem, I'm baffled by a certain Huffyuv behaviour I discovered today.
The situation is as follows:(Further resizing/cropping/borders will be added down the road to preserve aspect ratio, of course. But now I'm talking about the raw material).
- 1:20 minute Black-and-White (passed greyscale filter) clip
- No sound
- Original capture at 640x576
- Cropped to 610x560 to eliminate underscan/headnoise/garbage areas.
Now.
Saving this file, at the cropped 610x560 resolution, yields a 1GB (actually 0.99) file.
Saving this file, using 'resize to 610x576' (Nearest Neighbour - don't shout at me! It isn't resizing anything!) and letterboxing back to 640x576 yields a... 699 MB file.
![]()
Anybody care to explain how does a larger frame consisting of a black border makes the overall filesize 30% smaller?...
-- Baffled Piggie
+ Reply to Thread
Results 1 to 12 of 12
-
-
well - that's a good issue all right
I guess that Huffy could compress the black border very efficiently especially since it's a nice clean generated black, but that should only increase the file size a small amount - not decrease any way.
So the short answer is - nope, no idea
Try and replicate it and see what you get -
Originally Posted by D_Knife
610x560 resolution yielded something like 4.5 GB, letterboxed 640x576 was about 3.4 GB.
More is less.
-- Still baffled Piggie -
It might have something do do with the compression algorithm that Huffyuv uses. I know mpeg2 requires the size to be a multiple of 16, so maybe Huffyuv is much less efficient for certain resolutions.
Another thing to try for comparison would be to resize to 640x576 without the black bars and see how the size changes. Also try adding a black box rather than cropping and resizing and letterboxing (will look the same, but could be treated differently) -
Conjecture here not fact:
1) Is the actual viewing area in the letterbox smaller by a % which is not discernable to you. Very little of the bitrate will be used in the dark letterbox areas. So compare the actual video view.
2) The resize creates duplicate or linear or bicubic average pixels in the whole frame image which are then carried through the GOP structure increasing the compression. Like applying a smoothing filter which does a similar thing.There's not much to do but then I can't do much anyway. -
Originally Posted by gll99
Originally Posted by gll99
The actual pixel data in both cases should be the same (still, according to my note regarding 1., it isn't).
Originally Posted by Thorn- Original file 45 seconds, 418 MB, letterboxed
- File cropped to 610x560 = 600 MB
- File re-letterboxed to 640x576 = 418 MB
- File cropped then resized to 640x576 = 413 MB, and the top line stays intact
This shows a consistent behaviour regarding certain resolution. I'm still baffled about the why's.
Originally Posted by Thorn
-- Piggie -
first pass is probably being saved as RGB, second pass is probably being converted to YUY2.
YUY2 is generally smaller. -
Originally Posted by bani
Note the steps above:
Step 1 - Original at 418 MB
Step 2 - Cropped at 600 MB
Step 3 - Letterboxed again, 418 MB.
According to your (correct) logic, Step 1 should have been smaller than Step 3. Which would have been true, had Step 1 been YUV. It isn't.
Still baffled.
-- Piggie -
30% is what you would expect from RGB->YUY2
other than that, no ideas. but its the explanation that makes the most sense. -
Originally Posted by bani
But there is no RGB->YUV conversion here. All are RGB.
Originally Posted by bani
-- Piggie -
To add letterboxing without resizing, you'd simply crop your edges, as you've already done. Leave the image material at it's new cropped size, and fill in the blanks with letterboxing. No resize required.
Example only, as I have no idea what your source size is:
640x576 ---> edges removed/cropped to 640x560
Your step: Resize to 640x576?
This you can leave out. Just add your borders without resizing
Borders added ( 640x560 ---> 640x576 )
You get the point. The aspect ratio is maintained.
On the RGB question, someone correct me, but doesn't Huffy offer the option to convert to YUY2?Impossible to see the future is. The Dark Side clouds everything... -
I have the feeling something has been missed in my explanation.
The 'steps' I described before, are not 'steps' I make all-the-way-through. Each 'step' is a file on its own, and I'm stunend at the results.
I'm aware of how to letterbox, and have done it the way you [DJRumpy] suggest. I'm surprised why does a letterboxed file - No, rephrase: Why does a 640x576-frame-file - is SMALLER than a file which is cropped - read, a file with a smaller frame, a file with a 610x560-frame.
Original file @ 640x576 ==> Cropped to 610x560.
That's the only 'data portion' I want. No resize, no nothing. And that's what I have, I'm not asking 'how to do this'.
My point is, that if I produce this file, as 610x560, it weights n MB.
If I produce the same data, letterboxing it to 640x576, using the resize filter only to letterbox, not to resize anything, I get a file which weights about n-30%.
The only time I actually resized the 610x560 data to 640x576, is to test if Thorn's suggestion works - that the actual resolution impacts the size - and it did. A 640x576 file consistently was ~30% smaller than a cropped file, regardless of the question whether the 640x576 frame was letterboxed or resized.
Regarding the YUV/RGB issue:
Yes, Huffyuv works both, and it can convert RGB to YUV.
However, the RGB->YUV conversion is, as it says, 'not completely lossless'.
I capture in YUV.
While processing the video (filters etc.), VDub process it in RGB mode.
From that point on, I don't convert it back to YUV. From that point on, RGB it is, and RGB it stays.
The 'Original' file I used, as explained, is already a processed file. It's already in RGB format.
So, again:
Original file is RGB format.
Output file, cropped, is RGB format.
Output file, cropped and letterboxed, is RGB format.
Output file, cropped and resized, is RGB format.
Cropped frame is same size as active frame in letterboxed file.
No further processing is made. No resizing is made. No lossy compression is involved. No YUV/RGB conversion is involved.
A 610x560 resolution file weights 30% more than a 640x576 one.
The question is not 'how', the question is why.
Please, by all means, do test it yourselves. Capture at 640x576. Turn the image to greyscale. Save. You now have it in pure RGB format. Then work from that file on.
Load the resulting file.
Crop. Save
Letterbox. Save.
Check file sizes.
-- Piggie
Similar Threads
-
Looking for an explanation of strange behaviour
By Duwgati in forum Authoring (DVD)Replies: 6Last Post: 29th Jul 2011, 07:03 -
Reconverting Divx videos to smaller Divx files.. strange resolution
By arcooke in forum Video ConversionReplies: 2Last Post: 19th Jul 2011, 02:35 -
behaviour of srt with avi vs. dvd
By flannob in forum Newbie / General discussionsReplies: 1Last Post: 11th Oct 2010, 11:49 -
Lagarith codec producing larger filesize with smaller resolution?
By BozQ in forum Newbie / General discussionsReplies: 22Last Post: 15th Sep 2009, 10:11 -
Rotated .MOV file, weird behaviour
By Leo48 in forum Newbie / General discussionsReplies: 4Last Post: 26th Apr 2008, 17:18