Proxy

Proxies was introduced to allow for a smoother timeline experience. Full HD and everything from 4K size up are usually very large in file size. In addition, some commonly used codecs (e.g. h264/5) are very compressed and interframe type, so they are more stressful for timeline playback. These files cause performance problems on weaker PCs. As a solution the developers have introduced proxies to reduce the file size. Reduced means to minimize the resolution/dimension, as usually not the full resolution is needed, because the compositor usually takes only a fraction of the computer screen. Therefore the scaling factor, which indicates how much the original resolution should be reduced. There is also the proxy 1:1 that maintains the original resolution but still allows you to act on the codec (lowering the bit rate, for example). See also next section: 6.2. When we want to render the project, remember to remove the proxy to return to the original settings with the highest quality.

To use the proxy in a classic way, i.e. as a scaling, select Settings Proxy settings and change the Scale factor from Original size to your downsized choice. You can choose ffmpeg as the File Format and a choice of various codecs associated with that. A good choice is the default of mpeg which can usually be quite fast. In addition, to modify values for that codec, click on the wrench icon.

We can use the Proxy 1:1 in two ways: setting "1" as Scale factor, or check the Rescaled to project size (FFMPEG only) button. In this mode we don't have scaling, i.e. downsize, but only variations of the codec parameters that allow to maintain the original resolution. The advantage is that you can use filters that require the original size to work well. Please note that if we set any scaling, by activating the Rescaled to project size (FFMPEG only) button we automatically lose scaling and enter Proxy 1:1 mode. The size of your video is scaled down of the Scale factor but, then, it is rescaled up to the project format. For example, your format project is 1920x1080 and Proxy's Scale factor is ${\frac{{1}}{{4}}}$, then your videos will be scaled down to 480x270 and then up-scaled to 1920x1080. For an old computer, this option is not recommended.

When you have completed your choices, just click OK, and then the video tracks will be rendered. This may take some time, but previous proxy renders will be reused.

The proxy videos will be added to your assets in a separate Proxy folder , and the video track edits will use the proxies. The assets in both the Media folder and Proxy folder will look proxied when dragged to the Viewer although the scale may be different. Proxy downsizing renders all loaded tracks, but only work on the 1st video layer of any multi-layer media. Rendered proxy media is saved in the same directory as the original media. However, if you proxy your session, the clips do not get proxied to the Proxy folder, but if you Drag and Drop the clip from the Clip folder to the Viewer or the Timeline, you will see that it too is proxied. As usual, you can delete proxy files from the project or disk in the Resources window if you no longer want to retain them. And you can save your project either as proxied or not.

Because Proxy works on the original media in all circumstances, when you resize the media in the Resources window, it does not actually resize the media but puts it in a buffer in that format. This might lead to some confusion for the user who expects this resizing to be maintained when disabling Proxy for that media. However, that does not happen because the resize is only in a buffer and not in the original media. This result is different than in the case of media edits, like cuts or adding plugins because this information is not in a buffer but rather part of the copy Editing Decision List (EDL).

You can also nest clips while in a proxied state, but you can not drag the proxied nested clips to the viewer or the timeline. If you create proxies for Nested clips they will be saved in $HOME/Videos unless you modify that in Settings Preferences, Interface tab, Nested Proxy Path.

Let's examine in detail how Proxy and Proxy 1:1 modes work: when the proxy is done with downsize, the Mask, Camera and Projector automations are scaled accordingly. In this situation, the entire project will be re-sized so that the session is in the resized geometry. Not all plugins are useful when the project is scaled, because the keyframe data must be in the original geometry. In this case, you can use the il Proxy 1:1, by enabling Scale factor=1. This has the added advantage that the project size does not change. The main reason for using Proxy 1:1 is that it does not change the image coordinate data, so that automation and plugin parameters will be in the original project geometry (e.g. Title plugin).

In the upper right hand corner of the main window, there is a toggle button to easily switch back and forth when you have a proxied file on the timeline. The icon is to the left of the FF icon. It will have the letter “Ps” as the icon for Proxy.     Image proxy-01     This quick switch is especially useful when editing and you need to see a better image temporarily. The "P" is green when the proxy is active and red when it is disabled. The "s" is white when in Proxy 1:1 mode and red when downsize.

