About Proxies

 

What are Proxies?

A proxy is a lower-resolution image that you substitute for your high-resolution plates for fast tests. Because the images are smaller, you drastically decrease your I/O time, memory consumption, and processing time. Naturally, your quality suffers as well, which is why proxies are generally for testing purposes. Once you assemble your script with proxies, return your script to full resolution to render your final output. You also use proxies for temporarily viewing anamorphic images in flattened space. See Overview - About Aspect Ratio for more information.

Proxies and Final Low-resolution Output Renders When you work with film plates and you need to generate a high-quality video output, you have better (but slower) results if you render your plates at full resolution and then size them down instead of using the proxies to generate low-resolution images. The proxies can be used to generate lower-resolution output files, but the quality is not as high as with the full resolution.

This example has a full resolution image and a 1/3 proxy. You can see that the proxy takes up 1/9 of the space, or only potentially 11 percent of the processing time, memory required, and I/O activity:

The Saint images used courtesy of CFC and Paramount British Pictures Ltd.

Full Resolution 1/3 Proxy


However, there is a dramatic quality difference when the result is viewed at the same resolution:

Full Resolution 1/3 Proxy

 

Shake automatically adjusts pixel-based values to compensate for the lower resolution, so a Pan of 100 pixels is calculated to be only 33.333 pixels at 1/3 proxy. The actual Pan parameters in the interactive text field are not modified.

There are three basic approaches for using proxies that are controlled in the Globals section of the interface:

pixelScale and pixelRatio These two parameters are now generally obsolete due to the new (v2.5/v1.5) proxy functions in SFileIn. They are kept for compatibility purposes.

 

Using interactiveScale

This Global parameter temporarily drops you down to a lower resolution when you are tuning a parameter. As soon as the mouse is released, the rendering snaps back to full resolution. It does not affect your output render or flipbooks. You can combine this setting with the other proxy systems.

The following is an example of using the interactiveScale parameter:


 

Give The Foundry and GenArts a call... They have very fast radial blur functions.

OK, barring the plugins, one way to accelerate your workflow is to drop the Globals - interactiveScale to 1/3:

 

As you drag the center control around, it drops down to a temporary lower resolution. When the mouse is released, it returns to full resolution.

Modify a Parameter... ...Release the Mouse


Faster RBlur. Another way to speed up interactivity is to drop the RBlur quality.

 

 

Setting Proxies

These are the normal proxies (also called on-the-fly proxies), that are generated only when needed and discarded when your disk cache is full. This set of parameters reads your input images and scales them down, placing them first into memory and then into the cache as memory runs out. It then recomputes the script at the lower values, but, unlike interactiveScale, leaves it at that resolution until you return it to full resolution. This setting affects flipbooks and FileOuts.

 

To change to a lower proxy with preset numbers




Using Proxy Sets

 


To Temporarily Set a Custom Proxy

 

Here, the proxyRatio is set to .5. As soon as proxyScale or proxyRatio is modified, the useProxy Base/P1/P2/P3 buttons turn off, since you no longer have a match to a preset proxy setting.

Full Resolution .5 proxyRatio

 

Setting the Aspect Ratio to .5 To ensure that your nodes understand the aspect ratio to be .5 (Rotate for example), set your defaultAspectRatio under Globals - format to .5. This won't modify your image, it will just affect functions like Twirl and Move2D created after you set the ratio. See Overview - About Aspect Ratio.

 

To Customize P1/P2/P3 For A Script Or Session

For example, you want to have the anamorphic Saint image as the full resolution. You want P1 to be the same width as the base file (the full resolution image) but flattened. You want P2 to be 1/4 scale and also flattened. Therefore open proxy1DefaultFile and proxy2DefaultFile and set the parameters as follows:

proxy1DefaultScale 1
proxy1DefaultRatio .5
proxy2DefaultScale 1/4
proxy2DefaultRatio .5


Note: You can now close up the useProxy subtree to clean up the Globals page.

 

Click on P1 or P2 to toggle to the flattened versions of the full resolution image:

Modified P1 Modified P2

 

Permanently Setting P1/P2/P3

