Help to crop pictures on a slideshow at DVinfo.net
DV Info Net

Go Back   DV Info Net > Windows / PC Post Production Solutions > What Happens in Vegas...
Register FAQ Today's Posts Buyer's Guides

What Happens in Vegas...
...stays in Vegas! This PC-based editing app is a safe bet with these tips.

Reply
 
Thread Tools Search this Thread
Old September 9th, 2009, 02:10 AM   #1
Trustee
 
Join Date: Nov 2008
Location: spain
Posts: 1,202
Help to crop pictures on a slideshow

Hola chicos,
i have a question for you: I have 300 pictures that i'm putting on a slideshow, now i ask you how can i avoid to open every single picture to crop it as 16:9?I tryed to do the following things: edited the first clip then , selected the events to end , then i've added a bit of quick blur and cropped to 16:9 but it pastes just the quick blur to every single clip but not the aspect ratio.What can i do?

Thx a lot
Marcus Martell is offline   Reply With Quote
Old September 9th, 2009, 02:23 AM   #2
Inner Circle
 
Join Date: Jul 2009
Location: Perth, Western Australia
Posts: 8,441
Hi Marcus

Go to track motion and make sure that the aspect ratio icon and size around centre icon is selected then just drag the box until any one of the images fill the screen correctly.

By using track motion all events on the track are resized!

I personally prefer to resize my images to the correct aspect first.That way you can control what part of the image is important. Allowing track motion to resize might chop off parts that may be important. However 300 pics are a lot of work!! By cropping you will also lose a bit of resolution if the aspect is a normal image aspect of 1.33!!

In PAL land we need to make our images for an SD DVD, 1048x576 to be widescreen!!!

Chris
Chris Harding is offline   Reply With Quote
Old September 9th, 2009, 03:21 AM   #3
Trustee
 
Join Date: Nov 2008
Location: spain
Posts: 1,202
Hallo, how can i avoid to set for every single picture the "reduce interlace flicker" function?

Thx
Marcus Martell is offline   Reply With Quote
Old September 9th, 2009, 06:57 AM   #4
Sponsor: JET DV
 
Join Date: Dec 2001
Location: Southern Illinois
Posts: 7,953
Marcus, this is where scripting comes in really handy. There are scripts out there that will do a "Match Output Aspect" on every selected image. There are also scripts that will apply the "Reduce Interlace Flicker" to selected images. Using Excalibur, I can do both of these changes AND add Ken Burns style movements at the touch of a button - seconds later, all are finished. Excalibur does cost but there are free solutions out there for matching the output aspect and adding reduce interlace flicker.
Edward Troxel is offline   Reply With Quote
Old September 9th, 2009, 08:40 AM   #5
Trustee
 
Join Date: Nov 2008
Location: spain
Posts: 1,202
Hey Ed,thank you for your attention, unfortunately i don't know any free script.....:(
If i have to tell u the truth: almost never use the scripts

maybe it's time to get started
Marcus Martell is offline   Reply With Quote
Old September 9th, 2009, 09:51 AM   #6
Sponsor: JET DV
 
Join Date: Dec 2001
Location: Southern Illinois
Posts: 7,953
Scripts are really WONDERFUL time savers.

For the Reduce Interlace Flicker, just select all the images, right-click ONE of them, choose Switches - Reduce Interlace Flicker, and they should all change.

For Match Output Aspect, copy this to Notepad and save as "MatchAspect.js"

Code:
// "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();
Edward Troxel is offline   Reply With Quote
Old September 11th, 2009, 10:37 AM   #7
Trustee
 
Join Date: Nov 2008
Location: spain
Posts: 1,202
Thank you Ed, should i get it as a word file or what else?Never worked with the scripts....
Send a big thank you
Marcus Martell is offline   Reply With Quote
Old September 11th, 2009, 10:49 AM   #8
Inner Circle
 
Join Date: May 2005
Location: Windsor, ON Canada
Posts: 2,770
Marcus, open up Notepad, copy all the code in the script Edward provided and paste this into Notepad.
From Notepad, do File-Save As.
In the window that comes up, enter MatchAspect.js in the File Name box, change the option in the Save as type: dropdown box from Text Documents (*.txt) to All Files.
Doing this ensures that it gets saved with the proper extension.
One you save it, copy/move it to the Script directory in your version of Vegas.
Mike Kujbida is offline   Reply With Quote
Old September 12th, 2009, 10:52 AM   #9
Trustee
 
Join Date: Nov 2008
Location: spain
Posts: 1,202
Hi Mike, sorry 4 da question:
where can i find the notepad?
Mike remember: u r My MJ!LOL
thx
Marcus Martell is offline   Reply With Quote
Old September 12th, 2009, 11:50 AM   #10
Inner Circle
 
Join Date: May 2005
Location: Windsor, ON Canada
Posts: 2,770
Thanks again for the compliment Marcus :-)
Notepad is found (in XP) by going Start - Programs - Accessories - Notepad.
Mike Kujbida is offline   Reply With Quote
Old September 12th, 2009, 12:49 PM   #11
Sponsor: JET DV
 
Join Date: Dec 2001
Location: Southern Illinois
Posts: 7,953
The key is that you want it to be a PLAIN TEXT file - you do NOT want any formatting Word would put into the document.
Edward Troxel is offline   Reply
Reply

DV Info Net refers all where-to-buy and where-to-rent questions exclusively to these trusted full line dealers and rental houses...

B&H Photo Video
(866) 521-7381
New York, NY USA

Scan Computers Int. Ltd.
+44 0871-472-4747
Bolton, Lancashire UK


DV Info Net also encourages you to support local businesses and buy from an authorized dealer in your neighborhood.
  You are here: DV Info Net > Windows / PC Post Production Solutions > What Happens in Vegas...


 



All times are GMT -6. The time now is 04:34 AM.


DV Info Net -- Real Names, Real People, Real Info!
1998-2024 The Digital Video Information Network