HD render to DVD - avoid pillarbox?

jeremyk wrote on 4/3/2015, 7:23 PM
If I change the properties of my 720p project to NTSC DVD Widescreen, narrow black bars appear on the sides of the image, because DVD widescreen isn't quite the same aspect ratio.

What's the best & easiest way to get rid of the bars and maintain highest quality. I know I could go through each event and "match output aspect" on all the pan/crop keyframes, but there must be another way.

Comments

johnmeyer wrote on 4/3/2015, 9:36 PM
Select all the events you want to change and then run this script:
// "Match Output Aspect" on all selected video events.
// No selection = ALL

import System.Windows.Forms;
import Sony.Vegas;

var zero : int = 0;

function GetSelectionCount (mediaType)
{
var cTracks = Vegas.Project.Tracks.Count;
var cSelected = zero;
var ii;

for (ii = zero; ii < cTracks; ii ++)
{
var track = Vegas.Project.Tracks[ii];

if (track.MediaType == mediaType)
{
var eventEnum : Enumerator = new Enumerator(track.Events);

while ( ! eventEnum.atEnd() )
{
if (eventEnum.item().Selected)
{
cSelected ++;
}

eventEnum.moveNext();
}
}
}

return cSelected;
}

function GetActiveMediaStream (trackEvent : TrackEvent)
{
try
{
if ( ! trackEvent.ActiveTake.IsValid())
{
throw "empty or invalid take";
}

var media = Vegas.Project.MediaPool.Find (trackEvent.ActiveTake.MediaPath);

if (null == media)
{
throw "missing media";
}

var mediaStream = media.Streams.GetItemByMediaType (MediaType.Video, trackEvent.ActiveTake.StreamIndex);

return mediaStream;
}
catch (e)
{
//MessageBox.Show(e);
return null;
}
}

function MatchOutputAspect (keyframe : VideoMotionKeyframe, dMediaPixelAspect : double, dAspectOut : double)
{
var keyframeSave = keyframe;

try
{
var rotation = keyframe.Rotation;

// undo rotation so that we can get at correct aspect ratio.
//
keyframe.RotateBy (-rotation);

var dWidth = Math.abs(keyframe.TopRight.X - keyframe.TopLeft.X);
var dHeight = Math.abs(keyframe.BottomLeft.Y - keyframe.TopLeft.Y);
var dCurrentAspect = dMediaPixelAspect * dWidth / dHeight;
var centerY = keyframe.Center.Y;
var centerX = keyframe.Center.X;

var dFactor;

var bounds = new VideoMotionBounds(keyframe.TopLeft, keyframe.TopRight, keyframe.BottomRight, keyframe.BottomLeft);

if (dCurrentAspect < dAspectOut)
{
// alter y coords
dFactor = dCurrentAspect / dAspectOut;

bounds.TopLeft.Y = (bounds.TopLeft.Y - centerY) * dFactor + centerY;
bounds.TopRight.Y = (bounds.TopRight.Y - centerY) * dFactor + centerY;
bounds.BottomLeft.Y = (bounds.BottomLeft.Y - centerY) * dFactor + centerY;
bounds.BottomRight.Y = (bounds.BottomRight.Y - centerY) * dFactor + centerY;
}
else
{
// alter x coords
dFactor = dAspectOut / dCurrentAspect;

bounds.TopLeft.X = (bounds.TopLeft.X - centerX) * dFactor + centerX;
bounds.TopRight.X = (bounds.TopRight.X - centerX) * dFactor + centerX;
bounds.BottomLeft.X = (bounds.BottomLeft.X - centerX) * dFactor + centerX;
bounds.BottomRight.X = (bounds.BottomRight.X - centerX) * dFactor + centerX;
}

// set it to new bounds
keyframe.Bounds = bounds;

// restore rotation.
keyframe.RotateBy (rotation);

}
catch (e)
{
// restore original settings on error
keyframe = keyframeSave;
MessageBox.Show("MatchOuput: " + e);
}
}


var dWidthProject = Vegas.Project.Video.Width;
var dHeightProject = Vegas.Project.Video.Height;
var dPixelAspect = Vegas.Project.Video.PixelAspectRatio;
var dAspect = dPixelAspect * dWidthProject / dHeightProject;
var cSelected = GetSelectionCount (MediaType.Video);


var cTracks = Vegas.Project.Tracks.Count;
var ii;