Your custom settings are saved into a script. However, if you always want to use the same settings for new scripts, you can set your own P1/P2/P3 settings by creating a .h file in your startup directory. The syntax is as follows:

DefineProxyPath(
const char *proxyPath="../proxy.50/<base>.<format>",
float scale=.5,
float aspect=1,
int bytes=GetDefaultBytes(),
const char *fileFormat="Auto",
int render=0,
int alwaysAdd = 1,
int index =1,
string substitionString
);

proxyPath

Default location for pregenerated proxies (See below). Note you can use variables to grab strings from the baseName:

<base> = image name + frame range
<format> = format extension
<name> = image name (no frame range)
<range> = the frame range
<dir1>, <dir2>, etc = the name of the parent directory, two directories up, etc.

scale The proxy scale.
aspect The aspect ratio (the Y-axis scale).
bytes The default bytes for pregenerated proxies. This does not affect on-the-fly generation of proxies, so you maintain your bit depth if you do not pre-render your proxies.
fileFormat The file format for prerendered proxies. (See below).
render Turns on or off the render lights on the Render Proxies Menu. When it is on (1), the files are rendered with the Render Proxies Menu. (See below).
alwaysAdd When set to 1, an entry is added to a SFileIn node at the time of its creation.
index Sets whether you are P1, P2 or P3 (1, 2, 3). This replaces Shake's default settings, unless you set the index to 0, in which case it is appended.
replace When the first string is found in the base file name, it substitutes the second string, for example, from the first line, "4096x3112" gets substituted by "2048x1556". See below in "Working With Offline Full Resolution Elements" for more information.
 

Example. This sets a proxy of .25 with an aspect ratio of .5. It takes the default bytes setting, turns on the render light for the Render Proxies menu, adds an entry into an SFileIn, and is set as P1:

DefineProxyPath("../proxy.25.5/<base>.<format>", .25, .5, GetDefaultBytes(), "Auto", 1,1,1, "substitutionStrings");

You can also create and use predefined proxy sets in the useProxy subtree. Selecting it sets values for P1, P2, and P3. To set a group, use the following code in a startup .h file:


DefProxyGroup("4K Fullap",
DefBasePath( "../4096x3112/<base>.<format>"),
DefProxyPath("../2048x1556/.", .50, 1., GetDefaultBytes(), "Auto", 0, 1, 0, "4096x3112|2048x1556"), DefProxyPath("../1024x778/." , .25, 1., GetDefaultBytes(), "Auto", 0, 1, 0, "4096x3112|1024x778"),
DefProxyPath("../410x366/." , .10, 1., GetDefaultBytes(), "Auto", 0, 1, 0, "4096x3112|410x366")
);
//This sets the default set at startup, so obviously you only set it once.
script.proxySet = "4k Fullap"

The first line names the group. The next three lines describe the sub-proxies using the DefineProxyPath definition, except the substitutionStrings. When the first string is found in the base file name, it substitutes the second string, for example, from the first line, "4096x3112" gets substituted by "2048x1556".

 

Working With Offline Full Resolution Elements

It is sometimes convenient to only have prerendered proxies (typically generated during the scanning process) online and to substitute your full resolution elements at a later time. Shake's proxy structure allows you to do this. It is assumed that you are using a standardized naming convention that every department (or person) in your production pipeline is familiar with and following. The key to this is the use of the Replace parameters for each proxy set:

 

Replace "Gotchas". Watch out for these two concerns when working with proxies and string replacement:

  • The substitution only occurs at the time a file is loaded in, never after it is listed in the FileIn node.

  • The baseDefaultReplace occurs on any proxy file name already loaded in. The other proxy replaces parameters are always in reference to the baseImageName.

 

 

Pregenerating Your Proxies Inside the Interface

When Shake creates proxies with the useProxy method, the proxies are held in memory. Eventually, memory fills up, so the proxy images are dumped to disk into the cache. However, the cache is a closed set of files viewable only by Shake. Additionally, remote renders do not recognize the cache directory if not explicitly told. Finally, you may have so many files that the cache mechanism becomes overworked. In these cases, it makes sense to pregenerate your proxies when you start the project with an initial rendering process. The proxy files are then pulled from these precalculated images rather than generated on the fly.