Figure 6.1: Proxy settings dialog
Image proxy-02

Screencast in figure 6.1 shows the use scaled checked so you can still use plugins and the original project size is kept. The Scale factor pull-down gives you available size options. Note the new media dimensions shown (partially covered). If the size is an odd number, 1 is added to make the dimensions both even numbers.

To go back to the original media for good, simply take the Scale factor to Off. However, if we decide to reuse the proxies, these, which have not been deleted from the Hard Disk but only from the project, will still be used without making new rendering. To completely cancel the created proxies we will have to delete them manually from the Hard Disk.

There is also a convenient Beep on done volume bar included so that you can work on other tasks until there is an audible notify of completion. The default volume is set to 0 for no audible notify.

A good choice for classic proxy settings with 1080p source video is:

Scale Factor: 	1/4
File Format:	FFMPEG - mpeg
Video Preset:
Compression:	mpeg.mpeg
Bitrate:	2000000
Quality:	-1
Pixels:		yuv420p

If you get errors for some videos, such as those with strange variable bit rate or some types of files made on a smartphone, a usually reliable alternative is to change the following parameters:

File Format:	FFMPEG - mov
Video Preset:
Compression:	mov.mov

Or if you want small files with high image quality, a File Format of m2ts is optimal. For example a 1 GB file can be reduced to 50 MB with scale ${\frac{{1}}{{2}}}$.

Checking the Creation of proxy on media loading results in any additional media loads to be automatically proxy scaled. However, single frame media such as PNG or JPEG stills, can not be scaled to stream media. If this type of media exists, you should Proxy 1:1.

If you get error messages when creating proxies, check the Video wrench settings. These usually default to values that are expected to work correctly for the File Format and codec you selected but they can be changed and may result in errors. If you get an error message of check_frame_rate failed followed by Error making proxy in the popup Errors window, do just that and check the Frame rate value by going to the Resources window, Media folder, and use the right mouse button for the Info option for that specific media in question. You can change the frame rate in this window to a more codec acceptable value. Different codecs may have different legal values.

More specific information on which plugins need to use Proxy 1:1. is provided here next. If the keyframe data uses coordinate data that is absolute, then the Factor scale = 1 should be used. If the data is normalized (like always 0 - 100%) then the proxy can be done with downsize (i.e. classic Proxy). The session geometry format, shown in Settings Format as width×height, is changed if scale factor 1 is used to cause all of the data to be in the reduced format. If this affects the plugin operation, then Proxy 1:1 should be used. Examples of plugins that need the Proxy 1:1 are: Title, AutoScale, Scale, ScaleRatio, and Translate. Most others are safe to use with downsize.

A faster method of creating the proxy file outiside of CINELERRA-GG for users who have vaapi hardware acceleration capability on their graphics board is via a script. Speed up could potentially be 10 to 30 times faster depending on the parameter values you choose and the size of your video file. This script is included in the doc subdirectory as vaapi_proxy.sh for users not using an AppImage version and is shown below. You will have to tune it to your specific needs for the vaapi_device name (currently set to /dev/dri/renderr128), file type (currently set to h264 and mp4), and proxy size (now is 6). Once you have created the proxy file, you then start Cinelerra, load the original un-proxied video, use the Settings pulldown and choose the Proxy settings options as you would normally, but because you already have created the existing proxy file with the correct name, it will be automatically loaded and will not have to create it. The filename of the proxy file must be in the same location as the original video and have the exact required naming conventions and scale factor.

#!/bin/bash
filename="$1"
fileout="${filename%.*}"
proxy="6"
# Hardware encode AMD
ffmpeg -threads 2 -hwaccel vaapi  -vaapi_device /dev/dri/renderD128 \
 -i  "$1" -c:v h264_vaapi -vf "format=nv12,hwupload,scale_vaapi=iw/'$proxy':ih/'$proxy'" \
 -vcodec h264_vaapi  -preset fast -c:a copy \
 -bf 0 -profile:v 66 "$fileout".proxy"$proxy"-mp4.mp4



Subsections
The CINELERRA-GG Community, 2021
https://www.cinelerra-gg.org