for (ii = zero; ii < cTracks; ii ++)
{
var track = Vegas.Project.Tracks[ii];

if (! track.IsVideo())
{
continue;
}

var eventEnum : Enumerator = new Enumerator(track.Events);

while ( ! eventEnum.atEnd() )
{
var trackEvent : TrackEvent = eventEnum.item();

if ( !cSelected || trackEvent.Selected )
{
var mediaStream = GetActiveMediaStream (trackEvent);

if (mediaStream)
{
var videoStream = VideoStream (mediaStream);

var dMediaPixelAspect = videoStream.PixelAspectRatio;
var videoEvent = VideoEvent(eventEnum.item());
var keyframes = videoEvent.VideoMotion.Keyframes;

var cKeyframes = keyframes.Count;
var jj;

for (jj = zero; jj < cKeyframes; jj ++)
{
MatchOutputAspect (keyframes[jj], dMediaPixelAspect, dAspect);
}
}
}

eventEnum.moveNext();
}
}


Vegas.UpdateUI();



musicvid10 wrote on 4/3/2015, 10:30 PM
Less elegant, but you can tick the "Stretch to fill output" box when you render.
TheHappyFriar wrote on 4/4/2015, 6:40 AM
Unless you zoom in you're stretching, aren't you? So the "stretch to fill" is the exact same things that happens when someone takes a 4:3 TV show and uses their TV to stretch it to 16:9, right?

I've never cared about the black bars personally.
Chienworks wrote on 4/4/2015, 6:49 AM
It won't be much of a stretch. HD is 16:9 and widescreen SD is 16.3636:9. It's only stretching it about 2.27%, which is much less than the 33.33% stretch to of 4:3 to widescreen. It probably wouldn't be noticeable.
PeterDuke wrote on 4/4/2015, 6:55 AM
Just view the video on your TV a little bit to the side of the perpendicular to compensate for the stretch.
PeterDuke wrote on 4/4/2015, 6:58 AM
"I've never cared about the black bars personally."

You prefer fat people to black bars?

Your name is not Friar Tuck, is it?

Chienworks wrote on 4/4/2015, 8:37 AM
I believe HappyFriar meant just the opposite, in that he doesn't care about the black bars being there. I'd agree with this as well. I'd rather have the aspect ratio correct than have the screen filled.
TheHappyFriar wrote on 4/4/2015, 10:51 AM
Chien is right. I said "never cared ABOUT the black bars", not "never cared FOR the black bars."

But do I prefer fat people vs black bars... aren't we starting to get in to possible federal discrimination law here? ;)
Chienworks wrote on 4/4/2015, 5:44 PM
I was looking around Best Buy today and saw a nifty new 80" 4K flat screen that had 3-way speakers built into the sides, about 9" wide, facing forward. The entire speaker assembly was jet-black and glossy. It would be mostly invisible black rectangles on either side of the screen in dimmed room light. The thought struck me that this would look like perma-piller-boxing. I wonder how much the "anti-black-bars" folks would object to it.
PeterDuke wrote on 4/4/2015, 7:04 PM
Black bars don't worry me but even if they did, I am sure that I would much prefer the better sound from forward facing decent sized speakers.
PeterDuke wrote on 4/4/2015, 7:21 PM
Chien is right. I said "never cared ABOUT the black bars", not "never cared FOR the black bars."

I stand corrected.

However, whenever I see the name TheHappyFriar I always have visions of Robin Hood and his merry men.

And as for discrimination in bars and saloons, I won't go there.
TheHappyFriar wrote on 4/4/2015, 8:31 PM
The Happy Friar is a restaurant at Ceder Point. I've been there but didn't intend to use the same handle as their name.
jeremyk wrote on 4/5/2015, 2:40 PM
Thank you, John! That's exactly what I needed. Black bars gone but original shape retained, at the small cost of a little trimmed off the top and bottom of the image.

Jeremy
OldSmoke wrote on 4/5/2015, 2:58 PM
jeremyk

You could also render to 704x480. It will give you perfect NTSC DV 16:9 with no distortion.

Proud owner of Sony Vegas Pro 7, 8, 9, 10, 11, 12 & 13 and now Magix VP15&16.

System Spec.:
Motherboard: ASUS X299 Prime-A

Ram: G.Skill 4x8GB DDR4 2666 XMP

CPU: i7-9800x @ 4.6GHz (custom water cooling system)
GPU: 1x AMD Vega Pro Frontier Edition (water cooled)
Hard drives: System Samsung 970Pro NVME, AV-Projects 1TB (4x Intel P7600 512GB VROC), 4x 2.5" Hotswap bays, 1x 3.5" Hotswap Bay, 1x LG BluRay Burner

PSU: Corsair 1200W
Monitor: 2x Dell Ultrasharp U2713HM (2560x1440)

Arthur.S wrote on 4/6/2015, 6:06 AM
I know LCD/LED TV's have a much smaller overscan area, but won't the black bars be so small they'll be lost in the TV's overscan?