You can either pregenerate the files inside the interface, or you can load them after they are created by an external process.

To pregenerate files in the interface:

Proxies and YUV files. Use caution when making proxies of YUV files, as they are always at a set resolution. Be sure to toggle your FileType to a different format. By default, the proxies are be switched to .iff format.


renderProxies Specifies whether all or just active FileIns are rendered.
timeRange Sets the range to generate proxies. When Auto is pressed, the entire frame range is calculated. Note proxies are not generated beyond the clip's frame range.
maxThread The amount of processors devoted to the process.
createProxyDirectories Creates appropriate directories.
sequential When generating many files, it may be more efficient to process each file individually, one after the other, rather than simultaneously. This is equivalent to the -sequential flag on the command line.
previewFrames Displays the thumbnails of the frames as they render.
Render proxy Defaults Must be enabled for the proxy to render. You can also open the subtree to modify any parameters. If you create your own proxy custom proxy setting with a .h file (see above), you can specify if this light is on or off by default.

 

Rendering Proxies on the command line: Use -renderproxies. You specify your settings, for example., -renderproxies p1 p3

 

When the rendering is done, you are loading the pregenerated files rather then generating them on the fly when you activate P1, P2, or P3. In a FileIn, the imageName indicates the image that is actually loaded. Open the imageName subtree to display baseFile, proxy1File, proxy2File, etc. As you toggle the Globals from Base to P1 and P2, you see imageName changes to reflect the loaded proxy file.

If you have not yet rendered a proxy file, the proxy is generated on the fly using the standard proxy technique. The imageName parameter in the FileIn turns an odd green color to indicate that it is not valid. Under the Globals - useProxy subtree is a parameter called useProxyOnMissingFile (on by default) which will generate a proxy from the closest available proxy image. This proxy is not saved to disk until you activate Render Proxies.

Note that proxy1, 2, etc., do not necessarily mean they are automatically loaded into P1, P2, P3. The proxy settings look for the files that are the closest match, so P1 may load files that are created by proxy3.

When specifying your proxy directories, you generally have one of two approaches for where to put your proxies:

Full resolution proxies and network rendering. You can use local copies of your full-resolution images by setting P1 (or whatever) to 1, 1. When you jump to P1, the local copies are used. When Base is used, the network copies can be used. This helps you do faster network renders without drawing from your machine, and also allows you to have faster local renders on your own machine. To specify this on the command line, use either

shake -proxyscale Base

to use the original files or

shake -proxyscale 1 1

to use the local full resolution copies.


Example:

This example also uses the images in pix/keylight/. Don't read the images in yet.

Set your proxy2File to:

/TEMP/saint_p.25x.5

 

Pregenerating Your Proxies Outside the Interface

There are two methods to generate proxies outside the interface.

Once your proxies are generated, you load them into the interface:

Keeping High-Resolution Elements Offline. If you have not yet loaded your full-resolution images onto a disk and are loading in a proxy into the interface, Cancel out of the FileIn and set your Globals - Format to the base resolution. This helps to automatically calculate the proxy size. Then return to the FileIn and indicate what proxy set your image is with the browser. Later, when the full-resolution elements go online, you can load in your elements with the FileIn. If your layer does not have a full resolution element the same size as Format, you must manually adjust the scale and ratio parameters for that FileIn's proxy set.


Compatibility of Proxies With Other Compositing Functions

Proxies are fine for gauging color and relative position. They do not work well for pixel-sensitive nodes like DilateErode (where you may chew just one pixel in or out) or for tracking due to round-off errors. This is not true for all filters. Blur, for example, works fine at a proxy resolution.

If you need to increase your refresh speed while working on fine detail, activate the Viewer DOD button. See Interface - Viewer for more information.

Do not use proxies for tracking.(If you want really bad tracks, then of course feel free to use them.)

Proxies also interfere with Z-depth compositing, as there is no anti-aliasing with the Z channel. The left image is a full-resolution Z composite. The right image is the same composite at a proxy resolution. The anti-aliasing of the depth channel significantly alters the image quality.

