Auto Pan Zoom


PieroF_AutoPanZoom_v1.1R.fxscript.zip: (click the link to Download)

For Technical Notes: see the next page.

What does it do ?

Auto Pan Zoom is a freeware Filter that automatically applies Ken Burns effects: it slowly zooms in on subjects of interest and pans from one subject to another.

The same pans and zooms may be manually created using the Motion controls in the FCE and FCP Viewer (see for example Tom Wolsky’s Motion Control in FCE for instructions); however, in most cases Auto Pan Zoom does not require any specific setting because, by default, it creates random pans and zooms.

As a result, the same filter applied to different images generates a different motion for each image.

One Step Usage

After its Installation, drag the filter AutoPanZoom v1.1 from the Video Filter > pf folder of Effects to the selected the clip in the Viewer or the Timeline. Or, drag the filter from the Effects folder into the timeline over a number of clips, that you previously selected.

That’s all you need to do...: the filter will do the rest, and the motion of each clip will be different.

In addition, you may add transitions between clips to make a full photos presentation with automatic Ken Burn similar to what you get in iPhoto.

Additional instructions for a full slideshow are in the Example A. below. This 3-step procedure will take no more than one minute,... after selecting and sizing your images! Just make sure that you use images with higher resolution (at least 50%) than the sequence to get a better image quality while zooming.

Note: that the main goal of this filter is to make all its settings very seldom needed: the idea is that in most cases this One Step Usage, and possibly the following Basic Usage, are all you really need to get a nice presentation!

Basic Usage

If the above method does not satisfy you, you probably need more control over the images motion; then you can start using the Setup Mode in an elementary way, as described below.

Suppose you want panning and zooming around a specific subject in the image below, instead of the default center of the frame: for example around the small lamp under the porch in the next figure.


For this purpose you may use the Setup Mode (new in v1.1) to select the lamp in the canvas window using the Center control in the filter as follows:

  1. 1.check the Setup Mode checkbox;

  2. 2.set the Center: click the Center cross-hair button and then click the subject you want to center in the canvas (the lamp in the example above); now the canvas shows the original picture with a red rectangle that bounds the area of possible panning paths;

  3. 3.uncheck the Setup Mode checkbox; now the effect is applied and the clip may be rendered.

Note that in Setup Mode no motion is applied to the image while you play the clip; instead a highlighted rectangular area moves over the original image showing what will be displayed in standard mode. This allows to easily control the final panning and zooming and to read some additional information about the filter behaviour. When Setup Mode is abandoned the currently highlighted area fills the screen to show the actual effect as in the figures below.

Setup Mode Display                                    Standard Display

 

In the figure on the left a red rectangle marks the boundaries of the area where the two ends of the panning path are randomly selected (in this example Center = (-95, -148) and Auto Pan = 30): a thin blue line shows the current panning path and a highlighted area shows the portion of the picture that will be scaled to fill up the screen, as you can see in the figure on the right, where Setup Mode is OFF. Note that in Setup Mode you can also read the current automatic zoom on the original image (53% in the example): too much zooming must be avoided because it might deteriorate the image quality (more details in Setup Mode in Filter Controls below).

If you prefer a smaller or wider range of random values, simply change Auto Pan to smaller or higher values (where 0 = no pan = no motion): these will make the red rectangle smaller or larger around the same Center.

In the Advanced Usage below you learn how to fully control the image motion by defining a preferred direction in the panning, its randomness, easy in and out of the motion.

Additional examples and tips are available at the end of this page.

Compatibility, Disclaimer

This Auto Pan Zoom filter has so far been tested in Final Cut Express v4.0.1, but it will likely work also in other versions of FCE and in FCP as long as they provide support for the fxscript language (see also the Disclaimer).

Version History

v1.1 - Added a Setup Mode and Easy In and Easy Out controls (thanks Andy Mees).

v0.6.4 - Removed a bug that made the image “jump” in some circumstances.

v0.6.3 - Major fixes to the first release: now it works with any mix of image and sequence size and the Auto Pan control is more effective.

v0.5 - First release.

Advanced Usage

After its Installation choose the filter as described in One Step Usage above, and then set the controls that are described below after an overview of the filter behaviour.

Filter Behaviour Overview

