PDA

View Full Version : lossless letterboxing question


BabaG
9th October 2007, 06:07
a workaround i'm using for my qtplayer/mac issue (hopefully
temporarily) raises another question.

i have files at 1024x682 and now need to make them into
1024x768. the easiest way i've found to do so is just to open
the resize filter and enter 1024 and 682 as the main size
and to check the 'expand' (i think that's what it's called, not
in front of it at the moment) option, giving 1024 and 768
as the size including letterbox.

i'm hoping this means i'm just doing a pass-through of the
main image file and adding black above and below to pad
the frame out to its full size. is this correct? the thing that
gave me pause was that i had to select a resize method for
this. to me that implied that processing of the image data
was inevitable.

if this method is altering the image area, could someone
point me at a better and truly lossless methodology.

thanks,
BabaG

fwiw, this is how i was able to get the uncompressed file to
be read in the mac system. the file produced by this export
can be read on the mac by mpeg streamclip which, in turn,
is able to resave it using the apple animation codec. hardly
efficient and i'm still hoping for a straight through solution
that will allow playback of the vdub file directly in qtplayer
but this does work. the export to qt animation codec wouldn't
work at 1024x682, though. the two things i want to fix, then,
are: i'd like to directly use the vdub file and i'd like to keep it
in its native 1024x682 aspect.

Dark Shikari
9th October 2007, 07:21
Resize stretches it; it doesn't letterbox it.

setarip_old
9th October 2007, 07:23
If you want to simply add black bars while retaining the original image size:

(In VirtualDub, set "Video" to "Full Processing Mode" and "Audio" to "Direct Stream Copy")

1) Load you video into VirtualDub
2) From the "Video" dropdown menu, click on "Filters", then click on the "Add" radio button and doubleclick on the "Resize" filter
3) Set "New width" and "New height" to the SAME resolution as your original .AVI (In this example, I'm assuming it's 720x480)
4) Put a checkmark in the box labelled "Expand frame and letterbox image - and enter a multiple of 16 in "Frame height" (Increasing the initial height by perhaps 208, or 192 to approximate 16:9 - which, in this example, will mean increasing the height from 480 to 688 or 672)
5) Click on "OK" to return to the "Filters" window

6) Once again, doubleclick on the "Resize" filter
7) Set "New height" to 480 (This will reduce the ENTIRE image, including the black bars to 480 pixels of vertical resolution). Click on "OK" until you get back to the main VirtualDub window
8) Save with a new filename

BabaG
10th October 2007, 00:14
thanks dark shikari and setarip_old.

setarip_old, in my question i'm trying to go from 1024x682 (3:2)
to 1024x768 (4:3). the way i'd come up with accomplished this with
only a single instance of the resize filter. do you have any details on
why this would not work as well as your method. not trying to be
critical, just curious as to haw these filters work.

does the selection of 'direct stream copy' override the selection
of a resize method (bicubic, etc.) if the image is not actually being
altered, just having material added, top and bottom? if not, wouldn't
it be better to have only the single instance of the filter?

and lastly, am i just interpreting this wrong because your example
would actually alter the image size, bringing the sides in to a
smaller overall width? in other words, my example starts with an
image 1024x682. the final image, while technically 1024x768, still
has the original image at its original size of 1024x682 and has just
added bars top and bottom. i believe your example would actually
bring the width down to a smaller size. am i correct in this?

thanks again,
BabaG

setarip_old
10th October 2007, 00:45
I believe you stated that you want the movie resolution to stay in its original size and wanted only to add black space/bars to increase the overall size. What I've described will accomplish that.

What you've described will increase the size of the movie itself and distort it, with no black bars...

neuron2
10th October 2007, 00:54
He just wants to add black bars, that's all. Use AddBorders() in Avisynth.

In VirtualDub, if the image size remains the same, the choice of a resize method is irrelevant. You can just add the letterboxing and don't worry about the resize method.

BabaG
10th October 2007, 05:05
thanks for the reply neuron2. (love your work, btw.) this kind of thing
can be a lot more difficult to describe than to actually do but you
seem to have it clear as to what i'm looking for. just so i have it
clear on my end, you seem to present two methids to get at what
i want:

1. avisynth AddBorders()
2. the method i've described.

am i correct that you're saying that by entering the existing
frame size into the first two fields in vdub i'll get a straight
passthrough of the original image area into a larger frame
(same width, new height) with the additional height filled by
a border? (if i select the 'expand' option and give it a larger
height value.)

or is your suggestion just to omit the vdub filtering and use the
avisynth method because the vdub filtering will in some way alter
the image?

thanks and sorry for the obtusenitude,
BabaG

thearklight
12th October 2007, 21:51
Quick scan of this thread says
You want to just add black bars?
That's it?

Easy. Emilano's FILL BORDERS filter
Download here. You get it as
part of his filter pack...

http://emiliano.deepabyss.org/

unzip vdfs in archive file into your
plugins folder.

Play with the revelent numbers fields and you'll
see the borders appear in any direction you want.
And in any colour too.Renders fast too.

In the virtualdub for beginners thread under the title
"essential filters" (control f to do search).There's an animated
Gif of the filter in operation.

http://forums.virtualdub.org/index.php?act=ST&f=4&t=14396&

Hope that helps.

Heri.