Full Resolution Proxy Image

This quality loss can be somewhat minimized by using a Box filter for your proxies, but then the rest of your image quality suffers in the lower resolutions.

 

Proxy Parameters List

Globals Tab

Parameter Notes
useProxy Specifies the proxy set to be used. The sizes are determined by opening up proxy1File, 2, etc., and setting the scale/ratio parameters. The two numbers are the scale and ratio of the proxy.
useProxyOnMissingFile When active, substitutes a proxy generated from an associated proxy file when a missing image is encountered.
proxyScale A temporary setting (though it will be saved into a script) for the proxy resolution that are overwritten by setting useProxy.
proxyRatio A temporary setting (though it will be saved into a script) for the squeeze on the Y axis to compensate for non-square pixel images that are overwritten setting useProxy.
proxyFilter The filter used in the sampled images. default is generally fine, although you may want to switch to Box when working with Z-depth files.
pixelScale An obsolete function to scale all pixel values.
pixelRatio An obsolete function to scale all Y pixel values.
baseDefaultFile This is used when you bring in prerendered proxies before loading in the full resolution elements. It is assumed you are using a standardized naming convention. Therefore, by using this, Shake can establish what the name of the full resolution elements will be based on the name of the proxy you supplied.
baseDefaultFileType The anticipated file type of the full resolution element.
baseDefaultAlwaysAdd Whether to add this into the FileIn.
baseDefaultReplace This cryptic little devil allows you to replace strings in the first loaded proxy set to be replaced by a second string, taking the format: source|replace;source|replace. For example, if you always have _lr at the end of a low resolution filename and _hr at the end of a high res, you could use _hr|_lr to automatically change myfile_hr to myfile_lr for that proxy set.
proxyXDefaultFile The default file path for that proxy set. Relative paths are relative to the image read in with a FileIn.
proxyXDefaultScale The setting for that proxy set, also setting P1, P2, etc., For example. proxy1 is P1.
proxyXDefaultRatio The Y scaling for that proxy set.
proxyXDefaultType When prerendering your proxy files, they are stored in this format. This has no effect with on-the-fly proxies.
proxyXDefaultBytes The bit-depth for prerendered proxies. This has no effect with on-the-fly proxies.
proxyXDefaultAlwaysAdd When enabled, this proxy set is added to a FileIn node when created.
proxyXDefaultReplace See baseDefaultReplace.
interactiveScale Sets a temporary proxy setting that is active only when modifying a parameter. Fully compatible with the other proxy files.

FileIn

Parameter Notes
baseFile The full-resolution image on which other images are based.
proxyXFile The directory for pregenerated proxies. This is ignored for on-the-fly proxies.
proxyXScale The scaling factor for that proxy set.
proxyXRatio The Y scaling factor for that proxy set, used for anamorphic files.
proxyXFileType The file type for pregenerated proxies. Ignored for on-the-fly proxies.

Render - Render Proxies Window

Parameter Notes
renderProxies Determines whether all FileIns or just active FileIns are rendered.
timeRange Sets the frame range to generate proxies. Pressing Auto calculates the entire frame range of the script.
maxThread The amount of processors devoted to the process.
createProxyDirectories Creates appropriate directories for you when rendering.
sequential When generating many files, it may be more efficient to process each file individually, one after the other, rather than simultaneously. This is equivalent to the -sequential flag on the command line.
previewFrames Displays the thumbnails of the frames as they render.
Render proxy Defaults Must be enabled for the proxy to render. You can also open the subtree to modify any parameters. If you create your own proxy custom proxy setting with a .h file (see above), you can specify if this light is on or off by default.

 

Command Line Options

Parameter Notes
-renderproxies Only renders the proxy subsets of the FileIns. If no subsets are specified, what is saved in the script is rendered. Otherwise, you can use -renderproxies p1 p2 p3.
-proxyscale You can specify numerical scale and ratio parameters, or use the key words Base, p1, p2, p3.
-createdirs Creates directories for the -renderproxies command. Does nothing for normal FileOuts.