In order to understand the Auto Pan Zoom behaviour keep in mind that the main task of this filter is to randomly choose a start point and an end point for panning, and automatically evaluate how much zooming is required to always fill the frame. More specifically:

  1. the panning path is a straight segment that defines the points in the original picture that have to be centered in the output video frame by frame during panning.

  2. So, for example, if the panning path goes from (-180, 0) to (180, 0), the filter will center the point (-180, 0) of the first frame; then it will center the second point of the second frame, and so on; at the end of the path, the filter will center the point (180, 0) of the last frame. This works both with still images and with moving clips, even if usually Ken Burns effect is applied only to still images.

  3. By default the speed of the motion along the panning path is constant, but the 2 controls Easy In and Easy Out allow to modify the start and end speed separately applying a Bézier curve to its acceleration.

  4. Panning paths are represented by blue lines or arrows in Setup Mode.

  5. by default both the start and the end points of the panning path are randomly chosen within a main rectangular area (red frame in Setup Mode) defined by the Center and the Auto Pan controls. The moving image follows the path fron start to end;

  6. the end point may be optionally selected (if Enable is ON) within a secondary rectangular area with Center 2 (yellow frame in Setup Mode) different from the start point area: this allows to set a rough direction for panning, even if the start and end points are still selected randomly in the 2 areas;

  7. it’s possible to remove the random selection and force panning along a specific segment (if Auto Pan = 0) and force the direction from the first to the second area (if Disable Random Reverse = ON);

  8. Recall: in general the start and end points of the panning path are not Center or Center 2; Center and/or Center 2 become the actual start and end points only if Auto Pan = 0; if also Enable is OFF, the image is centered and possibly zoomed to Center, but no motion is applied;

  9. automatic zooming is applied in general in order to avoid (transparent) borders to appear in the output frames; the amount of zoom is always evaluated at the 2 ends of the panning path in order to be the minimum possible zoom, and linearly changes along the path between the 2 extreme values; the zoom values may be read frame by frame in a message while in Setup Mode:

  10. it’s possible to disable (or reduce) zooming by lowering the Auto Zoom value (where 0 = no zoom). In this case the image is moved over a transparent background; by superimposing clips then you can get overlapping moving frames;

  11. the Lock Effect control (ON by default) makes sure that the random values for panning and zooming are evaluated only once for each clip: if you like the current effect, Lock Effect = ON makes sure this effect is not changed by future rendering. Instead if Lock Effect is unchecked the panning and zooming values change each time you render or play the clip from the first frame;

  12. finally the Setup Mode allows to tune the filter parameters without actually activating the filter: in Setup Mode the image is neither panned nor zoomed, but the rectangular areas are displayed where the 2 path ends are randomly selected, together with the currently selected panning path; finally, the area of the clip that will be visible during panning is highlighted.

Filter Controls

The parameters to control panning and zooming follow. The default values are adequate for a standard moderate random effect.


  1. Setup Mode (default: OFF): when OFF the effect is applied to the clip according to the following parameters; this is the standard working mode.

  2. Setup Mode may be set ON to help controlling the motion parameters on the source clip, before the actual motion is applied. In this mode some information is displayed in place of the actual motion (see the examples above):

  3. the main random area around Center is displayed by a red frame;

  4. the secondary random area around Center 2 (if Enable = ON) is displayed by a yellow frame;

  5. the currently selected panning path is displayed by a blue line;

  6. the visible area of the clip (which will actually move when Setup Mode = OFF) is highlighted;

  7. a message displays the current clip zoom: this is used to verify that the original clip will not be blurred by an excessive zoom. When the zoom value of the image is larger than 100% it is displayed in yellow, and when larger than 120% in red;

  8. a warning message is displayed, if the zoom value exceeds either 100% or 120% in any point of the panning path.

  9. Important: See also Technical Notes D.

  10. While not mandatory, it’s good practice to enter Setup Mode before modifying the other filter controls: this gives you better control on the filter behaviour. You can switch Setup Mode ON and OFF as many times as you like to check the actual results of your settings.

  11. To get precise settings while in Setup Mode = ON, make sure that the Sequence Frame Size control (in the Advanced Section) is set correctly. Its default DV is OK only for DV-PAL or DV NTSC 4:3 formats; if you use HDV or AVCHD or anamorphic sequences you have to select the correct value.

  12. Center (default: 0, 0): it defines the center of the main “random area”, that is the rectangular area for the random selection of the panning path. The size of this area is defined by the Auto Pan (% frame) control; a red frame is displayed in Setup Mode around the main random area.

  13. If Enable is OFF this area is used for the selection of both ends of the panning path: each end is independently and randomly selected within this area. If Enable is ON only the start point of the panning path is randomly selected in this area: instead the end point is selected in the secondary area (Center 2).

  14. Let’s recall that in general Center is not the start or end of the panning path (unless Auto Pan = 0): instead, the start and/or end of the panning path will be statistically more or less close to Center depending on Auto Pan.

  15. Auto Pan (% frame) (default: 30 - range: 0 - 100): it defines the size of the area around Center (and that around Center 2, if Enable = ON) to be used for the random selection of the end points for panning path. For example Auto Pan = 30 defines a rectangle with edges that are 30% of each frame dimensions; in this case if the frame is 720x480 the rectangle is 216x144.

  16. If Auto Pan is 0, the exact values of Center and Center 2 are used: no random selection occurs.

  17. As an example, using the filter default settings (Center = (0, 0), Auto Pan = 30, and Enable = OFF), a panning path may be generated from (-108,-72) to (0,0), or from (-50,60) to (0,-20), etc.; but no path from (-100, 0) to (200,60) or similar will be generated, because one or both of its ends are out of the main “random area” (see more examples in Technical Notes A. and B.).

  18. Auto Zoom (default: 1 - range: 0 - 1): it defines the amount of automatic zoom-in that may be applied by the filter during panning.

  19. If Auto Zoom = 0, no zoom is allowed and the image moves leaving transparent borders. In this case the path end points may be outside the frame.

  20. If Auto Zoom = 1, a zoom factor is automatically defined as a function of the random path, to make sure that no border ever appears around the image. In fact the closer a Center is to a frame border, the higher is the evaluated zoom. Values between 0 and 1 are allowed and have intermediate effects. If Auto Zoom > 0 the path end points are always within the video safe area.

Pan to Center 2:


  1. Enable (default: OFF): when Enable = OFF both ends of the panning path are randomly selected in the random area based on Center and Auto Pan as described above.

  2. When Enable = ON the start of the path is randomly selected in the main random area, while its end is randomly selected in a new secondary random area based on Center 2 and Auto Pan. In fact, by default, also the direction (whether from main to secondary, or from secondary to main area) is randomly chosen between the two ends, unless Disable Random Reverse is ON.

  3. Center 2 (default: 0, 0): it defines the center of the secondary “random area” as described above (yellow rectangle). Also the size of this area is defined by the Auto Pan (% frame) control.

  4. This area is used for the selection of an end of the panning path only if Enable is ON, otherwise its value is ignored. A yellow frame is displayed in Setup Mode around the main random area.

  5. As an example, with the default settings for Center = (0, 0) and Auto Pan = 30, suppose now Enable = ON and Center 2 = (180,0): now a panning path may be generated from (-100,0) to (200,60), because (200,60) is now in the secondary random area, but no path from (-108,-72) to (0,0) may be generated (see more examples in Technical Notes A. and B.).

  6. Disable Random Reverse (default: OFF): in general if Enable = ON, and Disable Random Reverse = OFF, the direction between the 2 points is randomly selected (similar to the two and points in the corresponding random areas). Instead, if Disable Random Reverse = ON, the direction is always from a start point in the main area to an end point in the secondary area, even when these points are randomly selected within their own areas. If Enable = OFF, Disable Random Reverse is ignored.

Advanced:


  1. Easy In (default: 0.33 - range: -1 to 1): it controls the speed of the clip at the beginning of its panning path: its default value determines a linear speed; if Easy In = -1 the start speed is high and decreases along the path; if Easy In = 1 the speed starts from 0 and increases along the path. See Example D. below.

  2. Easy Out (default: 0.33 - range: -1 to 1): it controls the speed of the clip at the end of its panning path: its default value determines a linear speed; if Easy In = -1 the speed increases toward the end of the path; if Easy In = 1 the speed decreases along the path to stop at the end. See Example D. below.

  3. If their default values are used, the clip speed along its panning path is constant (linear) only depending on the clip duration and the path length.

  4. Lock Effect (default: ON): when Lock Effect = ON the random values for panning and zooming are evaluated only once per each clip, and subsequent rendering or playback of that clip maintain the same path and behaviour. As an exception new random values are evaluated, even when Lock Effect = ON:

  5. the first time the filter is applied to a clip from the Effects bin (instead if the filter is copied from another clip it keeps the same behaviour as in that clip);

  6. when any control in the filter is modified, and the playhead is positioned to the first frame or the clip is rendered, and Setup Mode is changed from ON to OFF.

  7. Instead, if Lock Effect = OFF, new random values are evaluated each time the clip is rendered or is played starting from its first frame, so at each playback or rendering the clip will behave differently. Don’t forget to switch back to Lock Effect = ON if you want to preserve the current panning path in the clip.

  8. See also Example B. below.

  9. Sequence Frame Size (default: DV): this parameter is required to allow a precise positioning of Center and Center 2 in images that have different frame aspect from the timeline sequence. Since the frame size and aspect ratio of the sequence cannot automatically be determined by the filter, this parameter must be manually set to:

  10. DV: if the sequence is 4:3 PAL or 4:3 NTSC the correct frame size (720x576 vs. 720x480) is automatically selected.

  11. DV Anamorphic: if the sequence is 16:9 PAL or 16:9 NTSC the correct frame size (720x576 vs. 720x480) is automatically selected.

  12. 1280 x 720: if the sequence is HDV 720p25 or 720p30.

  13. 1440 x 1080: if the sequence is HDV 1080i50 or 1080i60, or AVCHD 1440x1080i50 or 1440x1080i60.

  14. 1920 x 1080: if the sequence is AVCHD 1920x1080i50 or 1920x1080i60.

  15. See also in Technical Notes C.

  16. Clip is Anamorphic (default: OFF): this parameter must be set for some anamorphic images (usually PAL) in order to allow a precise positioning of Center and Center 2.

Note that if Sequence Frame Size and/or Clip is Anamorphic are not set properly, this plugin still works but the Center and Center 2 parameters do not precisely point to objects in the canvas frame.

Examples:

  1. A.A simple three-step slideshow preparation:

  2. 1.prepare all images where you want to apply the Auto Pan Zoom filter, in one sequence in the timeline; if you already have your images collected in a bin in the browser, you may simply drag the bin to the timeline, and all images will be inserted in one shot; now select them all in the timeline;

  3. 2.drag the Auto Pan Zoom filter from the Effects tab over the selected images in the timeline; when a brown border appears around the selected clips you can release the mouse. You just applied the filter to all the selected clips, and each clip will behave different from the others because different random values are generated in each clip;

  4. 3.apply any transition you like. In FCE you may add the Default - Cross Dissolve transition in just one step. First make sure that:

  5. the playhead is parked on the first frame of the first image

  6. the track with the images is selected as the destination track (e.g. V1 as in this figure)

  7. Now drag all selected clips from the timeline to the Overwrite with Transition area in the Canvas window. As a result the cross dissolve transition is applied to all of them.

  8. If you want to fix panning or zooming for some clip, open that clip in the viewer and modify its controls following the instructions in the Basic or Advanced Usage section above.

  9. B.How to use Lock Effect

  10. In general you should keep Lock Effect = ON: this preserves the initially randomly selected panning and zooming. Each time you’ll playback or render the clip you’ll see the same behaviour.

  11. However if you don’t like the selected behaviour, you can set Lock Effect = OFF and ON again: this causes a new behaviour to be randomly selected and locked again.

  12. You may keep Lock Effect = OFF to evaluate the random paths that may be generated by the filter with a specific configuration: while this option is OFF, playback the clip many times, each time returning the playhead to its first frame, and each time the path will be different:

  13. position the playhead on the first frame of the clip in the timeline (up arrow)

  14. play the clip (space bar): you see panning

  15. go back to the first frame of the clip (up arrow)

  16. play the clip (space bar): you see a different panning

  17. etc.... until you like the motion.

  18. (make sure the timeline window is selected for the above space - up arrow - space - up arrow sequence to work as described)

  19. Don’t forget to immediately switch back to Lock Effect = ON as soon as you like the panning path selection; otherwise you’ll lose your choice when the filter will be rendered!

  20. C.Why to drag the filter from the Effects folder and not from other clips?

  21. This filter automatically creates a new random panning path each time it is newly installed into a clip. This is always true, even if Lock Effect is ON. If you copy the filter from any clip, it will retain the same panning path of that clip; unless later you manually change its settings.

  22. Then, in order to apply the same filter to many clips and get different paths (as in One Step Usage above), you must drag it from the Effects folder only: either from its original bin in Video Filters/pf or from the Favorites bin. If you drag it or copy it from other clips, or you use Paste Attributes the filter still works but the paths will be the same in all destination clips and equal to the path in the source clip. Obviously you can always change them manually but you lose the advantage of the “one step” operation...

  23. If you want to change some default values of the filter parameters, and still have different random panning paths as above, do as follows:

  24. 1.take note of the new default value: for example Easy In = 1 and Easy Out = 1;

  25. 2.drag a new instance of the filter from the Video Filters/pf bin into the Viewer (NB: not from another clip or into another clip !);

  26. 3.apply the new default values to that instance (Easy In = 1 and Easy Out = 1);

  27. 4.drag the filter from the Viewer into the Favorites bin in the Effects tab of the Browser. Now the new values for Easy In and Easy Out are saved in Favorites and the filter has not been installed yet into any clip.

  28. When you drag this filter from the Favorites bin into any number of clips in the timeline, you get different paths as if it were dragged from Video Filters/pf, but the new values for Easy In and Easy Out will be applied.

  29. D.Using Easy In and Easy Out

  30. By default the motion of the clip along its panning path has constant speed. This is usually fine, mainly if you use transitions between clips, like the cross dissolve transition (see Example A. above).

  31. In some cases, however, you might prefer to have the image to speed up at the beginning and to slow down at the end of the motion. This is possible in Auto Pan Zoom by changing its Easy In and Easy Out controls to 1. With these settings the image shows up steady at its first frame and slowly starts to move along the panning path to full speed in its middle; then it gradually slows down to stop at the end of the clip.

  32. Even if unlikely used, you can also do the reverse: with Easy In = -1 the image starts moving fast at its first frame and then slows down in the middle of its panning path. The same is true for Easy Out.


Technical Notes: see the next page.