Credit Andrea - clarified Render Farm section based on user suggestions
[goodguy/cin-manual-latex.git] / parts / Plugins.tex
1 \chapter{Plugins}%
2 \label{cha:plugins}
3 \index{plugins}
4
5 There are realtime effects -- these are the most useful and probably all you will ever need -- and rendered effects.
6 The rendered effects are discussed separately in the \nameref{sec:rendered_effects}  section.
7 Effects that begin with the characters F\_ are effects that are part of the FFmpeg software
8 as opposed to those coded within the \CGG{} program.  These are discussed separately in
9 \nameref{sec:ffmpeg_audio_video_plugins}.
10 Effect plugins modify the track when played, according to how they are set, with no permanent storage of the output except when the project is rendered. There are many Plugins in \CGG{} Infinity which are actually quite easy to use just by experimenting with them. 
11 The plugins are shown and selected from the \textit{Resources window} (figure~\ref{fig:video-plugins}). They are described in more detail later.
12
13 \begin{figure}[htpb]
14     \centering
15     \includegraphics[width=1.0\linewidth]{video-plugins.png}
16     \caption{Screencast of the native Video plugins in the default Cinfinity icon set.}
17     \label{fig:video-plugins}
18 \end{figure}
19
20 There is a choice of plugin icons \index{plugins!icons} which can be displayed.
21
22 In \texttt{Settings$\rightarrow$ Preferences$\rightarrow$ Appearance} tab, there is a pulldown for \textit{Plugin icons} where the user can choose between the \textit{original} icons, \textit{regular} or \textit{smoother}, \textit{cinfinity}\protect\footnote{Cinfinity /2 icon set is credited to Sam - Creative Common By -- \url{https://creativhecommons.org/licenses/by/3.0/}} -- the default modernized set, or \textit{cinfinity2} (figure~\ref{fig:audio-plugins}).
23
24 \begin{figure}[htpb]
25     \centering
26     \includegraphics[width=0.6\linewidth]{audio-plugins.png}
27     \caption{Cinfinity2 audio plugins}
28     \label{fig:audio-plugins}
29 \end{figure}
30
31 Note that when you change the plugin icons, your session will automatically save the backup, stop, restart, and reload (figure~\ref{fig:plugin-icons}).
32
33 \begin{figure}[htpb]
34     \centering
35     \begin{tikzpicture}[scale=1, transform shape]
36     \node (img1) [yshift=0cm, xshift=0cm, rotate=0] {\includegraphics[width=0.5\linewidth]{plugin-icons.png}};
37     \node [yshift=-6mm, xshift=-1cm,anchor=east] at (img1.north west) (Preferences) {Preferences Window};
38     \node [yshift=-14mm, xshift=-1cm,anchor=east] at (img1.north west) (Tab) {Tab section};
39     \node [yshift=-34mm, xshift=-1cm,anchor=east] at (img1.north west) (Icon) {Plugin icon choices};
40     \draw [->, line width=1mm] (Preferences) edge  ([yshift=-6mm] img1.north west);
41     \draw [->, line width=1mm] (Tab) edge  ([yshift=-14mm] img1.north west);
42     \draw [->, line width=1mm] (Icon) edge    ([yshift=-34mm] img1.north west);
43     \end{tikzpicture}
44     \caption{Screencast showing the screen to change your plugin icons set}
45     \label{fig:plugin-icons}
46 \end{figure}
47
48 \section{How to Use Plugins}%
49 \label{sec:how_use_plugins}
50
51 \textit{Realtime} effect plugins are listed in the Resources window as \textit{Audio} Effects and \textit{Video} Effects. Effect plugins are used by dragging them from the Resources window onto an audio track if it is an audio effect or video track if it is a video effect. You will see a colored bar \index{plugins!toolbar} appear beneath the track with the plugin name on it. If there is data on the destination track, the effect is applied to the entire track, unless a edit or a region of the track is selected (wipe selection or In/Out points) in which case the effect is pasted into that region only. If there is no data on the track or no selected region set, the effect is not added.
52
53 Plugins are layered under the track they apply to in what is referred to as the effect bar.  Do a double click on the effect bar to select the effect region.  When dragging more than one effect onto an armed track, you will see the effects layering from \textit{top to bottom}, on the bottom of that track. When the track is played back, effects are processed from \textit{top to bottom}. The output of the top effect becomes the input of the bottom effect and so on. "The pipeline in Cinelerra's\protect\footnote{credit to Original Creator} plugin design is the \textit{pull} method. The rendering pipeline starts at the final output and the final steps in the rendering pipeline are reading the data from disk. Every step in the rendering chain involves requesting data from the previous step. When the rendering pipeline eventually requests data from a plugin chain, each plugin requests data from the plugin before it. This is less intuitive than the push method but is much more powerful. Realtime plugins written using the pull method can change the rate data is presented to the viewer and the direction of playback. The pull method allows plugins to take in data at a higher rate than they send it out."  Side note: if you want to avoid the automatic \textit{top to bottom} application of plugins, you can take advantage of \textit{nested assets} to manipulate the order the plugins are applied (see  \ref{sec:nesting_clips_and_assets}).
54
55 Instead of dragging from the Resources window, effects may be applied to a single armed track or a region via a popup menu. On the entire track or on a region determined by a selection wipe or by the In/Out points, right click and select \textit{Attach effect} \index{plugins!attch effect} from the popup. The attach effect dialog gives you more capability than just dragging and dropping. For example, the attach effect dialog lets you attach two more types of effects: \textit{shared effects} and \textit{shared tracks} which are explained in a later section. Select a plugin from the Plugins column and hit the green colored checkmark under the plugins column to attach it. The result is the same as if the effect was dragged from the Resources window.
56  
57 One more method to apply an effect on all armed tracks of the same type (video or audio) is to use the \textit{Video} or \textit{Audio} pulldown \textit{Attach Effect} option. This brings up a menu which has a useful checkbox to \textit{Attach single standalone and share others} (see \ref{sec:shared_effect_tracks}). The default setting is checked on.
58
59
60 After attaching an effect to a track, it often needs to be configured. There are two ways to get to the configuration controls. Click on the magnifying glass \index{plugins!show controls} symbol on the right side of the effect bar -- this is the middle symbol on the bar as you can see in the picture below. Alternatively, you can right click on the effect bar to bring up the effect popup which has a \textit{Show} option. Either method causes the GUI for the effect to appear in a separate window. There will not be a popup if the plugin has no GUI.
61
62
63 Besides the magnifying glass, for Show Controls, on the effect colored bar beneath the track, there are two more symbols.
64
65 \begin{wrapfigure}[2]{r}{0.3\linewidth}
66     \vspace{-3ex}
67     \centering
68     \includegraphics[width=0.7\linewidth]{button-options.png}
69 \end{wrapfigure}
70
71 The rightmost knob is used to Turn Off/Turn \index{plugins!turn on/off} On the effect where the default is On. This is useful to easily see that the plugin is doing what you expect. The leftmost symbol that looks like a gear is for \textit{Preset Edit} \index{plugins!preset edit} and its usage is described in the section \nameref{sec:saved_plugin_preset}.
72
73 \section{Editing Effects}%
74 \label{sec:editing_effects}
75 \index{plugins!editing}
76
77 Many operations exist for manipulating effects once they are on the timeline. Because mixing effects and media is quite complex, the methods used in editing effects are not as concise as cutting and pasting. Some of the editing happens by dragging in/out points, some of the editing happens through popup menus, and some of it happens by dragging effects.
78
79 When enabled, which is the default, and you edit tracks, the effects follow the editing decisions. If you cut from a track, the effect shrinks. If you drag edit in/out points, the effect changes length. This behavior can be disabled by selecting \texttt{Settings$\rightarrow$ Preferences$\rightarrow$ Interface tab$\rightarrow$ Editing section}, see figure~\ref{fig:editing-effects} \index{keyframes reticle}.
80
81 \begin{figure}[htpb]
82     \centering
83     \includegraphics[width=0.9\linewidth]{editing-effects.png}
84     \caption{Screencast showing the menu where Editing Effects behavior is changed.}
85     \label{fig:editing-effects}
86 \end{figure}
87
88 To edit effects, you can move the timeline cursor over the effect borders until it changes to a resize left or resize right icon. In this state, if you drag the end of the effect, it performs an edit just like dragging an edit edge. The five editing behaviors of track trimming \index{trim} apply to effect trimming and they are bound to the mouse buttons that you set in interface preferences as shown in the previous screencast. \textit{Trimming} simply means changes the duration dragging the edges.
89
90 When you perform a trim edit on an effect, the effect boundary is moved by dragging it. Unlike track editing, the effect has no source length. You can extend the end of an effect as much as you want. Also unlike track editing, the starting position of the drag operation does not bind the edit decision to media. The media the effect is bound to does not follow effect edits. Other effects, however, do follow editing decisions made on an effect. You can disable effects from being subject to the edit decisions by using the pulldown \textit{Settings} and toggling off Edit effects. If you drag the end of an effect which is lined up to effects on other tracks, the effects on the other tracks will be edited while the media stays the same. When you drag an effect in from the Resources window you can insert the effect in the portion of the row unoccupied by the trimming operation. In some cases you will want a trimming operation to change only one row of effects. This can be achieved by first positioning the insertion point on the start or end of the effect. Then press the shift key while beginning the trimming operation. This causes the operation to change only one row of effects.
91
92 You can move effects up or down. Every track can have a stack of effects under it. By moving an effect up or down you change the order in which effects are processed in the stack. Go to an effect and right click \index{plugins!RMB on toolbar} to bring up the effect menu. The \textit{Move up} and \textit{Move down} options move the effect up or down. When you are moving effects up or down, be aware that if they are shared as shared effects, any references will be pointing to a different effect after the move operation.
93
94 Finally, there is dragging of effects \index{plugins!dragging}. Dragging effects works just like dragging edits. You must select the arrow in the main window transport buttons line to enter drag and drop mode before dragging effects. Dragging a plugin causes a highlight outline to be drawn over a targetable timeline region, and the plugin can be re-positioned into any plugin track.  The effects snap to media boundaries, effect boundaries, and tracks. If you drag a reference to a shared effect, the reference may point to the wrong effect afterwards.  It is recommended that you re-construct shared effect track references.
95
96 Figure~\ref{fig:drag-effect} showing 3 plugins, two still plugin, two have already been dragged and the \textit{Color 3 Way} in the process of being dragged. Note the gold-colored frame which enables allow \textit{drag and drop} editing mode.
97
98 \begin{figure}[htpb]
99     \centering
100     \includegraphics[width=0.7\linewidth]{drag-effect.png}
101     \caption{Dragging the Color 3 way effect}
102     \label{fig:drag-effect}
103 \end{figure}
104
105 \section{Copy/Paste Effects}%
106 \label{sec:copy_paste_effects}
107 \index{plugins!copy paste effects}
108
109 In \textit{Drag and Drop} mode we can copy and paste edits containing plugins (see also \nameref{sub:copy_paste_behavior}). Start by selecting an edit (that contains plugins) with LMB and open the context menu with MMB. The possibilities offered are:
110
111 \begin{description}
112         \item[Ctrl - c]: copy edits and plugins to buffer.
113         \item[Ctrl - v]: paste edits and plugins into the timeline (splice) at the Insertion point.
114         \item[Ctrl - b]: paste edits and plugins into the timeline (overwrite) at the Insertion point.
115         \item[Ctrl - Shift - p]: paste only the plugins into the timeline, at the Insertion point, keeping the original length (overwrite).
116         \item[Collect Effects]: copy only plugins into buffer.
117         \item[Paste Effects]: pastes the plugins into a selected target edit. The length of the plugins adapts to the length of the edit.
118 \end{description}
119
120 \section{Shared Effects and Shared Tracks}%
121 \label{sec:shared_effect_tracks}
122 \index{plugins!shared effect}
123 \index{plugins!shared tracks}
124
125 Two other effect types available in the Attach Effect dialog are \textit{Shared effects} and \textit{Shared tracks}. In the case of a shared effect, the following conditions must be true:
126
127 \begin{itemize}[noitemsep]
128     \item There must be other effects in the timeline.
129     \item The other effects must be of the same type as the track you are attaching an effect to. That is for audio tracks, effect must be audio and for video tracks, effect must be a video effect.
130     \item The insertion point or selected region must start inside the other effects.
131 \end{itemize}
132
133 Before going into further detail about how to use \textit{Shared effects}, an easier
134 alternative method of application which is especially useful for Audio tracks is
135 available.  In this method, all you have to do is use the \textit{Audio} pulldown and
136 choose \textit{Attach effect} \index{plugins!attach effect}, highlight the effect you would like and make sure the
137 default of \textit{Attach single standalone and share others} is checked on.  It will
138 automatically be a "Shared Effect" on all audio tracks (be sure to disarm any audio
139 tracks that you do not want to have the effect shared on).  This method also works for
140 Video tracks using the \textit{Video} pulldown choice of \textit{Attach effect}.
141
142 In the case of a shared track, there must be another track on the timeline of the same type as the track you are applying an effect to. If you right clicked on a video track to attach an effect, there will not be anything in the shared tracks column if no other video track exists. The same applies equally to audio tracks in that another audio track must exist. Shared tracks are often used as layers for titles, curves and keyframes.
143
144 If shared effects or shared tracks are available, they appear in the shared effects and shared tracks columns when you used the \textit{Attach effect} option (RMB on a track). When the green colored checkmark is clicked OK, anything highlighted in the column is attached under the current track.
145
146 Shared effects and shared tracks allow very unique things to be done. In the case of a shared effect, the shared effect is treated like a copy of the original effect, except that in the shared effect the GUI can not be brought up. All configuration of the shared effect is determined by the GUI of the original effect and only the GUI of the original effect can be brought up.
147
148 When a shared effect is played back, it is processed just like a normal effect except the configuration is copied from the original effect. Some effects detect when they are being shared. These effects determine what tracks are sharing them and either mix the two tracks together or use one track to stage some value.
149
150 When an original track has a shared track as one of its effects, the shared track itself is used as a \textit{realtime} effect. This is more commonly known as \textit{bouncing tracks} but \CGG{} achieves the same operation by attaching shared tracks. The fade and any effects in the shared track are applied to the original track. Once the shared track has processed the data, the original track performs any effects which come below the shared track and then composites it on the output.
151
152 In order to prevent the shared track from mixing the same data as the original track on the output, enable the output \texttt{mute} \index{mute} toggle in the patchbay next to each track for which you do not want to mix on the output. If you are making a video and you do want the shared track to composite the original track's data on the output a second time, the video from the shared track would always appear under the video from the original track, regardless of whether it was on top of the original track. This is because shared tracks are composited in order of their attachment. Since it is part of the original track it has to be composited before the original track is.
153
154 \section{Saved Plugin Presets}%
155 \label{sec:saved_plugin_preset}
156 \index{plugins!preset edit}
157
158 \textit{Presets} and \textit{Factory Presets} for Plugin settings are now combined with the Preset Keyframe Parameters allowing you to choose, apply, delete, and edit your own Presets which can then be easily saved in the file \texttt{\$HOME/.bcast5/Cinelerra\_presets}. In addition to your own saved presets, there are automatically available Factory presets for some plugins, for example the Lens video plugin. The Factory presets are preceded by an asterisk (*) and can not be modified permanently.
159
160 \begin{wrapfigure}[4]{r}{0.3\linewidth}
161     \vspace{-2ex}
162     \centering
163     \includegraphics[width=0.7\linewidth]{preset.png}
164 \end{wrapfigure}
165 Note that using this is directly changing a keyframe object so you will only want to modify parameters you are familiar with. Most of the data is obvious and safe to change.
166
167 A Presets button on the plugin bar to the left of the Controls and On/Off button allows for quick access to this feature. The symbol resembles a slider (figure~\ref{fig:preset02}).
168
169 \begin{figure}[htpb]
170     \centering
171     \begin{tikzpicture}[scale=1, transform shape]
172     \node (img1) [yshift=0cm, xshift=0cm, rotate=0] {\includegraphics[width=0.6\linewidth]{preset02.png}};
173     \node [yshift=-20mm, xshift=-1cm,anchor=east] at (img1.north west) (Green) {A user preset Green};
174     \node [yshift=-67mm, xshift=-1cm,anchor=south east,text width=10em, inner ysep=-3mm] at (img1.north west) (Textbox) {Textbox to type in the title for the chosen preset or name for a new preset.};
175     \node [yshift=-79mm, xshift=-1cm,anchor=north east,text width=10em,inner ysep=-3mm] at (img1.north west) (Save) {Use the Delete, Save or Apply button for operation.};
176     \draw [->, line width=1mm] (Green) edge  ([yshift=-20mm] img1.north west);
177     \draw [->, line width=1mm] (Textbox.south east) --  ([yshift=-67mm] img1.north west);
178     \draw [->, line width=1mm] (Save.north east) --    ([yshift=-79mm] img1.north west);
179     \end{tikzpicture}
180     \caption{Screencast shows 4 Factory presets as preceded by an *.}
181     \label{fig:preset02}
182 \end{figure}
183
184 \section{Some specific details concerning Plugins}%
185 \label{sec:specific_details_plugins}
186
187 These next few sections explain some details about the plugins that are not directly related to actually using them but help to work with them.
188
189 \subsection{How to see short Description of a Plugin}%
190 \label{sub:short_description_plugin}
191 \index{plugins!short description}
192
193 To get a short one or a few lines description of a plugin, mouse over that plugin in the Resources window and a popup appears. You can disable the popup by right-clicking and choosing \textit{Info Off} (shortcut "i"). And again enable it with \textit{Info On}. Some of the plugins may not have any description included. An example screenshot is next (figure~\ref{fig:info-effect}).
194
195 \begin{figure}[htpb]
196     \centering
197     \includegraphics[width=0.8\linewidth]{info-effect.png}
198     \caption{Effect Info for Color 3 Way}
199     \label{fig:info-effect}
200 \end{figure}
201
202 \textit{Context Help} provides more detailed information about the plugin in 4 possible
203 ways using the Alt/h hotkey combination. 
204 \begin{enumerate}
205         \item Pressing \texttt{Alt/h} with the mouse in the dialog window of that plugin's settings menu.
206         \item Pressing \texttt{Alt/h} while pointing with the mouse on the plugin bar in a track, transition bar, or transition icon.
207         \item Pressing \texttt{Alt/h} while pointing on the plugin name (icon) in the Resources window. If plugin tooltips are on, help for the highlighted plugin under the mouse is shown. If plugin tooltips are off, help for the selected plugin is shown.
208         \item Pressing \texttt{Alt/h} while pointing on the plugin name in the \textit{Attach Effect} dialog menu.
209 \end{enumerate}
210
211 \subsection{Delete Plugins to save Resources Space or make them Unavailable}%
212 \label{sub:delete_plugin_resouces_unavaible}
213
214 Maybe you just don't ever use certain plugins or would prefer to only find the ones that are useful to you. To save space in the Resources Window so you don't have to scroll to find the plugins you want as much, a feature to delete others is available. If you have a System install, you will have to be root for this function to be usable. The plugins will be permanently deleted, but only until you rebuild or download a new set of \CGG{} binaries. To delete a plugin, highlight the plugin you no longer want in the Resources window then press Ctrl-Shift-delete. A small window will come up allowing you to change your mind and red-X out or check-OK to remove plugin. 
215 AppImage does not provide this capability unless you use the workaround as described in the Appendix \nameref{cha:faq_problems_workarounds}.
216
217 This feature may come in handy if you have personnel working on media for you and you only want them to exercise certain functions. Or maybe you can't remember which is the good \textit{deinterlace} plugin out of the available five or so and want to delete the extras so as not to be confused. The ffmpeg, \textit{ladspa}, and \textit{lv2} plugins can not be deleted in this manner but, of course, you can always turn them off from view by clicking on \textit{Visibility} and unchecking them (figure~\ref{fig:remove-effect}).
218
219 \begin{figure}[htpb]
220     \centering
221     \includegraphics[width=0.6\linewidth]{remove-effect.png}
222     \caption{Remove Deinterlace-CV plugin}
223     \label{fig:remove-effect}
224 \end{figure}
225
226 \subsection{Updatable Icon Image Support}%
227 \label{sub:updatable_icon_image_support}
228 \index{plugins!change icons}
229
230 When running \CGG{} Infinity builtin icons are loaded before the
231 program starts. Png files in the path:\\
232 \texttt{<target\_directory>picon/picon\_set\_name}\\
233 are searched before the images loaded into memory. Override
234 \texttt{icon.png} files must be put into the path:\\
235 \texttt{<target\_directory>/picon/picon\_set\_name}\\
236 There are currently 4 sets of icons and their directory names are
237 \textit{cinfinity} (the default) and \textit{cinfinity2},
238 \textit{original} (the long-time original set), and
239 \textit{smoother} (generally was in use by some of the themes). An
240 example, to replace the cinfinity icon of Blue Banana with a red
241 apple instead, create your \texttt{.png} file as desired, and replace the
242 file in:\\
243 \texttt{<target\_directory>/bin/plugins/picon/cinfinity/bluebanana.png}.
244
245 For most User installs, the \texttt{<plugin\_name>.png} file will be located at:
246
247 \texttt{<cinlib\_path>/bin/plugins/picon/cinfinity} (or cinfinity2, original or smoother)
248
249 For some System installs, the files might be located at:
250
251 \texttt{/usr/lib/cin/plugins/picon/cinfinity}
252
253 (or cinfinity2, original or smoother -- ubuntu distros)
254
255 \texttt{/usr/lib64/cin/plugins/picon/cinfinity}
256
257 (or cinfinity2, original or smoother -- Leap distro)
258
259 AppImage does not provide this capability unless you use the workaround as described in the Appendix \nameref{cha:faq_problems_workarounds}.
260
261 \subsection{Details on where to put your own Plugin Icons}%
262 \label{sub:details_put_plugin_icons}
263
264 In order to make the icons available to all themes, which would thus be the default when no theme-specific icon is available, put the png file in the:
265
266 \texttt{<cinlib\_path>/bin/plugins/picon/cinfinity} (or cinfinity2, original or smoother)
267
268 The \CGG{} program looks for a plugin icon in two places:
269
270 \begin{enumerate}
271     \item First, it tries to find a png file in \texttt{<cinlib>/plugins/picon/cinfinity}(2) or original, smoother directory.
272     \item If there is no corresponding \texttt{.png} file for a plugin, the program uses a built-in default:
273     \begin{itemize}
274         \item ordinary video plugins use 3 vertical color bars as a default;
275         \item ffmpeg plugins use the words \textit{FF} on yellow colored background as a default icon;
276         \item audio and ladspa plugins use a green-colored audio wave for a default.
277     \end{itemize}
278 \end{enumerate}
279 \begin{figure}[htpb]
280     \centering
281     \includegraphics[width=0.05\linewidth]{audio-default.png}
282 \end{figure}
283
284 Keep in mind these points for newly created plugin icons:
285
286 \begin{itemize}
287     \item All included icon images become part of open source, in the public domain, and not proprietary.
288     \item The preferred format is $52 \times 52$, $8\,bit$ /color RGB or RGBA, non-interlaced.
289     \item Since plugin icons are used by different themes, it is recommended that a \textit{transparent background} be used. Otherwise some color background that looks good for one theme may not for another.
290     \item In order to test a new icon, you have to have write permission in the: \\
291     \texttt{<cinlib\_path>/plugins} directory so you may have to become the root user to copy the \texttt{.png} file to the correct location.
292     \item If there is currently no theme-specific \texttt{.png} files present, it may be necessary to first create the theme directory in \texttt{<cinlib\_path>plugins} as \texttt{<theme\_name>} in order to put the \texttt{.png} files in that subdirectory.
293     \item Make sure that the \textit{ownership} and file \textit{permissions} match the existing directory and files.
294     \item All ffmpeg icons must begin with \texttt{ff\_<plugin\_name>.png} (Resources window title will still be F\_\dots)
295     \item For ladspa, check in the \texttt{<cin\_config>} directory (\texttt{\$HOME/.bcast5} normally) and look for the text file \texttt{\$HOME/.bcast5/ladspa\_plugins\dots} for the names of the ladspa libraries which correspond to plugin names where the needed name is the basename of the \texttt{.so} file.
296         For example \texttt{pha\-sers\_1217.so} would need to have a \texttt{phasers\_1217.png} file. There may be multiple plugins in a single “so” file which means that you can only have 1 icon to represent all of the plugins in that file; again as in phasers.
297     \item Once you have placed the .png file in the correct spot, you will have to restart \CGG{} to test it.
298     \item To submit your \texttt{.png} file for inclusion into \CGG{} Infinity for all to enjoy, it is best to upload it to any datafilehost and notify the community via email with any informative documentation.
299 \end{itemize}
300
301 \subsection{Example of new Plugin Icon Testing}%
302 \label{sub:example_plugin_icon_testing}
303
304 For a simple test just copy an existing \texttt{<plugin\_name>.png} file into the cinfinity directory with the name \texttt{bluebanana.png} to write over the existing file. This icon will now show up in \CGG{} and still execute the Blue Banana function.
305 AppImage does not provide this capability unless you use the workaround as described in the Appendix \nameref{cha:faq_problems_workarounds}.
306
307 For an ffmpeg plugin, create \texttt{ff\_loop.png} and copy it to: \\
308 \texttt{<cinlib\_path>/plugins/picon/original}. This icon will show up in \CGG{} if original is selected and execute the \textit{F\_loop} function.
309
310 For a ladspa plugin, the text line in \texttt{\$HOME/.bcast5/ladspa\_plugins}$\dots$ as seen below:
311 2 \texttt{am\_pitchshift\_1433.so} \\
312 \texttt{AM pitchshifter} $1504922321\, 0\, 1\, 0\, 0\, 1\, 0\, 1\, 0\, 1\, 0\, 0$ indicates that you would create the icon: \\ \texttt{<cinlib\_path>/plugins/picon/cinfinity/am\_pitchshift\_1433.png} \\
313 For your own personal plugins, you can create a directory on your system and put any plugin png files you like into that directory. For example, if you want a specialized picon for \textit{F\_aeval}, create a picon named \texttt{ff\_aeval.png} in: \\ \texttt{<cinlib\_path>/plugins/picon/yournamehere.}
314
315 \begin{lstlisting}[style=sh]
316 cd <cinlib>/plugins            # go to the correct directory
317 mkdir -p picon/yournamehere    # create subdirectory if does not exist
318 ls -l picon/*                  # list the picon directories
319                                # check for existence (and permissions)
320 cp yourpicon.png ff_aeval.png  # Copy your example .png file
321 \end{lstlisting}
322
323 Restart cin by changing \texttt{Settings$\rightarrow$ Preferences$\rightarrow$ Appearance} and in \textit{Plugins icons} choose a directory.
324
325 \subsection{Plugins/Effects Visibility}%
326 \label{sub:plugins_effects_visibility}
327 \index{plugins!visibility}
328
329 \CGG{} contains many plugins, especially with the addition of ffmpeg, and it is somewhat difficult to find the one you are looking for in the Resources window. In \CGG{} Infinity, the plugins have been categorized into the following subsets in the \textit{Visibility} section of the Resources window to make it easier to locate a particular one:
330
331 \textit{Audio Effects, \quad Video Effects, \quad Audio Transitions, \quad Video Transitions}
332
333 \begin{figure}[htpb]
334     \centering
335     \includegraphics[width=0.8\linewidth]{visibility01.png}
336     \caption{Screenshot showing on the left hand side the Visibility box with Audio Effects highlighted.}
337     \label{fig:visibility01}
338 \end{figure}
339
340 The \textit{Visibility} tool in the Resources window (figure~\ref{fig:visibility01}) gives you the ability to turn off or on any of several sets of plugins. If you left-click the Visibility box, you will see the various categories of plugins, such as \textit{ladspa}, \textit{ffmpeg}, \textit{audio}, \textit{lv2}, and \textit{video} (figure~\ref{fig:visibility02}).
341
342 \begin{figure}[htpb]
343         \centering
344         \includegraphics[width=0.6\linewidth]{visibility02.png}
345         \caption{Screenshot showing the Visibility categories of plugins with all toggled on and audio highlighted.}
346         \label{fig:visibility02}
347 \end{figure}
348
349 Highlight the set you want to turn on and a check mark appears to show it is active. Highlight again to toggle it off. See the next screenshot which illustrates that all of the plugins are turned off (not visible) except for audio. There is also the ability to add your own personal directory of plugins which will show up here. All you have to do to have these plugins become visible is to create a directory, with some name that is meaningful to you, and put your .png files in your: \\
350 \texttt{cinelerra\_path bin/plugins/<your\_directory\_name>}.
351
352 \subsection{Expanders for Plugin Subtrees in the Resources Window}%
353 \label{sub:expanders_plugin_subtrees}
354
355 To accentuate a set of common plugins, there are \textit{expander} arrows on the left side of the Resources window. You will see these expanders only when in \textit{Display text} mode, not \textit{icon} mode.
356 \CGG{}’s default setup is in the file \texttt{\$CIN\_DAT/expan\-ders.txt} but if the user wants their own specific setup and if the file in \texttt{\$HOME/.\\bcast5/expanders.txt} exists, it will take precedence.
357 If there are recommendations for other relevant categories, they can be added. The subtree structure is applicable to any of the \textit{Video Effects/Transitions} or \textit{Audio Effects/Transitions}. You can not sort once an expansion is in effect (figure~\ref{fig:expander}).
358
359 \begin{figure}[htpb]
360         \centering
361         \includegraphics[width=0.8\linewidth]{expander.png}
362         \caption{Down facing triangle, Right facing triangle = expander; "-" = options}
363 %       the next line causes problems for the HTML version so do not use
364 %       \caption{$\triangledown$,$\triangleright$ = expander; "-" = options}
365         \label{fig:expander}
366 \end{figure}
367
368 The \texttt{expanders.txt} file has very specific requirements. The most specific is that there are no blanks -- you must use tabs only. A \# (pound sign) can be used in column 1 to indicate a comment. A short example of what the txt file looks like is shown below.
369
370 \begin{lstlisting}[style=sh]
371 Video Effects
372     -Favorites
373         Brightness/Contrast
374         Title
375         VideoScope
376     - Color_Correction
377         Blue Banana
378                           Color 3 Way
379         Color Balance
380 Audio Effects
381     - Calf
382     - Instruments / Generators
383         L2_Calf Organ
384         L2_Calf Monosynth
385         L2_Calf Fluidsynth
386 \end{lstlisting}
387
388 NOTE: The capability to put the expanders.txt file in \texttt{./bcast5} (see \nameref{sec:bcast5}) allows for customizations such as grouping favorite plugins in one section so that they can be recalled more quickly. For this purpose, the \textit{Favorites} section has been included at the top of Video Effects, the contents can be changed as desired. Once your modified file is saved to hard disk as \$HOME/.bcast5/expanders.txt it will remain in use on every update as long as you do not delete it or remove the .bcast subdirectory.
389 For users running \CGG{} using the AppImage, to make an initial copy of expanders.txt, execute the
390 following lines on /tmp:
391 \begin{lstlisting}[numbers=none]
392         git clone --depth 1 "git://git.cinelerra-gg.org/goodguy/cinelerra.git" cinelerra5
393         cp /tmp/cinelerra5/cinelerra-5.1/expanders.txt $HOME/.bcast5/expanders.txt
394 \end{lstlisting}
395
396 \subsection{Speed-up of Ffmpeg plugin usage with OPTS files}%
397 \label{sub:speedup_ffmpeg_plugin_opts}
398 \index{plugins!speed-up via options}
399
400 You can speed up some ffmpeg plugins that are quite time-consuming and use a lot of CPU\@. For a specific color-based example, \CGG{} uses 6 primary rendering color models. All of them have 3 components at full scale. Direct usage of a particular ffmpeg plugin from the ffmpeg command line might handle the planar at less than full scale chroma (yuv420), which means there is less data to manipulate. But when cinelerra loads a video it uses full scale color models. In other words:
401
402 \begin{itemize}[noitemsep]
403     \item \CGG{} uses \textit{yuv444}
404     \item ffmpeg uses \textit{yuv420}
405 \end{itemize}
406
407 if using an ffmpeg plugin that uses filters and many passes over the data, the amount of data is a big factor. If you load a file in \CGG{} with a
408
409 \texttt{same\_directory\_path\_and\_filename.opts}
410
411 file containing the following line, the full scale color modeling upgrade will not be performed until after any plugin, and then the render is faster:
412
413 \begin{lstlisting}[style=sh]
414 video_filter=xxxxxx=threads=8 # where xxxxxx is the desired filter
415 \end{lstlisting}
416
417 When the file loads, however, it will initially take longer because it is running through the video filter. The format \textit{rgb} in ffmpeg uses more cpu time. For comparison, ffmpeg line that might be used:
418
419 \begin{lstlisting}[style=sh]
420 ffmpeg -i /tmp/filename.mpeg -threads 15 -vf format=rgb24,xxxxxxs=threads=8 -acodec ac3 -vcodec libx265 - y /tmp/x.mp4
421 \end{lstlisting}
422
423 This converts the input to rgb before xxxxxx runs, and so it too is slower (because there is more color data). You would ordinarily avoid this conversion by omitting the \texttt{format=rgb24} parameter. An example ffmpeg plugin that could easily take advantage of an auxilliary opts file is \textit{nlmeans}.
424
425 \section{Audio Effects - Native}%
426 \label{sec:audio_effects_native}
427 \settocdepth{subsection}
428 \index{audio!plugins}
429
430 \subsection{AudioScope}%
431 \label{sub:audioscope}
432 \index{audioscope}
433
434 Effect rewritten and improved. Convert input audio to video output representing the audio power spectrum. Shows
435 % Yes
436  %\todo{It's OK to use Subsection every plugin?}%
437 you the sound wave.
438
439 \subsection{Chorus}%
440 \label{sub:chorus}
441 \index{chorus}
442
443 It is a multitrack effect, where each track is a channel. For example if you have 4 voices per channel and 2 channels, you will have a total of 8 tracks.
444 It is an effect that modulates the signal, varies the pitch up and down (instead of modulating the phases as for example in the \textit{Flanger} plugin) and creates voices from the original signal and adds them to the Output. You then get a chorus effect, with multiple voices \textit{singing} the same song but with slightly different modulations. Voices not only modulate the original signal but also start with a certain delay. There are two components of delay, \textit{constant delay} and \textit{oscillating delay} (figure~\ref{fig:chorus}).
445
446 \begin{figure}[htpb]
447         \centering
448         \includegraphics[width=0.5\linewidth]{chorus.png}
449         \caption{GUI of configuration for Chorus plugin}
450         \label{fig:chorus}
451 \end{figure}
452
453 \begin{description}
454         \item[Voices per channel]: number of items we want to put in the effect. Using more than 4 voices creates sound artifacts that lose the feel of a human voice choir, but can still be used as an artificial sound effect.
455         \item[Phase offset] (ms): is the constant delay, i.e.\ the amount of delay of the voices compared to the original signal.
456         \item[Depth] (ms): is the oscillating delay, i.e.\ the delay in the oscillation of the various voices from the original signal.
457         \item[Rate] (Hz): is the speed at which we apply the oscillating delay. In other words, the speed at which the oscillations occur.
458         \item[Wetnwss] (db): Indicates how much of the original (dry) signal is taken into account compared to delayed voices.
459 \end{description}
460
461 \subsection{Compressor (Single Band)}%
462 \label{sub:compressor}
463 \index{compressor}
464
465 The audio compressor reduces the dynamic range of the audio, not the amount of data required to store the audio. In \CGG{} the compressor actually performs the function of an expander and compressor of the signal's dynamic range. A third and more sophisticated use serves to highlight the voice with respect to the sound background. It is a multitrack effect and can also be applied as a Shared Effect. (figure~\ref{fig:compressor}).
466
467 \begin{figure}[htpb]
468     \centering
469     \includegraphics[width=0.7\linewidth]{compressor.png}
470     \caption{GUI of configuration for Compressor plugin}
471     \label{fig:compressor}
472 \end{figure}
473
474 The compressor works by calculating the maximum sound level within a certain time period of the current position. The maximum sound level is taken as the input sound level. For every input sound level there is an output sound level specified by the user.
475 The gain at the current position is adjusted so the maximum sound level in the time range is the user specified value.
476 The compressor has a graph which correlates every input sound level to an output level. The horizontal direction is the input sound level in dB. The vertical direction is the output sound level in dB. The user specifies output sound levels by creating points on the graph. Click in the graph to create a point. If two points exist, drag one point across another point to delete it. Moving the point horizontally is equivalent to the \textit{makeup gain} parameter. Note that it is impossible to create a vertical curve; points would be deleted.
477 Put a part of the curve in horizontal means clamping the signal to the same, unique value (as Limiter).
478 The most recent point selected has its values displayed in textboxes (Output and Input) for more precise adjustment.
479 To have the compressor reduce the dynamic range of the audio, make all the output values greater than the input values except 0\,dB. To make the compressor expand the dynamic range of the audio, make all the output values except 0\,dB less than the input values. The algorithm currently limits all sound levels above 0\,dB to 0\,dB, so to get an overloaded effect put a gain effect before the compressor to reduce all the levels and follow it with another gain effect to amplify all the levels back over 0\,dB.
480 The volume (in Db) of the input signal is shown in the \textit{In meter} on the left. Next to it is the \textit{Gain meter} which indicates the gain added (green) or subtracted (red) to the original signal according to our settings.
481
482 \begin{description}
483     \item[Attack secs]: determines where in relation to the current position the maximum sound level is taken and how fast the \textit{gain} is adjusted to reach that peak. It is in seconds. If the reaction time is negative the compressor reads ahead of the current position to get the future peak. The gain is ramped to that peak over one reaction time. This allows it to hit the desired output level exactly when the input peak occurs at the current position. If the reaction time is positive the compressor scans only the current position for the gain and ramps gain over one reaction time to hit the desired output level. It hits the output level exactly one reaction time
484     after detecting the input peak.
485     \item[Release secs]: if the peak is higher than the current level, the compressor ramps the gain up to the peak value. Then if a future peak is less than the current peak it ramps the gain down. The time taken to ramp the gain down can be greater than the time taken to ramp the gain up. This ramping down time is the decay seconds.
486     \item[Trigger type]: the compressor is a multi-channel effect. Several tracks can share one compressor. How the signal from many tracks is interpreted is determined by the \textit{trigger type}. The Trigger type uses the value supplied in the Trigger textbox as the number of the track to use as input for the compressor. This allows a track which is not even heard to determine the loudness of the other tracks. The maximum trigger takes the loudest track and uses it as the input for the compressor. The Total trigger type adds the signals from all the tracks and uses the total as the input for the compressor. This is the most natural sounding compression and is ideal when multiple tracks are averaged into single speakers.
487     \item[Trigger]: This parameter is used in conjunction with trigger type as described previously. Normally only one track is scanned for the input peak. This track is specified by the Trigger. By sharing several tracks and playing with the trigger value, you can make a sine wave on one track follow the amplitude of a drum on another track, for example.
488     \item[Smooth only]: for visualizing what the compressor is doing to the sound-level, this option causes it to replace the sound wave with just the current peak value. It makes it very easy to see how \textit{reaction secs} affects the detected peak values.
489     \item[Gain]: moves the curve in the vertical direction only, to change the gain of the Output.
490     \item[Clear] and \textbf{Reset}:  Reset the parameters to the default values (no compression).
491 \end{description}
492
493 \subsection{Compressor Multi (Multi Band)}%
494 \label{sub:compressor_multi}
495 \index{compressor multi band}
496
497 Refer to Compressor (Single Band) for common theory and options.
498 The normal compressor acts over the entire frequency spectrum. The multi-band allows us to distinguish three frequency ranges (low, med and high) on which to intervene separately and in a more sophisticated way. In other plugins there are four bands instead of three, but we can make very precise adjustments so the three present are enough because they are not fixed. Finally the value of the three corrections are added together in the Output.
499
500 \begin{figure}[htpb]
501         \centering
502         \includegraphics[width=0.7\linewidth]{compressorM.png}
503         \caption{GUI of configuration for Compressor Multi plugin}
504         \label{fig:compressorM}
505 \end{figure}
506
507 The three bands and their range (adjustable as desired) are shown in the frequency graph visible below (Bandwidth:).
508 As a first step you choose the band and adjust its range in the Bandwidth graph, then you go to adjust the compression in the top level graph. In this graph we can copy/paste the curve in the other bands via RMB; so we have a similar basis on which to make the adjustments.
509
510 In figure~\ref{fig:compressorM} we can see the three bands; the one currently active (\textit{Current band: 2}) presents the waveform of the sound signal. The interval goes roughly between 300\,Hz and 4000\,Hz, the edges are vertical because the \textit{stepness} is set to zero. So we have a clear separation between the bands, but by varying the slope we can have some overlapping of the bands for smoother effects. In the top level graph we can see the yellow curve of the active band, but we can also see in the violet the soft lines of the curves of band 1 and 2.
511
512 \begin{description}
513         \item[Solo]: brings only the active band to the Output, silencing the others. So we can make more precise adjustments without listening to the whole effect.
514         \item[Bypass band]: In contrast to Solo, it only brings the sound signals of the two inactive bands to the Output.
515         \item[Freq range]: is used to set bandwidth limits. You act separately on the left and right edge.
516         \item[Steepness]: varies the slope of the edges of the band range. Creates some overlap in the band boundaries.
517         \item[Channel]: is the equivalent of the \textit{Trigger} option in Compressor (single band). Allows you to choose the channel or track to act on.
518         \item[Window size]: Determines the number of samples used in the compression calculation. The more they are, the higher the quality of the result, but the more CPU usage.
519 \end{description}
520
521 \subsection{DC Offset}%
522 \label{sub:dc_offset}
523 \index{dc offset}
524
525 Use this to remove \textit{DC Offset}, which is usually an undesirable characteristic of a recording normally caused by defective equipment. This effect works like a \textit{high pass filter} and has no controls. DC stands for \textit{Direct Current} which is the average amplitude of the waveform. It sounds best when it is absent, represented by zero, so that there is no imbalance in the audio.
526
527 \subsection{Delay Audio}%
528 \label{sub:delay_audio}
529 \index{delay audio}
530
531 In the Delay Audio effect you can specify the number of seconds you want to delay the video track.
532 An alternative ffmpeg plugin is F\_adelay.
533
534 \subsection{DeNoise}%
535 \label{sub:denoise}
536 \index{denoise}
537
538 Reduce audio background noise. There is only 1 parameter which is used to regulate the level dial with a range of 0 to 1.
539
540 \subsection{DenoiseFFT}%
541 \label{sub:denoisefft}
542 \index{denoisefft}
543
544 Audio sampling (time data) is converted to a frequency spectrum using FFT (\textit{Fast Fourier Transform}). Since the \textit{reference} contains only the background noise while the rest of the clip contains noise + audio to clean up, you get separate frequencies so you can subtract them to get the clean audio only. Set the Denoise Power dial in dB and choose the number of reference samples.
545
546 For example, if you record a voice with a microphone\protect\footnote{credit fary54}:
547 \begin{enumerate}
548         \item You record 15 seconds of background (without talking). This is represent the background noise that the filter uses as a reference.
549         \item After 15 seconds, start the voice. This is represents the recording whose filter should remove the background noise.
550         \item You stop recording.
551         \item You place the FFT effect on the whole length of the recording (including the 15 seconds of background noise).
552         \item Then place your cursor at the beginning of the 15 seconds. Enter the number of samples in the effect presets, e.g. 65536.
553 \end{enumerate}
554
555 This has the effect of creating a keyframe that marks the beginning of the reference range, mentioned in point 1, which in our example ends at 65536 samples later.
556
557 During playback, the background noise is then automatically removed along the entire length of the effect.
558
559 \subsection{Despike}%
560 \label{sub:despike}
561 \index{despike}
562
563 Detect and eliminate out of range impulse values.
564
565 \begin{description}
566     \item[Maximum level:] slider to set the maximum value in dB above which the frequency cutting takes place.
567     \item[Maximum rate of change:] to adjust peak delete in dB.
568 \end{description}
569
570 \subsection{EQ Graphic}%
571 \label{sub:eq_graphic}
572 \index{EQ graphic}
573
574 Graphic equalizer sets the output levels for specified frequency bands. This effect works by setting control points when you click the left mouse button and drag to the desired value. In the textboxes at the bottom can be seen the frequency of the active control point, the level of the signal to be set by entering the numerical value or by dragging the control point, and the number of samples to act on (figure~\ref{fig:equalizer}).
575
576 \begin{figure}[htpb]
577     \centering
578     \includegraphics[width=0.8\linewidth]{equalizer.png}
579     \caption{Graphic Equalizer audio plugin}
580     \label{fig:equalizer}
581 \end{figure}
582
583 \subsection{EQ Parametric}%
584 \label{sub:eq_parametric}
585 \index{EQ parametric}
586
587 Parametric equalizer shows and outputs levels for \textit{frequency}, \textit{quality}, \textit{level}, \textit{mode}, and \textit{wetness} (figure~\ref{fig:eq_param}).
588
589 \begin{figure}[htpb]
590         \centering
591         \includegraphics[width=0.4\linewidth]{eq_param.png}
592         \caption{EQ Parametric audio plugin}
593         \label{fig:eq_param}
594 \end{figure}
595
596 \subsection{Echo}%
597 \label{sub:echo}
598 \index{echo}
599
600 Echo is reflection of sound. This plugin could be used to add echoing to video of your canyon hike (figure~\ref{fig:echo}).
601
602 \begin{figure}[htpb]
603     \centering
604     \includegraphics[width=0.4\linewidth]{echo.png}
605     \caption{The 3 dials of Echo plugin}
606     \label{fig:echo}
607 \end{figure}
608
609 \begin{description}
610     \item[Level] represents the volume adjustment.
611     \item[Atten] is attenuation which is a general term that refers to any reduction in the echo reflection. Sometimes called \textit{loss}, attenuation is a natural consequence of signal transmission over long distances.
612     \item[Offset] is the lag in the attenuated echo signal. Offset means adding a DC level to a signal. It offsets the signal up or down in a DC sense without changing the size of the AC part of the signal. When you add an audio clip to the Timeline, the clip plays back from the beginning of the source audio file. The point in the audio file where the clip starts playing is called the offset. By default, a clip’s offset is zero, the beginning of the source audio file. You can change the offset so that the clip starts playing from a later point in the source audio file.
613 \end{description}
614
615 \subsection{EchoCancel}%
616 \label{sub:echocancel}
617 \index{echo cancel}
618
619 EchoCancel is the process of removing echos from audio in order to improve the quality. Echo cancel may be needed because an audio recording was done in a room that led to echo generation or there was some kind of unwanted feedback. There are many controls for the EchoCancel plugin which are defined here. However, the first thing you will see when you bring up the plugin, is the top portion that is black which will show a + in the middle when you mouse over it. Once you start playing audio, you will see the cepstrum spectral data inside the window. A cepstrum results from taking the inverse Fourier transform (IFT) of the logarithm of the estimated spectrum of a signal. It is used to identify the period of the echo in the audio. It is recommended to just set the \textit{Mode} to On but the below defined parameters can be utilized by professionals (figure~\ref{fig:echo-cancel}).
620
621 \begin{figure}[htpb]
622     \centering
623     \includegraphics[width=0.8\linewidth]{echo-cancel.png}
624     \caption{GUI for EchoCancel with crosshair and mode set to ON}
625     \label{fig:echo-cancel}
626 \end{figure}
627
628 \begin{description}
629     \item[Normalize:] audio normalization adds variable amounts of gain to an audio recording to bring the average or peak amplitude to a target level (the normal amount), on an ongoing buffer by buffer basis. This is to make the cepstrum graphical data appear between 0 and 1. Checkmark appears if ON.
630     \item[Level:] scale factor used to draw the cepstrum output when normalize is not in effect.
631     \item[History:] number of previous cepstrum outputs redrawn as fading graphical data.
632     \item[X Zoom:] X axis scale factor to magnify low frequency cepstrum graphical output.
633     \item[Damp:] echo envelope decay factor used to smooth the cepstrum/correlation data.
634     \item[Peaks:] number of maximal envelope values used in the echo gain calculation.
635     \item[Cutoff Hz:] low frequency cutoff value to prevent beat frequency (\textit{heterodyne}) echo canceling.
636     \item[Mode:] \textit{MAN}, \textit{Off}, or \textit{On}. When Off is selected, the plugin is not active. When MAN is used, the only one peak is used for the echo gain envelope. It is set by pressing mouse button $1$ (LMB) in the ceptstrum graphical output. The Gain and Offset are updated as the pointer drag operation resets the indicated gain and offset values. When On is selected, the echo gain envelope is automatically calculated by cepstrum and auto-correlation of the input audio in the last window size audio samples.
637     \item[Windows size:] parameter can be set to \textit{Default}, $1024$, $2048$, \dots \textit{doubled values\dots} up to $262144$.
638     \item[Amplitude:] the cepstrum value at the drag point during manual envelope selection.
639     \item[Gain:] echo gain setting determined by manual selection.
640     \item[Offset:] echo period setting determined by manual selection. The $Hz$ (frequency), $ms$ (millisecond duration), and sample offset (audio samples) as determined by manual selection.
641 \end{description}
642
643 \subsection{Flanger}%
644 \label{sub:flanger}
645 \index{flanger}
646
647 It's a single-track effect. If you apply it to multiple tracks each will work on its own track independently of the others.
648 It consists of making a copy of the original sound wave and then playing it over the original one with a certain delay. The resulting signal (Output) will then be the sum of the two waves and will have peaks where the two values add up and gaps where the two values compensate each other. The result is a more \textit{evanescent} and \textit{metallic} sound. Much, however, depends on the intensity of the effect.
649 The delay introduced consists of two distinct components: the \textit{constant delay} and the \textit{oscillating delay}. Their sum constitutes the total delay of the effect (figure~\ref{fig:flanger}).
650
651 \begin{figure}[htpb]
652         \centering
653         \includegraphics[width=0.6\linewidth]{flanger.png}
654         \caption{GUI of configuration for Flanger plugin}
655         \label{fig:flanger}
656 \end{figure}
657
658 \begin{description}
659         \item[Phase Offset]: it is the constant delay. Once set, its value does not change (unless we change it, for example by use of keyframes) for the duration of the effect.
660         \item[Starting phase] \%: is the point of oscillation where we start the oscillating delay; basically it is the attack value at which the effect starts the calculations. Not to be confused with the point on the timeline where we apply the effect. It only matches this for the 0\% value. The position on the timeline where we want to start the flanger at a given starting phase value can be chosen using keyframes.
661         \item[Depth]: It is the oscillating delay. This value determines the amplitude variation of the delayed (wet) signal phase. This oscillation will be maintained for the entire duration of the effect unless we change it.
662         \item[Rate]: is the speed at which we apply the oscillating delay. Low values indicate a lower oscillation frequency, a high value a rapid succession of oscillations.
663         \item[Wetness]: indicates how much of the original (dry) signal is taken into account compared to the delayed (wet) signal.
664 \end{description}
665
666 \subsection{Freeverb}%
667 \label{sub:freeverb}
668 \index{freeverb}
669
670 Adds effect of multiple decaying echoes to audio signals based on a specific algorithm. Common use of reverb is to simulate music played in a closed room.
671
672 \subsection{Gain}%
673 \label{sub:gain}
674 \index{gain}
675
676 Add gain, input level, to increase/decrease loudness.
677
678 \subsection{Interpolate}%
679 \label{sub:interpolate}
680 \index{interpolate}
681
682 Generate a smooth curve based on sound creating a certain softness. There are no controls.
683
684 \subsection{Invert Audio}%
685 \label{sub:invert_audio}
686 \index{invert audio}
687
688 Reverses the numerical sign of the digital audio. There are no controls.
689
690 \subsection{Live Audio}%
691 \label{sub:live_audio}
692 \index{live audio}
693
694 The Live Audio effect reads audio directly from the sound card input in real time. It replaces any audio on the track so it is normally applied to an empty track. To use Live Audio, highlight a horizontal region of an audio track or define In and Out points. Then drop the Live Audio effect into it. Create extra tracks and attach shared copies of the first Live Audio effect to the other tracks to have extra channels recorded. Live Audio uses the sound driver selected in \texttt{Settings $\rightarrow$ Preferences $\rightarrow$ Playback A $\rightarrow$ Audio Out for recording}, but unlike recording it uses the playback buffer size as the recording buffer size and it uses the project sample rate as the sampling rate. These settings are critical since some sound drivers can not record in the same sized buffer they play back in.
695
696 Live audio has been most reliable when ALSA is the recording driver and the playback fragment size is $2048$. Drop other effects after Live Audio to process sound card input in realtime. With live audio there is no read-ahead, so effects like compressor will either delay if they have read-ahead enabled or playback will under-run. A potential problem is that sometimes the recording clock on the sound card is slightly slower than the playback clock. The recording eventually falls behind and playback sounds choppy. Live Audio does not work in reverse.
697
698 \subsection{Loop Audio}%
699 \label{sub:loop_audio}
700 \index{loop audio}
701
702 Loop some number of samples of audio over and over.
703
704 \subsection{Overlay (Audio)}%
705 \label{sub: overlay}
706 \index{overlay audio}
707
708 Overlay has parameter settings of top or bottom for the track and add or multiply for the operation.
709
710 \subsection{Pitch Shift}%
711 \label{sub:pitch_shift}
712 \index{pitch shift}
713
714 Like the time stretching methods, there are three pitch shifting methods: \textit{Pitch shift}, \textit{Resample}, and \textit{Asset info} dialog. Pitch shift is a realtime effect which can be dragged and dropped onto recordable audio tracks. Pitch shift uses a fast Fourier transform (FFT) to try to change the pitch without changing the duration, but this introduces windowing artifacts. Because the windowing artifacts are less obtrusive in audio which is obviously pitch shifted, Pitch Shift is mainly useful for extreme pitch changes. For mild pitch changes, use Resample instead. Another way to change pitch slightly is to go to the Resources window, highlight the media folder, right click on an audio file, click on \textit{Info}, then adjust the sample rate in the Info dialog to adjust the pitch. This method also requires left clicking on the right boundary of the audio tracks and dragging left or right to correspond to the length changes.
715
716 \subsection{Remove Gaps}%
717 \label{sub:remove_gaps}
718 \index{remove gaps}
719
720 Remove silent gap (below $DB$ threshold) which persist for more than the time limit.
721
722 \subsection{ResampleRT}%
723 \label{sub:resamplert}
724 \index{resampleRT}
725
726 Allows you to convert an audio file from one sample rate to another. This effect works similarly to ReframeRT in videos.
727
728 \begin{center}
729     \begin{tabular}{ll}
730         \toprule
731         Input / output > 1 &    fast rate \\
732         Input / output < 1 &    slow rate \\
733         \bottomrule
734     \end{tabular}
735 \end{center}
736
737 \subsection{Reverb}%
738 \label{sub:reverb}
739 \index{reverb}
740
741 Reverb uses reflections of sound to add depth and fullness; the sound will seem to come from a space that can go from a small bare room to large natural valleys, cathedrals, etc. The reverb is made up of a group of echoes that occur at the same time making it feel like a single effect.
742 Basically simulates creation of a large number of reflections, like lots of walls, which build up and then decay. You can use the reverb plugin to mix tracks together to simulate ambiance because it is a multitrack effect.
743 The configuration window (figure~\ref{fig:reverb}) shows a graph of the full band pass filter frequencies.
744
745 \begin{figure}[htpb]
746         \centering
747         \includegraphics[width=0.6\linewidth]{reverb.png}
748         \caption{GUI of configuration for Reverb plugin}
749         \label{fig:reverb}
750 \end{figure}
751
752 \begin{description}
753         \item[Initial signal level](db): Allows you to set the level of the reflected signal. At 0 you start from its maximum level. Decreasing the signal volume will give more presence to the original signal.
754         \item[ms before reflections]: indicates when to start the reflected sounds in relation to the original sound  (delay).
755         \item[First reflection level] (db): the sound level of the reflection that starts first.
756         \item[Last reflection leve] (db): the level of the last reflection. It is weaker than the first.
757         \item[numbers of refelctions]: the number of reflections can be set as desired as long as there is sufficient CPU to handle it. With a few reflections you get closer to the Chorus effect. You can start from values of 100 - 150, up to a maximum of 255.
758         \item[ms of refelction]: Sets the action time of the effect. With high values, the sound is more clear and sharp
759         \item[Low freq of bandpass] and \textbf{High freq of bandpass}: allow you to set the frequency limits (range) on which the effect acts.
760         \item[Steepness of bandpass]: allows you to adjust the slope of the frequency range limits imposed by the previous items. With the value 1.00 we have a vertical edge that clearly separates the range of frequencies on which to act from the remaining ones (as you can see in figure~\ref{fig:reverb}). By sloping the edge we have a certain overlap and a smoother effect.
761         \item[Window]: determines the number of frequency samples taken into account by the effect for its calculations. The higher the number, the smoother the effect; but more CPU is used.
762 \end{description}
763
764 \subsection{Reverse Audio}%
765 \label{sub:reverse_audio}
766 \index{reverse audio}
767
768 Apply reverse audio to an audio track and play it backwards. The sound plays forward. Be aware when reversing audio that the waveform on the timeline does not reflect the actual reversed output.
769
770 \subsection{SoundLevel}%
771 \label{sub:soundlevel}
772 \index{sound level}
773
774 Effect rewritten and improved to handle fragments. Displays the Max/RMS sound level in decibels.
775
776 \subsection{Spectrogram}%
777 \label{sub:Spectrogram}
778 \index{spectrogram}
779
780 Effect rewritten and improved. Visual representation of the sound levels at specified frequencies as they vary with time.
781
782 \subsection{Synthesizer}%
783 \label{sub:Synthesizer}
784 \index{synthesizer}
785
786 Generate synthesizer sounds; to set key data, turn on Generate keyframes while tweaking (figure~\ref{fig:synthesizer}).
787
788 \begin{figure}[htpb]
789     \centering
790     \includegraphics[width=1.0\linewidth]{synthesizer.png}
791     \caption{GUI for Synthesizer}
792     \label{fig:synthesizer}
793 \end{figure}
794
795 \subsection{Time Stretch RT}%
796 \label{sub:time_stretch_rt}
797 \index{time stretch RT}
798
799 Change the speed of an audio signal without affecting its pitch.
800
801 \subsection{Tremolo}%
802 \label{sub:tremolo}
803 \index{tremolo}
804
805 It serves to give various vibes and vitality to the sound by modulating the amplitude of the sound signal and the delay (figure~\ref{fig:tremolo}).
806
807 NOTE: There is often confusion between Tremolo and Vibrato, but the vibrato is the periodic variation of the height of a note (frequency) while the tremolo is the periodic variation of the height (amplitude) of the sound wave.
808
809 \begin{figure}[htpb]
810         \centering
811         \includegraphics[width=0.5\linewidth]{tremolo.png}
812         \caption{GUI of configuration for Tremolo plugin}
813         \label{fig:tremolo}
814 \end{figure}
815
816 \begin{description}
817         \item[Phase offset] (\%): is where the oscillation effect begins. At 0\% we are at maximum volume; to lower the volume, increase the percentage.
818         \item[Depth] (dB): is the oscillation damping value. You can only decrease the level, you cannot increase it.
819         \item[Rate] (Hz): is the speed at which the oscillations are repeated.
820         \item[Waveform]: you can choose waveform algorithms to use in effect calculations.
821 Currently available waveforms are: \textit{Sine}; \textit{Sawtooth}; \textit{Rev Sawtooth}; \textit{Square} and \textit{Triangle}.
822 \end{description}
823
824 \section{Audio Ladspa Effects}%
825 \label{sec:audio_ladspa_effects}
826 \settocdepth{section}
827 \index{ladspa}
828
829 Ladspa effects are supported in realtime and rendered mode for audio. These audio effects are supported since \CGG{} implements the LADSPA interface as accurately as possible. Besides the supplied LADSPA effects\protect\footnote{credit Steve Harris}, additional LADSPA effects can be enabled by setting the \texttt{LADSPA\_PATH} environment variable to the location of your LADSPA plugins:
830
831 \begin{lstlisting}[style=sh]
832 export LADSPA_PATH=/usr/lib/ladspa
833 \end{lstlisting}
834
835 \section[Audio LV2 / Calf Plugins]{Audio LV2 / Calf Plugins}%
836 \label{sec:audio_lv2_calf_plugins}
837 \index{LV2 - Calf}
838
839 LV2\protect\footnote{Optional Feature - OS dependent} is an open standard for audio plugins using a simple interface with extensions which add functionality to support audio software. These plugins were written by external developers and provide additional audio effects to \CGG{} audio without having to change \CGG{} every time. Because the LV2 plugins are separate from \CGG{} Infinity, if one fails or does not perform as expected, \CGG{} should stay running and you will have to contact the programmers responsible for that plugin for a fix.
840
841 Typically, a user OS has specialized package groups installed. It is difficult to create one build of \CGG{} to accommodate all potential LV2 plugins. Specifically for the \textit{Calf-Studio LV2 plugins}, you should install the \textit{Calf Plugins} package. Note that because the Calf Plugins have a graphics UI interface which is dependent on specific hardware, they will not work with AppImage.  The user’s computer must have \textit{gtk-2-runtime} installed, which seems to be automatically done already for most distros. For users doing their own builds, you can build \CGG{} without LV2 support by including \texttt{-{}-without-lv2} in the configure step. The default build is \texttt{-{}-with-lv2=yes} and requires that \textit{GTK-2-devel} must be installed or the build will fail and notify you. In addition for some newer distros, you will need to install
842 \textit{lv2-calf-plugins-gui}; for example Fedora version 32.
843
844 LV2 plugins have their own category in the \textit{Audio Plugins Visibility} as lv2. There is a simple text interface which is available via the usual \textit{Show controls} button when the plugin is attached to the audio track. This window has a Reset button to get back to the default settings. To change a value of one of the parameters, highlight that parameter and type in the new value in the topmost text box and then hit Apply to take effect -- the reason for requiring hitting apply is so that the audio is not moving all over the place while you are still typing a value. More easily, you can just move the \textit{pot dial} or the \textit{slider} bar which take effect automatically.
845
846 \CGG{}’s buffer size setting may cause a delay in activation of the changes you make taking effect, so you can lessen the time by using a small buffer. Notice that $1024$ samples at $48000$ samples per sec is only $\frac{1}{50}^{th}$ a second. This is not a lot of time to shuffle a bunch of stuff. Short buffers produce low latency, but no time for complex programs or lots of stacked effects. Bigger buffers allow for more complex setups.
847
848 To set the buffer size:
849
850 \texttt{Settings $\rightarrow$ Preferences $\rightarrow$ tab Playback A $\rightarrow$ section Audio Out $\rightarrow$ variable Playback buffer samples}
851
852 However, be forewarned that due to variability in the lv2 plugin programming code, some of the plugins only work with the minimum buffer size of $1024$. In these cases, what you will see is the main track canvas cursor just bounces back and forth over a very small area in the timeline. This does not crash \CGG{} but you will have to remove the plugin to continue working.
853 You can specify a certain set of LV2 plugins to use by setting \texttt{LV2\_PATH} \index{LV2 path} as shown below before starting \CGG{} -- include a colon ($:$) separator for multiple paths. The default path for most operating systems is \texttt{/usr/lib64/lv2}. To list the system installed lv2 plugins key in: \texttt{lv2ls}.
854
855 \begin{lstlisting}[numbers=none]
856 export LV2_PATH=/tmp/j/balance.lv2/usr/local/lib/lv2/:/usr/local/lv2
857 \end{lstlisting}
858
859 If there is no default \texttt{LV2\_PATH} set automatically, the value will be \texttt{\$CIN\_DAT/\\lv2}, which is a placeholder only so that no lv2 plugins will be loaded. When there is no system \texttt{LV2\_PATH} set it is important to note, that if you do want lv2 plugins loaded, you must set the correct path in:
860
861 \texttt{Settings $\rightarrow$ Preferences $\rightarrow$ Interface tab $\rightarrow$ Default LV2 $\rightarrow$ direc\-tory
862     path name}
863
864 When you change this field, cin will automatically restart and load the newly specified lv2 plugins. If when switching \texttt{LV2\_PATH} or if the lv2 audio plugins are not displayed/usable in the Resources window, you can execute a reload via:
865
866 \texttt{Settings $\rightarrow$  Preferences $\rightarrow$ Interface tab $\rightarrow$ Reload plugin index} \index{plugins!reload index}
867 or else before you bring up \CGG{}, delete \texttt{\$HOME/.bcast5/\CGG{}\_\\plugins} so that the plugins get properly reloaded.
868
869 There are some lv2 plugins that display a \textit{glitzy} UI (User Interface); for example the \textit{Calf plugins}. For these LV2 plugins, if you want that to automatically come up without having to click on the UI button on the simplified UI interface, there is a flag to enable that. It is at:
870
871 \texttt{Settings $\rightarrow$ Preferences $\rightarrow$ Operations} tab
872
873 then check the \textit{Auto start lv2 gui} Flag
874
875 Below is a screencast showing the auto start gui flag and the \texttt{LV2\_PATH} default directory path on the bottom line. Note the highlighted \textit{Reload plugin index} which will be executed if OKed (figure~\ref{fig:reload}).
876
877 \begin{figure}[htpb]
878     \centering
879     \includegraphics[width=1.0\linewidth]{reload.png}
880     \caption{Reload plugin index in yellow and Auto start lv2 gui unchecked}
881     \label{fig:reload}
882 \end{figure}
883
884 There is also a blacklist that prevents known problematic-for-\CGG{} lv2 plugins from loading to avoid crashes. If others are found to have problems, once informed about them, they will be added to this blacklist. In order to determine which lv2 plugin causes a SEGV on \CGG{} startup, you can start from a terminal window and you will see each plugin that is being loaded and the last one shown before the crash is a bad plugin. However, many of the plugins causing a crash are due to not having been compiled on your current system with the current compiler so may actually work correctly on other user systems and so will not be added to the \CGG{}-wide blacklist. You can either recompile the problematic plugin, or modify your own blacklist which you will have to maintain and save so as not to be written over when loading a new build.
885
886 Note the UI button in the upper right hand corner above the Reset button (figure~\ref{fig:calf}). If you click this button, a glitzy interface window comes up (if available) for changing variable values. It is possible that a bug in the LV2 plugin causes the glitzy window to appear as blank and then die, but in that case the original simple text window might still work -- in either case, if the timeline movement hangs, just detach the plugin to continue your current session. There is an environment variable that you can set,  \texttt{BC\_TRAP\_LV2\_SEGV}, to get a dump of the failure which may be helpful for debugging.
887
888 \begin{figure}[htpb]
889     \centering
890     \includegraphics[width=1.0\linewidth]{calf.png}
891     \caption{Screencast of simple text interface in the middle of the screen for a Calf LV2 plugin}
892     \label{fig:calf}
893 \end{figure}
894
895 When the glitzy ui is up, the simple text window remains up also since it is the \CGG{} side and keeps track of the value changes so they remain in effect for further usage of the plugin. Changes to one or the other will occur in both with the exception of certain features in the glitzy window which are not communicated correctly back to \CGG{}; for example a reset button -- the simple interface Reset button must be used instead. To change values in the glitzy window you use the mouse and move up or down unlike a knob that turns! (Figure~\ref{fig:calf02})
896
897 \begin{figure}[htpb]
898         \centering
899         \includegraphics[width=0.8\linewidth]{calf02.png}
900         \caption{Screencast with a Calf plugin glitzy window that appears when clicking the simple interface UI button.}
901         \label{fig:calf02}
902 \end{figure}
903
904 In order to test a particular plugin without bringing up \CGG{}, especially for ones that do not operate, it is possible to manually display an lv2ui gui with: \\
905 \texttt{/cin-path/lv2ui <lv2-uri>} \\
906 For example:
907
908 \begin{lstlisting}[style=sh]
909 /tmp/cinelerra-5.1/bin/lv2ui http://calf.sourceforge.net/plugins/Flanger
910 \end{lstlisting}
911
912
913 \section[Video Effects --- Native]{Video Effects -- Native}%
914 \label{sec:video_effects_native}
915 \settocdepth{subsection}
916 \index{video!plugins}
917
918 \subsection{1080 to 480}%
919 \label{sub:1080_to_480}
920 \index{1080 to 480}
921
922 Most TV broadcasts are received with a $1920\times1080$ resolution but originate from a $720\times480$ source at the studio. It is a waste of space to compress the entire $1920\times1080$ if the only resolvable details are $720\times480$. Unfortunately resizing $1920\times1080$ video to $720\times480$ is not as simple as shrinking it.
923
924 At the TV station the original $720\times480$ footage was first converted to fields of $720\times240$. Each field was then scaled up to $1920\times540$. The two $1920\times540$ fields were finally combined with interlacing to form the $1920\times1080$ image. This technique allows a consumer TV to display the re-sampled image without extra circuitry to handle $720\times480$ interlacing in a $1920\times1080$ image.
925
926 If you merely deinterlace the $1920\times1080$ images, you would end up with resolution of $720\times240$. The \textit{1080 to 480} effect properly extracts two $1920\times540$ size fields from the image, resizes them separately, and combines them again to restore a $1920\times480$ interlaced image. The scale effect must then be applied to reduce the horizontal size to $960$ or $720$ depending on the original aspect ratio.
927
928 The tracks to which \textit{1080 to 480} is applied need to be at $1920\times1080$ resolution. The project settings in \texttt{settings $\rightarrow$ format} should be at least $720\times480$ resolution. The effect does not know if the first row in the $1920\times1080$ image belongs to the first row of the $720\times480$ original. You have to specify what the first row is in the effect configuration. The output of this effect is a small image in the middle of the original $1920\times1080$ frame. Use the projector to center the output image in the playback.
929
930 Finally, once you have $720\times480$ interlaced video you can either apply \textit{Frames to Fields} or \textit{Inverse Telecine} to further recover original progressive frames.
931
932 \subsection{1080 to 540}%
933 \label{sub:1080_to_540}
934 \index{1080 to 540}
935
936 Extracts two $1920\times540$ fields from $1920\times1080$ image, resizes them separately, and combines them to $1920\times540$ interlaced image.
937
938 \subsection{Aging TV}%
939 \label{sub:aging_tv}
940 \index{Aging TV}
941
942 This effect is the one to use if you want to achieve an old movie or TV show look. It will put moving lines up and down the movie as well as putting snow on the video. Use it along with \textit{Brightness/Contrast} and \textit{Color Balance} to make your movie look like a really old black and white movie. This came from \url{https://effectv.com}.
943
944 \subsection{Alpha}%
945 \label{sub:alpha}
946 \index{Alpha}
947
948 Allows you to apply an alpha value (transparency) to one or more tracks or one or more edits. You can use the slider or have maximum precision by entering numbers in the input box. You can use the \textit{Clear} button to reset to the default value. Being also keyframable, it allows an excellent variety and possibility of use in the most disparate ways.
949
950 \subsection{Auto Scale}%
951 \label{sub:auto_scale}
952 \index{auto scale}
953
954 Automatically scale to a specified size.
955
956 \subsection{Blue Banana}%
957 \label{sub:blue_banana}
958 \index{blue banana}
959
960 Blue Banana\protect\footnote{credit to Monty Montgomery programmer} is an \textit{HSL Qualifier} \index{HSL Qualifier} (HSL= Hue, Saturation, Luminance; HSV in our plugin, with V = Value), one of the basic tools of any grading software that are based on circumscribing a zone of the frame by extracting a chromatic key and producing a \textit{matte} in the alpha channel (Secondary Color Correction). Blue Banana differs not by creating a real matte, but by creating a \textit{selection mask} exclusively for use within the plugin. The three H, S and V sliders are called \textit{qualifiers}. The BlueBanana plugin has a couple of useful purposes. It can be used for color transformation or remapping -- by isolating a specific color and then performing color change/correction on only that color (or color ranges). Another useful purpose is for chroma-key filtering, using multiple BlueBanana plugins on the same track. Also, it can be used in conjunction with the mask operation of the Compositor. Usage of BlueBanana may seem complicated at first, but it is necessarily so in order to get enough control to produce the desired effect simply and quickly. Just changing a single color is actually quite easy. BlueBanana is keyframable (figure~\ref{fig:bluebanana}).
961
962 The basic strategy for BlueBanana is to:
963
964 \begin{itemize}
965     \item Select a specific target color with the eyedropper tool.
966     \item Create a selection region by expanding color ranges around that color.
967     \item Optionally reduce or expand the alpha plane as a regional selection mask.
968     \item Optionally apply a color remapping or transformation to the selection.
969     \item Optionally reset the output alpha to opaque, or pass the alpha to another BlueBanana plugin.
970 \end{itemize}
971
972 \begin{figure}[htpb]
973     \centering
974     \includegraphics[width=1.0\linewidth]{bluebanana.png}
975     \caption{Screencast showing the BlueBanana plugin control}
976     \label{fig:bluebanana}
977 \end{figure}
978
979 \subsubsection*{Just a Warning Note:}
980 \label{ssub:warning_note}
981 BlueBanana may use a lot of CPU and Memory because it is doing a lot of work. If you turn off the plugin on the plugin bar below the video track in the main track canvas it will stop using cpu when not in use. Or once you uncheck \textit{Mark Selected Area}, it will no longer be using the cpu to mark the selected color area in realtime while drawing the diagonal animated pattern in the compositor window.
982
983 \subsubsection{Example Usage\protect\footnote{from original message by Rebecca}}
984 \label{sssec:example_usage}
985
986 If you just want to try this, follow these steps.
987
988 \begin{description}
989     \item[First ---] Choose your color.
990     \begin{enumerate}
991         \item Load your video, add the BlueBanana plugin to the track, bring up its control window, and uncheck any checked boxes (mostly just to avoid unexpected results).
992         \item In the Compositor window, choose the eyedropper color picker tool on the left-hand side and click on the area of the image that shows the color you want to change/correct.
993         \item In the BlueBanana plugin window, to the right of hue, click Pick. And if you want to modify saturation and value, also click on the Pick button for them. To see what it does, Pick them also.
994         \item Next, check the Mark Selected Areas box at the top right of the BlueBanana plugin window to see the selected color-matching areas which will become marked in a diagonally striped pattern.
995         \item You can now manually modify your selection in the Color Selection area in the obvious ways for hue, saturation, value and fill. The arrows to each side of the small circle widen the selected area. Move the dot and you move the range. The slider on top of the horizontal color strip shifts like the amount of the strip is dedicated to that part of the color spectrum. Fill will fill more area or less area in your selected region.
996     \end{enumerate}
997     \item[Second ---] Adjust your color choice.
998     \begin{enumerate}
999         \item There are color strips under color Adjustment which will show color changes as you modify values.
1000         \item Uncheck Mark Selected Areas and check the Filter Active box to the right of Color Adjustment.
1001         \item As needed, you can individually check and uncheck all the various parameters using the boxes to the left of each line. Again, these are intuitive and broadly similar to the above. The arrows at the bottom widen the range, the circle at the bottom moves the range, and the top slider, which is an arrow this time, affects distribution. It provides a little histogram effect to give you an idea of what you are changing. The fade adjusts the level of color blending. The alpha is basically the opacity of your changes.
1002     \end{enumerate}
1003 \end{description}
1004
1005 Definition of Wording/Checkboxes/Buttons/Operators are being described next. Some of the commentary was adopted from information provided by \textit{Monty Montgomery} and from questions and answers from email by \textit{Igor Ubuntu}, who did extensive testing.
1006
1007 \subsubsection*{Operational characteristics for the color-related adjusters:}
1008 \label{ssub:operational_characteristic_color}
1009
1010 \begin{description}
1011         \item[left arrow slider] operates the range minimum (left edge); the numerical value shows in the left-most textbox.
1012         \item[right arrow slider] operates the range maximum (right edge); resulting numerical value is in the middle textbox.
1013         \item[middle circle slider below] can move the current range up or down and the numerical results will show in the left and middle textbox. Move the dot and you move the range.
1014         \item[top pad slider] operates the edge slopes (selection attack/decay) and the value will be displayed in the rightmost textbox. Sharp edges are represented by 0; 100 represents smooth edges. It is only for "Mask Selection" (Pane 1). It applies simultaneously to the left and right edges (symmetric).
1015         \item[top arrow] affects the distribution skew. It is the equivalent of Top Pad Slider for Pane 2 ("Color Adjusting").
1016 \end{description}
1017
1018 \textit{Left/Right Arrow} determine the edges of the color range. They are precise edges independent of each other, so we can get asymmetrical ranges with respect to the center of the interval indicated by \textit{middle circle slider below}.
1019
1020 \subsubsection*{Operational characteristics for Fill:}
1021 \label{ssub:operational_characteristic_fill}
1022
1023 \begin{description}
1024         \item[left arrow slider] operates mask erosion filling. First textbox value.
1025         \item[center up arrow slider] operates the fill skew midpoint. Second textbox value.
1026         \item[right arrow slider] operates mask expansion filling. Third textbox value.
1027         \item[top pad slider] operates the edge slopes. Right textbox value.
1028 \end{description}
1029
1030 The textboxes are available so that you can directly type in numbers from the \textit{color wheel}. This could be helpful if duplicating previous work as it would be an instantaneous exact numerical match without having to continuously fine-tune the movement of a slider.
1031
1032 There are two panes separated by long horizontal lines (through the middle of the screen) in the control window of the BlueBanana plugin, clearly visible in the previous screencast. The top pane is first used to create/modify a selection, and the bottom pane is used to operate a change.
1033
1034 \subsubsection*{Pane 1}
1035 \label{ssub:pane1}
1036
1037 This section is used to select the target color domain. First, a short explanation about alpha. The alpha channel used in BlueBanana is not transparency (\textit{matte}); it is used as the \textit{Selection mask}. Alpha plane is the alpha channel of the current image. So that:
1038
1039 RGBA = red/green/blue color planes, alpha data plane.
1040 YUVA = luma/Cb/Cr color values, alpha data plane.
1041
1042 The alpha data normally is input to the blending operations in the patchbay overlay mode. The alpha data usually creates the appearance of stacking order, and determines which color planes are visible in the rendered result. When BlueBanana is used, the meaning of the alpha data is changed to the selection. It is useful to think of the alpha data as more solid then it is transparency in blending, and more selected when it is used in BlueBanana. In both cases, the greater the alpha value, the more the effect is expressed.
1043
1044 Usually, alpha is normalized to a range from $0$ to $1$, zero = no effect, $1$ = total effect, $0.5$ = partial effect. In both cases, alpha is what math people call an auxiliary variable. It is needed, but is not part of the answer. In this case, the answer is the visible rendered result. Alpha is like meta-data.  Note that the "alpha" slider works with both "Filter Active" and "Mask Selection" checkboxes
1045 checked.  The "Filter Active" checkbox enables the options: red, green, blue, hue, saturation, value, fade, alpha.  If "Mask Selection" is not checked "alpha" will not work.
1046
1047 Let us now examine the instruments in \textbf{pane 1}:
1048
1049 \begin{description}
1050     \item[Combine Selection] The selection is the intersection or union of two pixel masks. Mathematically, $A$ and $B$ are normalized, (scaled to between $0$ and $1$) and used as selection mask weights.
1051
1052     $Intersection (\cap) = A\times B$
1053
1054     $Union (\cup)= A+B-A\times B$
1055
1056     where $A$ is the input alpha plane as a mask, $1$=selected, $0.4$=partially selected, and $0$=not selected; $B$ is the color selection of trims and feathers made by varying the sliders.
1057
1058     The result is a new alpha plane, which will be output (if \textit{End Mask} is not set). The $0\dots1$ selection values are used to weight the color transformation filters if/when they are active and operate a change. The color adjustment filters available in Pane \#$2$ can change red, green, blue, and remap hue, saturation, value in the pane. There is also \textit{fade} which applies to the color channels and \textit{alpha} which applies to the resulting alpha plane.
1059
1060     The basic plan is to either:
1061
1062     - reduce a selection area by intersection (Combine selection off) $A \times B$
1063
1064     - increase a selection area by union (Combine selection on) $A+B-A\times B$
1065     \item[Mask Selection] applies the current mask to the selection, such that the mask clips/expands the selection. When mask selection is enabled, the result of the and/or will be stored to the alpha result, but when mask selection is unchecked the mask is ignored and the selection is not modified. The selection is used to weight the effect of the filtering, or to control the output alpha.
1066     \item[End mask] only visible when \textit{Mask Selection} is checked. End Mask causes the entire alpha plane to
1067     be set to $1$. The image becomes opaque. This is usually only set in the last plugin of a stack (the stack may be just one plugin doing only color modification). In the event that a color selection mask is used with multiple, layered BlueBanana filters on the same track, the grouped BlueBanana filters may share a single mask by all enabling Mask Selection, but with only the last BlueBanana enabling End Mask. This usage pattern gives the End Mask control its name.
1068     \begin{description}
1069         \item[End Mask as used in Color Transformation/Remapping:] In many use cases \\
1070         where you are just remapping color, you are still interested in seeing all of the picture. If this is the case, then checking End Mask on the last BlueBanana plugin will show you the entire picture. The alpha plane may be in use as a selection mask, but it may not be wanted as part of the result.
1071         \item[End Mask as used in Chroma-key Filtering:] In cases where the selection is for a chroma-key, you are interested in the alpha channel for blending, like \textit{Normal} or \textit{SrcOver}. So for this usage of the BlueBanana, don't check the End Mask.
1072     \end{description}
1073     \item[Invert Selection] reverse target color domain, which is 1 minus selection.
1074     \item[Mark Selected Areas] when this box is checked, the chosen colors are presented in an animated
1075     diagonally striped pattern.
1076     \item[Hue] select a hue domain; click on the Pick button to select or check the box to the left of hue or uncheck to ignore.
1077     \item[Saturation] select a saturation domain; click on the Pick button to select or check the box to the left.
1078     \item[Value] select a value domain; click on the Pick button to select or check the box to the left.
1079     \item[Fill] will fill more area or less area of your selected region. This describes how it works. Fill control is an automated way of doing grow and shrink on the selected area, to fill in small holes in the middle of the selection, or to eliminate spurious pixels that are on the outer or inner edge of the selection.  Be careful how much you shrink, because it can lead to edge segmentation with visible and annoying blocks of pixels. This is where Blur plugin can help. Blur should not be overdone so as not to create unsightly halos.
1080    
1081     If none of the Hue, Saturation, or Value sliders are active -- meaning that the whole frame is selected -- the Fill slider will have no effect even when enabled. The word Fill will appear ghosted to indicate this.
1082
1083     The three lower handles in the fill slider correspond to \textit{Shrink} (the left hand slider), \textit{Final} (the middle slider), and \textit{Grow} (the right hand slider). These are used in combination to alter the selection by first growing it by the amount specified by the right hand Grow slider, shrinking it to the amount specified by the left hand Shrink slider, and then growing it again to the final size specified by the middle Final slider. The top slider then feathers the resulting selection.
1084     Growing the selection it has the effect of filling small holes in the selected area. Similarly, shrinking and then growing tends to remove small flecks of unwanted selection. The Final slider specifies the overall desired shrinkage or growth of the selection when finished. To specify a pure Grow or Shrink operation, set the Final slider and the Grow/Shrink slider to the same value and leave the other slider at zero.
1085     \item[Pre-erode] this control reverses the order of operation to Shrink, then Grow, then Final. The change is subtle on most images, but overall removes more small features because it first removes flecks before filling in holes.
1086 \end{description}
1087
1088 \subsubsection*{Pane 2}
1089 \label{ssub:pane2}
1090
1091 This section is used to modify the color of your selection. Descriptive commentary for this pane.
1092
1093 \begin{description}
1094     \item[Filter Active] checkbox to indicate that the modifications will be shown.
1095     \item[Color Adjustment ] For Color Adjustment, RGB can be used as color weights while the HSV can transform color.
1096     For the following items there are three sections on the slider. The \textit{center} section represents the nominal $0\%-100\%$ range; the \textit{left} section represents negative values, and the \textit{right} section represents values greater than $100\%$. Values can be out-of-range within BlueBanana without clipping, but they will clip once they leave the plugin.
1097     \item[RGB] affect the color channels individually.
1098     \begin{description}
1099         \item[Red] modification color; click the Reset button to revert to default. Values are reflected in numerical textboxes on the right-hand side.
1100         \item[Green] modification color; click the Reset button to revert to default. Values are reflected in numerical textboxes on the right-hand side.
1101         \item[Blue] modification color; click the Reset button to revert to default. Values are reflected in numerical textboxes on the right-hand side.
1102     \end{description}
1103     \item[HSV] reorient the color spectrum, and affect all of the color channels simultaneously.
1104     \begin{description}
1105         \item[Hue] a single numerical value will appear in the right-side box. Click the Reset button for default.
1106         \item[Saturation] for modifying the saturation; click the Reset button to revert to default. Values are reflected in numerical textboxes on the right-hand side.
1107         \item[Value] for modifying the value; click the Reset button to revert to default. Result is reflected in the numerical textboxes on the right-hand side.
1108     \end{description}
1109     \item[Fade] controls the entire color re-mapping, and does nothing if no color adjustment is active.
1110     \item[Alpha] controls the output alpha (this is not available when End Mask is set); click the Reset button to revert to default. Result is reflected in the numerical textboxes on the right-hand side.
1111 \end{description}
1112
1113 \subsubsection*{Tips}
1114
1115 \begin{enumerate}
1116         \item In Pane 1, for mask selection creation, you can also use only one or two (checked or Pick button) of the three qualifiers Hue/Saturation/Value. With Hue alone you get a precise range of hues. With Saturation you select those saturation values for all hues, and with Value you do a "Luma Key," that is, you isolate only certain gray values. It may be useful to start with only one qualifier, and then gradually activate the others; but there are important cases that require all three bars. For example, skin tones, which are always characterized by a mixture of shadows, highlights, and different levels of saturation.
1117         \item Hue and Saturation Qualifiers can be inaccurate if the file is highly compressed and with Subsampling type $4:2:0$. There are indeed blocks and macroblocks of pixels, visible especially along the edges, that disturb the creation of the selection mask. Better to use high quality files at least $4:2:2$, better still $4:4:4$. The brightness Y channel, on the other hand, is always at the highest quality (4). The presence of color noise can also be a problem because it creates spurious pixels. A tip may be to work on and enhance the clip before applying Blue Banana.
1118         \item If there are unwanted (spurious) selections in the frame that are small and far from the main selection, they can be eliminated or minimized with some Blur. Larger spurious selections can be eliminated by masking them (with the \texttt{Mask selection} option enabled in Blue Banana and with the \texttt{Apply mask before plugins} option in Mask tool). This is an action analogous to \textit{garbage matte} in Chroma Key. If there are many spurious areas, perhaps with complex motions, it is best to mask only the selection we are interested in and then bring the \texttt{Fade} slider to $-100$ to reverse the mask.
1119         \item To select multiple colors in the same clip we can use multiple instances of Blue Banana.
1120         \item Once a satisfactory selection mask has been created, scroll through the entire clip to see the presence of artifacts, defects, or spurious areas in the other frames.
1121         \item  It is known that primary Color Correction precedes secondary CC. However, if we use primary CC tools that cause the highlights and deep blacks to clip, for example the histogram, we will get clipped areas that then, in secondary CC, cannot be recovered. We can then first do a secondary CC for the areas near the white point and the black point using Blue Banana which works at 32bit Float.  For example, we can turn down the highlights so as to reveal details and the same can be done in the shadows. Once we have worked in these details without causing clipping (that is, reported within the standard range) we can switch to primary CC.
1122 \end{enumerate}
1123
1124 Let's see two examples of HowTo:
1125
1126 \subsubsection*{BlueBanana Use Case \#1: (Color Transform/Remapping)}
1127 \label{ssub:bb_use_case_1}
1128
1129 \begin{itemize}
1130         \item Load a video track, and add the BlueBanana plugin to your video. The alpha channel is usually all opaque. This serves as an initial full screen selection mask.
1131         \item Open the controls, and start with all boxes unchecked. Now reduce the selection using the top pane in intersection mode (that is \textit{Combine Selection} is unchecked) to begin the effect.
1132         \item Use the \textit{eyedropper} on the compositor window to choose a particular color.
1133         \item Click on the 3 plugin Pick boxes on the right side of each line of HSV to get the color selection.
1134         \item Check \textit{Mark Selected Area}. The affected zones will be identified on the composer.
1135         \item Adjust the selection using the HSV and Fill sliders of the top pane. The selection mark will be updated as you operate the controls. The composer mask striping will be strongest as the mask is nearer full selection.
1136         \item Now uncheck \textit{Mask selected area} \& check \textit{Filter Active} to begin Color Adjustment.
1137         \item Enable any needed colorspace modifiers, RGB / HSV sliders, and setup the color changes by moving the sliders. The current output may be the desired output.
1138         \item Enable \textit{Mask Selection} and the alpha output will pass the selection mask to the image alpha channel. This can be used as a very flexible chroma-key filter. It also allows more plugins to be stacked and more selection information to be added, either by intersections or unions with other selections.
1139         \item \textit{End Mask} simply sets the output image alpha to opaque. This is normally used to end a stack of BlueBanana plugins, and render the entire image with a complex selection.
1140 \end{itemize}
1141
1142 \subsubsection*{BlueBanana Use Case \#2:}
1143 \label{ssub:bb_use_case_2}
1144
1145 This case uses stacked BlueBanana plugins working like \textit{chroma-key} filters. It assumes you have already learned how to operate the plugin.
1146
1147 \begin{itemize}
1148         \item Bring up 2 tracks of video media -- one for foreground and one for background.
1149         \item Add 2 BlueBanana plugins on the first track. Turn off all checkboxes in both plugins.
1150         \item On the top plugin, use the top pane to create a selection mask, using \textit{Mark Selected Areas}.
1151         \item Turn off top plugin \textit{Mark Selected Areas}, and disable the top plugin via the plugin title bar on/off.
1152         \item Create another selection using the second plugin's mask, using \textit{Mark Selec\-ted Areas}.
1153         \item Turn on the top plugin. Make sure both plugins \textit{Mark Selected Areas} is off.
1154         \item Check \textit{Mask Selection} and \textit{Filter Active} in both.
1155         \item Check \textit{Combine Selection} on second BlueBanana to see the final results.
1156 \end{itemize}
1157
1158 You will see that there is intersection of the full plane with the first chosen regions, so the $alpha = 0$ everywhere but the area you picked and you see through. And $alpha = 1$, where the intersection selection was 1. The Normal blend shows you the track on top in these regions (the foreground track where $alpha = 1$).
1159
1160 If you are building an alpha selection mask by first intersection and then union, the top BlueBanana should not change the colors or the bottom plugin will need to target the remapped colors since that is the input to the lower BlueBanana.
1161
1162 \subsection{Blur}%
1163 \label{sub:blur}
1164 \index{blur}
1165
1166 This is a Gaussian type blur. Other blur plugins -- \textit{Linear}, \textit{Motion}, \textit{Radial}, and \textit{Zoom} --are described later. This plugin is keyframable. Blur is used to blur a video track via the following parameters:
1167 \begin{description}
1168     \item[Horizontal and vertical] values are used to tell which one of the fields blurring affects; can be both.
1169     \item[Radius] use this dial to define the amount of blur to apply.
1170     \item[Alpha determines radius] use alpha to define the amount of blur to apply. (radius=gray value of alpha)
1171     \item[Blur alpha, red, green, blue] specifies which color channels is to be blurred.
1172 \end{description}
1173 If you are getting confusing results with old projects it may be a
1174 result of the discontinued parameter \textit{alpha determines radius}.
1175 For compatibility reasons and for possible future development it
1176 has been left in the code but hidden in the plugin's GUI.
1177 The parameter for \textit{alpha determines radius} is
1178 \texttt{A\_KEY}, which can be 0 or 1. When you press the
1179 \texttt{Reset} button in the Blur plugin window \texttt{A\_KEY=0}.
1180
1181 Old projects may have saved that parameter (A\_KEY) to 1 instead 
1182 of 0 and that may present a problem so you should do one of
1183 the following workarounds to change it to 0.  Then be sure to save
1184 your project with these changes applied.
1185 \begin{enumerate}
1186     \item Click on the \textit{Reset} button in the dialogue/controls popup box and re-enter any of your other parameter desired values.
1187     \item OR in the \CGG{} program, open the project. Click on the cog icon
1188 (\textit{Preset edit}) of the Blur effect bar and the \textit{Keyframe
1189 parameters} window is open. There, you can see the A\_KEY parameter
1190 and change it: select the \texttt{A\_KEY} parameter and in the
1191 \texttt{Edit value} box, change it from 1 to 0, then press the \texttt{OK}
1192 button.
1193 \end{enumerate}
1194
1195 \subsection{BoxBlur}%
1196 \label{sub:boxblur}
1197 \index{boxblur}
1198
1199 Based on ffmpeg’s boxblur, this is a very fast algorithm which can be used to blur horizontal,
1200 vertical, and at a power level.  Simplest usage is to just blur the entire image but with
1201 the following parameters, you can create a specific rectangular section to blur instead.  
1202
1203 \begin{description}
1204     \item[X/Y:] point coordinates of a rectangular box to be blurred. X and Y of 0 are in the
1205 upper left hand corner.  Default to be blurred is the entire image.
1206     \item[Drag:] is used when you want to create just a rectangular area to be blurred rather
1207 than the enire image. If you used keyframes to cover a moving area and had left the Drag box
1208 enabled, you can remove the drag box with \textit{Allow keyframe spanning} whose use is
1209 described in \nameref{sec:allow_keyframes_spanning}.
1210     \item[W/H] the values in these 2 boxes specify the width and height of the drag area box
1211 measured in pixels as shown in the compositor window. You can set these manually and if you
1212 can not see the location of your box, set them to zero because $0$ sets it to the same as the
1213 width/height of the project.
1214     \item[Horiz:] slider goes from $0\, to\, 100$. Increasing this \textit{horizontal} number,
1215 increases the blurriness in the horizontal direction. The default value is 2. You can also use
1216 the mouse wheel to scroll the slider.  There is a clear button on the right to set the value to 0.
1217     \item[Vert:] slider goes from $0\, to\, 100$. Increasing this \textit{vertical} number,
1218 increases the blurriness in the vertical direction.  The default value is 2. You can also use
1219 the mouse wheel to scroll the slider. There is a clear button on the right to set the value to 0.
1220     \item[Power:] the way \textit{Power} works is like stacking up the blur multiple times.
1221 For example, a power of 3 would be like blurring once, then blurring that again, and finally
1222 blurring that a third time. The slider varies from 1 to 10 with 2 being the default value. There
1223 is a clear button on the right to set the value to 1.
1224     \item[Reset:] button to revert to the default values and turn off Drag if it is on.
1225 \end{description}
1226
1227 \subsection{Brightness/Contrast}%
1228 \label{sub:brightness_contrast}
1229 \index{brightness contrast}
1230
1231 \begin{figure}[htpb]
1232         \centering
1233         \includegraphics[width=0.6\linewidth]{brightness.png}
1234         \caption{How it works Brightness and Contrast}
1235         \label{fig:brightness}
1236 \end{figure}
1237
1238 To brighten a dark shot, or add light, use this plugin. Do not overuse the effect or you risk degrading your video quality.
1239 The \textit{Brightness} slider moves up or down the values of the entire channel and corresponds to the \textit{Master Offset} of the various grading programs.
1240 The \textit{Contrast} slider expands or narrows the brightness values of the entire channel; corresponds to the use of the \textit{cursors} (small triangles) in the \textit{Histogram} plugin. For maximum precision you can use the input box. \textit{Clear} icons are present to reset its slider to default without affecting others.
1241 Use the effect along with keyframing to brighten a long shot that is dark at the beginning but bright at the end. Generally you will want to change the brightness and contrast about the same amount (for example -- brightness $28$, contrast $26$) so that your original colors are kept intact. This effect is also keyframable (figure~\ref{fig:brightness}).
1242
1243 \subsection{BurningTV}%
1244 \label{sub:burningtv}
1245 \index{burning TV}
1246
1247 Makes your video burn where there are small light colored patches of video. This came from \url{https://effectv.com}.
1248
1249 \subsection[C41]{C41}%
1250 \label{sub:c41}
1251 \index{C41}
1252
1253 The C41\protect\footnote{credit Florent Delannoy, original program code author, and Edouard Chalaron} plugin takes a $16\,bit C41$ digital intermediate negative film as input and outputs a positive image. It became necessary because $C-41$ negatives can fade or color-shift over time which was a problem early on. It is still important today because there is a large amount of documentaries, video clips, and other media out there that was shot on super $16$ film. This works for RGB-float, RGB, and also YUV variations.
1254
1255 There are two sets of data -- the scanned input values and your corrected values. Simple functionality of the plugin is to compute the data, transform to get corrected values, then apply that.
1256
1257 Basic usage strategy:
1258 \begin{enumerate}
1259     \item first time the controls come up, nothing is checked and everything is set to $0$
1260     \item check the box \textit{Compute negfix values} to see the current media input values
1261     \item check \textit{Activate processing} and you see a $1-colored$ screen in the Compositor due to zero values
1262     \item check the \textit{Apply values box} to see the input values on the left side propagate to the right side
1263     \item check \textit{Apply default box} if you want to make sure that the borders of the image are not used
1264     \item correct the output values as desired on the applied right side
1265 \end{enumerate}
1266
1267 It is important to note as you play or change the frame, the plugin re-computes the data as you move along, but it is not propagated to the applied side.
1268
1269
1270 \paragraph{Checkboxes:}
1271     \begin{description}
1272         \item[Activate processing] when checked, the c41 operation is used to render the image.
1273         \item[Compute negfix values] computes the current negative values of the image (inside the box).
1274         \item[Show active area] draws horizontal and vertical grid lines displaying the boxed area.
1275         \item[Postprocess] when checked, applies contrast/brightness values as defined in $coef\frac{1}{2}$.
1276     \end{description}
1277 \paragraph{Values:}
1278     \begin{description}
1279         \item[Compute negfix values] (left side) and
1280         \item[negfix values to apply] (right side):
1281         \item[Min/Max R/G/B] minimum and maximum values for Red, Green, and Blue.
1282         \item[Light] value of light; a smaller number is lighter.
1283         \item[Gamma G/B] values for gamma Green and Blue.
1284         \item[Contrast] simple color contrast.
1285         \item[Brightness] white brightness.
1286     \end{description}
1287 \paragraph{Buttons:}
1288     \begin{description}
1289         \item[Apply values] copies computed RGB/Light/Gamma/Contrast/Bright from negfix to applied values.
1290         \item[Apply default box] copies default computed Box column/row from negfix to applied values.
1291     \end{description}
1292 \paragraph{Shading box:} The boxing option allows for calculating the inversion of the digital negatives in a given area of the frame as opposed to the entire frame. The program will automatically calculate the columns and rows to shave from the frame when compute negfix values is checked. A default box area is initially calculated, called the shaving box, based on where the min/max difference in a row/column is less than the program defined tolerance. This row/column minimum and maximum difference must be greater than 0.05. The effect is to cut away the border areas with constant color. If you check the Show active area, you can see the box in the compositor window. The boundary search is constrained to a range of 0.1 to 0.9 times the frame dimensions, to create a 10 percent shaved margin to avoid over-scan and negative edge bleeding. Manual adjustment of the shaving box is controlled via the four sliders on the bottom right which move each of the left, right, top and bottom shaving margins. The slider bar new values automatically take effect as you move the box and you will see the right-hand side applied values change. When you have either the rows or the columns where the minimum slider is greater than or equal to the maximum slider, the default box will be in effect instead.
1293
1294 \paragraph{Optional postprocessing:} In order to have the values of Contrast and Brightness take effect, you must check the Postprocess checkbox.
1295 \begin{description}
1296     \item[Contrast] is the difference in brightness between objects or regions.
1297     \item[Brightness] refers to the overall lightness or darkness of the image.
1298 \end{description}
1299
1300 Figure~\ref{fig:c41} shows the C41 controls on the left and part of the Compositor window with grid lines showing the default shading box since the Show active area box is checked. Changes have been made to the left-hand side original computed values as seen in the right-hand side such as Gamma G which contains the hairline cursor and has a partial red outline value box.
1301
1302 \begin{figure}[htpb]
1303     \centering
1304     \includegraphics[width=0.9\linewidth]{c41.png}
1305     \caption{C41 - Control window and compositor window in action}
1306     \label{fig:c41}
1307 \end{figure}
1308
1309 \subsection{Chroma Key}%
1310 \label{sub:chroma_key}
1311 \index{chroma key}
1312
1313 This effect erases pixels which match the selected color.  They are replaced with black if there is no alpha channel and transparency if there is an alpha channel. In this case, you create a matte in the alpha channel, which is not visible to us. The selection of color model is important to determine the behavior (figure~\ref{fig:chroma-key}).
1314
1315 \begin{figure}[htpb]
1316     \centering
1317     \includegraphics[width=0.5\linewidth]{chroma-key.png}
1318     \caption{Chroma Key control window}
1319     \label{fig:chroma-key}
1320 \end{figure}
1321
1322 Chroma key uses either the lightness or the hue to determine what is erased. \textit{Use value} singles out only the lightness to determine transparency (Luma Key).
1323
1324 \textit{Color section}
1325
1326 Select a key color to erase using the \textit{Color} button. Alternatively a color can be picked directly from the output frame by first using the \textit{color picker} in the compositor window and then selecting the \textit{Use color picker} button. This sets the chroma key color to the current color picker color.
1327
1328 Be aware that the output of the chroma key is fed back to the compositor, so selecting a color again from the compositor will use the output of the chroma key effect. The chroma key should be disabled when selecting colors with the color picker.
1329
1330 \textit{Key parameters section}
1331
1332 If the lightness or hue is within a certain \textit{threshold} it is erased. Increasing the threshold determines the range of colors to be erased. It is not a simple on/off switch; it'a a range color. As the color approaches the edge of the threshold, it gradually gets erased if the \textit{slope} is high or is rapidly erased if the slope is low. The slope as defined here is the number of extra values flanking the threshold required to go from opaque to transparent. The \textit{Default} button returns Threshold to the value $10.0$; Slope to the value $0.0$; and Color to black (\#ff000000). The \textit{Reset} button and the \textit{reset} icons next to the sliders always return to the value $0.0$. Before the sliders are the \textit{input boxes} so that the precise numerical values can be written.
1333
1334 Normally threshold is very low when using a high slope. The two parameters tend to be exclusive because slope fills in extra threshold. The slope tries to soften the edges of the chroma key but it does not work well for compressed sources. A popular softening technique is to use a maximum slope and chain a blur effect below the chroma key effect to blur just the alpha.
1335
1336 \subsection[Chroma Key (HSV)]{Chroma Key (HSV)}%
1337 \label{sub:chroma_key_hsv}
1338 \index{chroma key HSV}
1339
1340 Chroma Key (HSV)\protect\footnote{Credit for Plugin by Jerome Cornet \url{http://jcornet.free.fr/linux/chromakey.html}} (figure~\ref{fig:chroma-key-hsv}) replaces a color with another color or transparency using HSV variables; it is frequently used to remove a color from a video to composite with another image. This process is generally referred to as green screen or blue screen process (because of the background color that is keyed out). More information: {\small \url{http://en.wikipedia.org/wiki/Chromakey}}
1341
1342 \begin{figure}[htpb]
1343         \centering
1344         \includegraphics[width=0.55\linewidth]{chroma-key-hsv.png}
1345         \caption{Windows config for Chroma Key (HSV)}
1346         \label{fig:chroma-key-hsv}
1347 \end{figure}
1348
1349 \subsubsection*{Requirements}
1350 \label{ssub:requirements}
1351
1352 The subject in the movie should have a good background. The lighting is crucial and good lighting during production will save you time with much less effort than in post-production. Another tip is to use a low-compressed, intraframe codec with as high a color depth as possible. In case of YUV-type source signal, it is better to have subsampling $4:4:4$ or $4:2:2$.
1353 Here we assume that we have a good video, filmed on green (or blue) screen that we want to use. Important: make sure you are using a color model that has an alpha channel, such as \textit{RGBA8}, \textit{RGBAFloat}, \textit{YUVA8}. To change color model, go to \texttt{Settings $\rightarrow$ Format $\rightarrow$ Color Model}.
1354
1355 \subsubsection*{Usage}
1356 \label{ssub:usage}
1357
1358 As in any other effect, add it to the timeline in the main window. You can tweak each parameter in order to improve the keying.
1359
1360 To understand how the plugin parameters work, we need to refer to the HSV color wheel (foreground color) in figure~\ref{fig:hsv_color_wheel}. Coinsider that this is an abstract example; in the real world we will be dealing with much more complicated masks.
1361
1362 \begin{figure}[htpb]
1363         \centering
1364         \includegraphics[width=0.9\linewidth]{hsv_color_wheel.png}
1365         \caption{Various parameters in the 'Color' and 'Key Parameters' sections.}
1366         \label{fig:hsv_color_wheel}
1367 \end{figure}
1368
1369 The left half has Saturation from 0 (in the center) to 100 on the edges. An example of a green screen is shown here. The right half has brightness from 0 (center) to 100 on the edges. The example of a blue screen is given here. The key color is the radius of the wheel, and its angle determines the hue. The Hue Tolerance is the arc of a circle (a wedge) that includes the radius. The wedge is the color range (mask) that we want to eliminate by keying, its shape is precise and easy to understand. The Brightness are the inner/outer extremes of the wedge; if the inner value (Min) is 0, then it coincides with the center point, if the outer value (max) is 100 then it coincides with the arc on the circumference. With intermediate values we will have masks similar to the one shown in the figure. Min Saturation is the distance from the center, along the Hue radius, from which we want to impose saturation with the value 0. It will be the value from which keying starts. Saturation Offset is an additional cut we make to the inner part of the wedge from the Min Saturation value. All of these adjustments allow us to establish a range of colors (Mask) that perfectly matches the background (the wedge in the example in the figure) that we want to eliminate. This is a precision operation, and it is not rare to return to the parameter combination several times to refine the mask.
1370
1371 Start with \textit{Hue Tolerance} at $10\%$, \textit{Min Bright\-ness} at $0$, \textit{Max bright\-ness} at $100\%$, \textit{Saturation offset} at $0$, \textit{Min Saturation} at $0$, \textit{In Slope} at $0$, \textit{Out Slope} at $0$, \textit{Alpha Offset} at $0$ (that’s mid-way through), \textit{Spill Threshold} at $0$, \textit{Spill Compensation} at $100\%$. At any time, you can check what the Mask looks like by clicking on \textit{Show Mask}. This will output a black and white image of the mask (\textit{matte}).
1372
1373 \qquad \textit{Color section}
1374
1375 In this section of the configuration window, you choose the key color and have the ability to see the mask created.
1376
1377 \begin{description}
1378         \item[Color...] Select the key color (green, blue, etc) using the color wheel or the color picker. Remember, only the Hue matters, not Saturation or Value. To use the color picker, click on the \textit{color picker} icon in the Compositor window, then click on the color you want in the Compositor window. Finally  in the Chromakey (HSV) parameters window, click on \textit{Use Color Picker}. Remember to disable ChromaKey (HSV) plugin when using the Color Picker on the Compositor window.
1379         \item[Show Mask] The plugin does not create a true matte in the alpha channel, but creates a mask. Activating this option will show the foreground as a white (opaque) shape while the background in black (transparency). You will be able to control the extent of the mask, any jagged edges, small black areas within the mask or small white areas within the foreground, which are to be removed, etc.
1380 \end{description}
1381
1382 \qquad \textit{Key parameters section}
1383
1384 In this section we expand the mask to a range of colors close to color key and refine the selection by also taking advantage of brightness and saturation.
1385
1386 \begin{description}
1387         \item[Hue Tolerance:] Because there are slight variations in lighting in real cases, the background will not be in a uniform key color hue. Increase or decrease the Hue tolerance to mask out the background. If there are dark spots that are keyed out that shouldn’t be, it can be corrected later (With the \texttt{Mask} tool, this operation is called the \textit{Garbage Matte}).
1388         \item[Brightness:] It allows the color range (Mask) to be better defined by exploiting the differences in brightness between background and foreground. This could be referred to as a Luma Key within the Chroma Key. Increase \textit{Min Brightness} so that only the background is masked out, and not parts of the foreground. You can also reduce \textit{Max Brightness} if some clear areas are keyed out (useful for very dark backgrounds).
1389         \item[Saturation:] It allows the color range (Mask) to be better defined by exploiting the differences in saturation between background and foreground. Since the best results are obtained by keying pure colors, it may come in handy to eliminate the less saturated colors (proper to the foreground) while leaving the more saturated colors (proper to the background, i.e. Green/Blue Screen) to the keying action. Increase \textit{Min Saturation} so that only the background is masked out, and not parts of the foreground. \textit{Saturation Offset} can be used to change this, because it acts similarly to Min Brightness. It could be said that Min Saturation concerns only the key color, while Saturation Offset concerns the range of Hue tolerance. But it is best to start by leaving it at $0$.
1390 \end{description}
1391
1392 Check what it looks like at this stage, your mask should be pretty
1393 clean. Toggle \textit{Show Mask} to check what it looks like, it
1394 should be OK\@. If not, repeat steps $1 to 4$ to get a better
1395 key. The rest of the controls are useful to smear the mask to help
1396 compositing later on. They will help you to make your key look much
1397 cleaner.
1398
1399 \qquad \textit{Mask tweaking section}
1400
1401 In this section you intervene on the already created mask with edge smoothing and transparencies.
1402
1403 \begin{description}
1404         \item[Slope:] For now, the mask is a full on/ full off mask that can be really harsh on the edges and not necessarily what you are looking for. \textit{In Slope} and \textit{Out Slope} will help you to smooth that key. In Slope it acts on the inner side of the edges by grading them with keying (background) colors. It leaves more colors in the mask. Out Slope acts on the outer side of the edges by grading them with the foreground colors. It takes more colors out of the mask. Basically, the colors that are borderline in the mask will see their alpha channel reduced by half instead of being completely on or off.
1405         \item[Alpha Offset:] This control offsets the whole alpha channel by some amount (from -100=full opacity to +100=full transparency). Be sure to know what you are doing if you change it from the default value of $0$.
1406 \end{description}
1407
1408 \qquad \textit{Spill light control section}
1409
1410 In this section we try to make halos, reflections and parasitic lights present on the foreground less noticeable.
1411
1412 \begin{description}
1413         \item[spill light control:] This step helps you remove the green or blue halo around the edges of the mask. It does so by removing the saturation of pixels of the foreground that have a similar hue to the key color (turning them into grey instead of green or blue). The hues to be desaturated are set with \textit{Spill Threshold}, the degree of desaturation is set with \textit{Spill Compensation}. In order for Spill compensation to work, Spill Threshold must be > 0. If you start with Spill Compensation at $100\%$, slowly increase the \textit{Spill Threshold} until the remaining green or blue areas turn grey. Then reduce Spill Compensation until the image looks good.
1414 \end{description}
1415
1416 Now the mask is probably still very harsh, so just below the Chromakey (HSV) plugin, add a \textit{Blur} effect, and select only the \textit{Alpha channel}, with a radius of $2$ or $3$ (more if you really want to soften the edges). This will significantly help the keying.
1417
1418 \subsection{Color 3 Way}%
1419 \label{sub:color_3_way}
1420 \index{color 3 way}
1421
1422 Together with \textit{Histogram Bezier / Curves} Color 3 Way is the main tool of Color Grading because you can modify the colors of \textit{Shadows}, \textit{Midtones}, and \textit{Highlights} as desired. Color 3 Way is keyframable (figure~\ref{fig:color3way}).
1423
1424 \begin{figure}[htpb]
1425     \centering
1426     \includegraphics[width=1.0\linewidth]{color3way.png}
1427     \caption{Color 3 Way control window}
1428     \label{fig:color3way}
1429 \end{figure}
1430
1431 \begin{itemize}
1432     \item It allows you to vary the \textit{contrast} of the image using the slider Value, always acting separately on shadows, midtones, and highlights and thus resulting in very precise application.
1433     \item Allows you to automate the \textit{white balance} by simply choosing a neutral color in the output of the Compositing window using the Color Picker and pressing the corresponding button in the plugin.
1434     \item Allows you to vary the \textit{Saturation} with sliders in the same manner as contrast was varied by the Value slider. For istance, to decrease the incidence of color dominants present in the shadows or in the highlights, vary the Saturation.
1435     \item With the \textit{color wheels} you can make very sophisticated adjustments to the shades of the images, in each of the three main areas of shadows, midtones and highlights.
1436     \item Allows you to copy exactly the setting of one zone to the other two zones using \textit{Copy to all} button. With this option, it is like using a fourth wheel called \textit{OffSet} in other programs.
1437     \item In addition to the three reset buttons, each slider and each wheel has its own Clear button, to return it to the default value without affecting the others.
1438 \end{itemize}
1439
1440 This plugin allows maximum control over the result and maximum precision of adjustments when used simultaneously with the control monitors, i.e.\ \textit{Waveform}, \textit{RGB Parade} and \textit{Vectorscope}. It is important to keep in mind that the three zones are not clearly separated, but slightly overlapping. This results in less precision but looks better for more smooth shades. By varying the values on the color wheels all RGB channels are affected simultaneously, which can result in unwanted color dominance. Saturation is also affected and must therefore be monitored.
1441 To use more precisely, drag the \textit{crosshair} with the mouse in the desired area and then adjust in steps of $0.001$ using the up/down and right/left arrows on the keyboard.
1442 The most common use cases (but can be adapted to virtually any situation) of the plugin are:
1443
1444 \begin{itemize}
1445     \item White balancing.
1446     \item Expand/compress contrast.
1447     \item Mitigate under and over exposure.
1448     \item Balance colors, i.e.\ eliminate color dominance.
1449     \item Color matching Shot to Shot.
1450     \item Create a Stylized look.
1451 \end{itemize}
1452
1453 When using the X11 graphics driver and RGBA-FLOAT color model, this plugin allows for greater than (0 - 1.0f) values (HDR). This does not work when using X11-OpenGL because it is an 8-bit limited driver. HDR values will only work for the color wheel, while the Value and Saturation sliders are always clipped to 1.0.
1454
1455 \subsection{Color Balance}%
1456 \label{sub:color_balance}
1457 \index{color balance}
1458
1459 Video Color Balance is a great effect to use along with Brightness/Contrast and Hue/saturation to try to compensate for possible errors in filming (low lighting, for example). It can do so much without greatly lowering the quality of the video. With it you can change the colors being sent to output \textit{CMY} (Cyan, Magenta, Yellow) or \textit{RGB} (Red, Green, Blue). Color Balance is also keyframable.
1460
1461 Since \textit{complementary colors} are neutralized, to eliminate a \textit{color cast}, the pertinent slider is moved in the direction of the complementary color. Clear buttons are present to reset its slider to default without affecting others. If you \textit{Lock parameters} you get the same \textit{Color Offset}, that is the fourth color wheel in the grading programs. The parameters of the plugin are:
1462
1463 \begin{description}
1464     \item[CMY/RGB sliders:] allows you to adjust the colors.
1465     \item[Preserve Luminosity:] Adjusts colors while keeping the overall brightness constant.
1466     \item[Lock Parameters:] works as a Color Offset.
1467     \item[White Balance] used in conjunction with the \textit{color picker} on a neutral color of the output, it will automatically balance the white.
1468 \end{description}
1469
1470 \subsection{ColorSpace}%
1471 \label{sub:color_space}
1472 \index{color space}
1473
1474 This plugin is a tool that can be used to convert your input media, such as a recording from your camera,
1475 from one color space/range to another.  It works for both RGB and YUV as set by your project format.
1476 Options are BT601, BT709, or BT2020 for Color Space input and output and JPEG or MPEG for Color Range
1477 input and output.  The Inverse option checkbox is available in case your media was rendered in the wrong
1478 color space  or range so that you can fix it.
1479
1480 \textbf{Algorithm for conversion} -- where equations is a $3\times3$ matrix multiply
1481
1482 \qquad $output = (input - input\_zero) \times equations + output\_zero$
1483
1484 \textbf{Algorithm for inverse}  -- where equations is a $3\times3$ matrix multiply
1485
1486 \textit{Description}:    invert(equations); swap(input,output); swap(input\_zero,output\_zero)
1487
1488 \qquad $input = (output - output\_zero) \times inverse\_equations + input\_zero$
1489
1490 \begin{figure}[hbtp]
1491     \centering
1492     \includegraphics[width=0.6\linewidth]{colorspace.png}
1493     \caption{ColorSpace control window}
1494     \label{fig:colorspace}
1495 \end{figure}
1496
1497
1498 \subsection{CriKey}%
1499 \label{sub:crikey}
1500 \index{CriKey}
1501
1502 The Chroma Interpolation Key plugin, CriKey, is a regionally based chroma key with interpolation (figure~\ref{fig:crikey}). This is useful when you only want 1 or some specific zones to be defined by the chroma key as opposed to the entire image. Its most significant feature is that you can select several regions of interests and of different colors as opposed to only $1$.
1503
1504 \begin{figure}[htpb]
1505     \centering
1506     \includegraphics[width=0.5\linewidth]{crikey.png}
1507     \caption{three active point created in CriKey}
1508     \label{fig:crikey}
1509 \end{figure}
1510
1511 To start, if not already checked, turn on drag. In the composer window select an area of a certain color by clicking on that point with the \textit{right mouse button} and check to see that it is enabled with an $*$ in the "E" field. The color of the area is used to define the region of interest and then you can use the \textit{threshold} slider to designate the tolerance variation. This creates a region that is the chroma key selection and a fill will be performed in that area, but only within that region. So, say for example, a red colored area was chosen, only the red color inside the region is selected -- not that color red in the entire image. The drag capability makes it easy to check a point before right clicking it to see the effect. You will want to turn off drag when you are finished with CriKey so that it does not interfere with other compositor functions.
1512
1513 \begin{description}
1514     \item[Draw mode:] options let you use \textit{Alpha} for see-thru, \textit{Edge} to just outline the edges of the region, or \textit{Mask} to block. The pixels which match the selected color are replaced by black if Mask is chosen or see-thru/transparent if Alpha.
1515     \item[X, Y:] points coordinate.
1516     \item[Buttons:] \textit{New} to create a new point, \textit{Up/Dn} to move highlighted point up or down \textit{Del} to delete the highlighted point.
1517     \item[Threshold:] slider goes from $0\, to\, 1$. Increasing the threshold, increases the area to be filled or masked. You can also use the mouse wheel to scroll the slider.
1518     \item[Drag:] for ease of use. If you need to clear the Drag enabled, you can easily do this with \textit{Allow keyframe spanning} whose use is described in \nameref{sec:allow_keyframes_spanning}.
1519     \item[Reset:] button to revert to only the default middle point with all others being deleted.
1520     \item[ListBox:] "E" for Enabled with $*$ marking that; "X" is the point’s $x$ coordinate; "Y" is the point’s $y$ coordinate; "T" is the threshold value of $X,Y$ point; \textit{Tag} represents the \# of the selected
1521     point.
1522     \item[Hints:] for usage shortcuts.
1523 \end{description}
1524
1525 \subsubsection*{Some notable caveats}
1526 \label{ssub:some_notable_caveats}
1527
1528 \begin{enumerate}
1529     \item When choosing an area that has variations of the same color within a region, for less work and for the best results, choose an average color in that region instead of an extreme end of that color.
1530     \item If the threshold is set appropriately you can see the edges which is helpful.
1531     \item The mask is computed and shows the fill region.
1532     \item Use the Gradient plugin to substitute a different color for the selected area.
1533 \end{enumerate}
1534
1535 Figure~\ref{fig:crikey01} and figure~\ref{fig:crikey02} shows how moving the Threshold slider with the Point selected blacks out the single region which has the darker brown hills in it. Because the edge was located, any of the same color in the rest of the video would not be blacked out.
1536
1537 \begin{figure}[htpb]
1538     \centering
1539     \includegraphics[width=0.7\linewidth]{crikey01.png}
1540     \caption{The screenshot shows the compositor with some default settings in the controls window.}
1541     \label{fig:crikey01}
1542 \end{figure}
1543
1544 \begin{figure}[htpb]
1545     \centering
1546     \includegraphics[width=0.7\linewidth]{crikey02.png}
1547     \caption{same screenshot with moving Threshold}
1548     \label{fig:crikey02}
1549 \end{figure}
1550
1551 \subsubsection*{Usage steps}
1552 \label{ssub:usage_steps}
1553
1554 \begin{enumerate}
1555     \item Click \textit{Reset} (there will be a single $X,Y$ coordinate point that is in the middle and not enabled)
1556     \item Check to make sure \textit{Drag} is on.
1557     \item In the Compositor, right click on area of interest and an $X,Y$ coordinate will appear in the listbox.
1558     \item Click on the \textit{E} Enabled field next to this latest point and an $*$ asterisk will show.
1559     \item Now you will see an area turn black so use the \textit{Threshold} slider to only black out the area of interest.
1560     \item Repeat steps $3-5$ until you have selected all of the desired areas.
1561     \item Finally, turn off \textit{drag} so as not to interfere with other compositor functions
1562 \end{enumerate}
1563
1564 \subsection{Crop \& Position}%
1565 \label{sub:crop_position}
1566 \index{crop \& position}
1567
1568 It allows you to obtain a rectangle from the frame, whose dimensions are fully adjustable by four sliders for the four sides of the frame. You can also place this rectangle in the canvas using two other sliders for right/left and up/down scrolling. With the Clear buttons we can bring the slider to default values without affecting the other parameters. Unlike the \textit{Crop} tool, the original frame size is not altered and being keyframable allows a wide variety of uses. In figure~\ref{fig:crop_position} the Crop \& Position plugin is compared with the \textit{Crop} tool.
1569
1570 \begin{figure}[htpb]
1571         \centering
1572         \includegraphics[width=1.0\linewidth]{crop_position.png}
1573         \caption{Crop tool and Crop \& Position plugin compared}
1574         \label{fig:crop_position}
1575 \end{figure}
1576
1577 \subsection{DeScratch}%
1578 \label{sub:descratch}
1579 \index{descratch}
1580
1581 The descratch video plugin can be used to remove vertical scratches
1582 from film. It can also be used, after image rotation, to remove
1583 horizontal noise lines that may appear on analog \textit{VHS}
1584 captures. For best results \textit{YUV} should be the video format;
1585 however if your format is \textit{RGB}, it will first be converted
1586 to YUV\@. There are many tuneable parameters necessary to get good
1587 results for your specific film.
1588
1589 Figure~\ref{fig:descratch01} shows a list of the parameter descriptions:
1590
1591 \begin{figure}[htpb]
1592     \centering
1593     \includegraphics[width=0.6\linewidth]{descratch01.png}
1594     \caption{DeScratch control window}
1595     \label{fig:descratch01}
1596 \end{figure}
1597
1598 \begin{figure}[htpb]
1599     \centering
1600     \includegraphics[width=0.5\linewidth]{descratch02.png}
1601     \caption{Various parameters of DeScratch}
1602     \label{fig:descratch02}
1603 \end{figure}
1604
1605 \begin{description}
1606     \item[threshold] instantaneous slope value; chroma difference in numerical pixels.
1607     \item[asymmetry] maximum asymmetry of surrounding
1608     pixels.
1609     \item[Mode] \textit{None}; \textit{Low}=black; \textit{High}=white; \textit{All}=both;
1610     \textit{y} -- processing mode for \textit{luma} plane;
1611     \textit{u}-- processing mode for \textit{chroma u} plane;
1612     \textit{v} -- processing mode for \textit{chroma v} plane.
1613     \item[width min/max] minimal scratch width in pixels and maximum scratch width in pixels.
1614     \item[len min/max] percent minimal scratch length and percent maximum scratch length.
1615     \item[len blur] scaled radius of vertical blur for frame
1616     analysis.
1617     \item[len gap] number of pixels for maximum vertical gap
1618     to be closed.
1619     \item[max angle] maximal angle to vertical in degrees.
1620     \item[fade] percent of how much it fades to and how much it. Uses between before image and blurry image.
1621     \item[border] pixel thickness of border near scratch for partial restoration.
1622     \item[Mark] shows the potential scratch lines for ease of viewing and for debugging. It shows chosen pixels in the color green, close but still rejected in yellow, and extreme pixels in the color red. This makes it easy to vary some parameters to choose more or fewer scratch lines.
1623     \item[Reset] activating this button returns all of the parameters to their default values.
1624 \end{description}
1625
1626 Figure~\ref{fig:descratch} shows a before and after DeScratch scenario. With \textit{Mark} set, you can see the black lines which indicate what the program was looking at to determine the scratches to remove.
1627
1628 \begin{figure}[htpb]
1629     \centering
1630     \includegraphics[width=0.9\linewidth]{descratch.png}
1631     \caption{Original video with scratch; Option Mark selected and Final video}
1632     \label{fig:descratch}
1633 \end{figure}
1634
1635 \subsection{Decimate}%
1636 \label{sub:decimate}
1637 \index{decimate}
1638
1639 This is used to decrease the frame rate of a video. Changing the frame rate means eliminating a frame for any given number of frames ($1 in N$); but if frames that are important for visual continuity are deleted, temporal artifacts arise: flickering, slowdowns, accelerations, etc. The Decimate filter maintains a higher quality because it first eliminates duplicate frames or frames that are most similar, thus limiting the appearance of artifacts. It is often used after the \textit{Invert Telecine} plugin to make the video more smooth.
1640
1641 One use of the decimate effect can be applied to a DVD to convert the 29.97\,\emph{fps} video to the 23.97\,\emph{fps} film rate, but the effect can take any input rate and convert it to any lower output rate. The output rate of decimate is the project frame rate. The input rate is set in the decimate user interface. To convert 29.97\,\emph{fps} progressive video to 23.97\,\emph{fps} film, apply a decimate effect to the track. Set the decimate input rate to 29.97 and the project rate to 23.97.
1642
1643 Keep in mind that every effect layered before decimate, processes video at the decimate input rate and every effect layered after decimate, processes video at the project frame rate. Computationally intensive effects should come below decimate.
1644
1645 \subsection{Deinterlace}%
1646 \label{sub:deinterlace}
1647 \index{deinterlace}
1648
1649 The deinterlace effect has evolved over the years to deinterlacing and a whole lot more. In fact two of the deinterlacing methods, \textit{Inverse Telecine} and \textit{Frames to Fields}, are separate effects. The deinterlace effect offers several variations of line replication to eliminate comb artifacts in interlaced video. It also has some line swapping tools to fix improperly captured video or make the result of a reverse effect display fields in the right order.
1650
1651 \subsection{Deinterlace-CV}%
1652 \label{sub:deinterlace_cv}
1653 \index{deinterlace-cv}
1654
1655 Selection of deinterlacing mode for your video to eliminate comb artifacts (figure~\ref{fig:deinterlace}).
1656
1657 \begin{figure}[htpb]
1658     \centering
1659     \includegraphics[width=0.6\linewidth]{deinterlace.png}
1660     \caption{Pulldown menu}
1661     \label{fig:deinterlace}
1662 \end{figure}
1663
1664 \subsection{Delay Video}%
1665 \label{sub:delay_video}
1666 \index{delay video}
1667
1668 Delay the video by some number of seconds.
1669
1670 \subsection{Denoise Video}%
1671 \label{sub:denoise_video}
1672 \index{denoise video}
1673
1674 Denoise video (figure~\ref{fig:denoise}).
1675
1676 \begin{figure}[htpb]
1677     \centering
1678     \includegraphics[width=0.4\linewidth]{denoise.png}
1679     \caption{Control window of the DeNoise plugin}
1680     \label{fig:denoise}
1681 \end{figure}
1682
1683 \subsection{Difference key}%
1684 \label{sub:difference_key}
1685 \index{difference key}
1686
1687 The difference key creates transparency in areas which are similar between two frames. The Difference key effect must be applied to two tracks. One track contains the action in front of a constant background and another track contains the background with nothing in front of it. Apply the difference key to the track with the action and apply a \textit{shared effect} of it to the track with the background. The track with the background should be muted and underneath the track with the action and the color model should have an alpha channel. It’s hard to get good results.
1688
1689 Pixels which are different between the background and action track are treated as opaque. Pixels which are similar are treated as transparent. Change \textit{threshold} in the difference key window to make more pixels which are not the same color transparent. Change \textit{slope} to change the rate at which the transparency tapers off as pixels get more different. The slope as defined here is the number of extra values flanking the threshold required to go from opaque to transparent. A high slope is more useful with a low threshold because slope fills in extra threshold.
1690 \textit{Use value} causes the intensity of pixels (\textit{luma}) to be compared instead of the color. Applying a \textit{blur} to the top track with just the alpha channel blurred can soften the transparency border (figure~\ref{fig:diff-key}).
1691
1692 \begin{figure}[htpb]
1693     \centering
1694     \includegraphics[width=0.8\linewidth]{diff-key.png}
1695     \caption{Difference key and its problematic output}
1696     \label{fig:diff-key}
1697 \end{figure}
1698
1699 \subsection{DotTV}%
1700 \label{sub:dottv}
1701 \index{dotTV}
1702
1703 Puts various size dots over the picture to simulate TV effect. This came from: {\small \url{https://effectv.com}}.
1704
1705 \subsection{Downsample}%
1706 \label{sub:downsample}
1707 \index{downsample}
1708
1709 Downsampling is the process of reducing the size of an image by throwing out data, reducing sampling rate.
1710
1711 \subsection{Edge}%
1712 \label{sub:edge}
1713 \index{edge}
1714
1715 Display only the edges of the video throughout the image.
1716
1717 \subsection{Fields to frames}%
1718 \label{sub:fields_to_frames}
1719 \index{fields to frame}
1720
1721 See the theory description in the \textit{Frames to Fields} plugin. This effect reads frames at twice the project framerate, combining two input frames into a single interlaced output frame. Effects preceding fields to frames process frames at twice the project frame rate. Each input frame is called a field.
1722
1723 Fields to frames needs to know what field corresponds to what lines in the output frame. The easiest way to figure it out is to try both options in the window. If the input fields are the result of a line doubling process like frames to fields, the wrong setting results in blurrier output. If the input fields are the result of a standards conversion process like \textit{1080 to 480}, the wrong setting will not make any difference.
1724
1725 \subsection{Flip}%
1726 \label{sub:flip}
1727 \index{flip}
1728
1729 This effect flips a video track either vertically or horizontally.
1730
1731 \subsection{Foreground}%
1732 \label{sub:foreground}
1733 \index{foreground}
1734
1735 Whatever the visual content of the frame, the Foreground plugin application applies a uniform color that can be chosen by color picker, color wheel, color presets, or by entering the hexadecimal value.
1736 In addition there are HSV, RGB, YUV, and alpha sliders to vary the color accordingly.
1737
1738 \subsection{Frames to fields}%
1739 \label{sub:frames_to_fields}
1740 \index{frames to fields}
1741
1742 \subsubsection*{Theory behind the Frames to Fields and Fields to Frames plugins}
1743 \label{ssub:theory_frames_fields}
1744
1745 Historically, CRT-type TVs used interlaced signals to save bandwidth. An interlaced video consists of two \textit{fields} that are read and drawn on the screen one after the other. Each field must be played at a framerate double that of the resulting video. In two steps the complete frame will be reconstructed.
1746
1747 Frame 1 $\implies$ F1-field1 (\textit{Top} or \textit{Odd}), F1-field2 (\textit{Bottom} or \textit{Even})
1748
1749 Frame 2 $\implies$ F2-field1, F2-field2
1750
1751 Interlaced video reading: $F1-f1$ then $F1-f2$ then $F2-f1$ then $F2-f2$ \dots
1752 There may be visual problems if the Top type interlacing is read according to a Bottom scheme. So it's important to know if a video is Top or Bottom. Generally an \textit{HD} video is Top; a \textit{DV} video (both PAL and NTSC) is Bottom; \textit{SD} (PAL) is Top; \textit{SD} (NTSC) is Bottom (but not always). Instead, high-definition videos need to be more compressed and this contrasts with the interlacing that is little and badly compressible, so modern videos are mostly \textit{progressive}.
1753
1754 \subsubsection*{In \CGG{}}
1755 \label{ssub:in_cin_gg}
1756
1757 \begin{enumerate}
1758     \item upload an interlaced video to the Timeline and Resources and play it for viewing.
1759     \item The video presents visual artifacts because PC monitors are progressive.
1760     \item In the Resources window, open the media \textit{Info} with the right mouse button. Below you can see that the \textit{asset's interlacing} is active. It has four options for settings interlacing type: \textit{Unknown}, \textit{Top Fields first}, \textit{Bottom Fields first}, and \textit{Not interlaced}. If the file is (H)DV type, recognition and configuration is done automatically. All other media types will be set \textit{unknown}. We need to set the type of interlacing, so we have to manually set the interlacing.
1761     \item Now we can to use the \textit{Frames to Fields} plugin, but we have to configure it and act manually.
1762 \end{enumerate}
1763
1764 Now for the practical use of this plugin which applies the operation reverse to the \textit{Fields to Frames} plugin. It extracts the two interlaced fields stored in alternating lines of interlaced source footage and outputs them as separate full frames. The alternating lines missing on each output frame are interpolated.
1765
1766 This plugin is only useful if its output is pulled with doubled framerate with respect to the source footage. One typical usage scenario is to do \textit{masking}, \textit{scaling} and \textit{translating} on interlaced footage without the need to destroy the additional temporal information contained in such source material. This is helpful if your intended target format is interlaced. If on the other hand, you just want to target a progressive display (for example, you create video for display on a computer monitor solely) then it is much more convenient to de-interlace the source material prior to any further processing.
1767
1768 \subsubsection*{Processing interlaced footage without deinterlacing}
1769 \label{ssub:processing_interlace_footage}
1770
1771 \begin{enumerate}
1772     \item Create a new project with doubled frame rate. That is, make it $50\,fps$ if your source footage is $25i$.
1773     In \texttt{Resources $\rightarrow$ Media $\rightarrow$ Info} set the interlaced type (or unknown)
1774     \item Insert your source footage onto a video track in the timeline. Now, \CGG{} will playback each
1775     frame of your footage twice. There will be visual artifacts because the video is interlaced and the
1776     monitor is progressive.
1777     \item Apply the \textit{Frames to Fields} effect. Be sure to choose the correct field order. If we know or believe that the original video is \textit{Top First} let's try it first, but it doesn't have to be the right solution. The only way is to playback and look for visual artifacts.
1778     \item Then apply any further effects afterwards, including translations, scaling, slow motion, precise
1779     frame-wise masking or use of the motion tracker plugin.
1780     \item Render your project to an intermediate clip. Be sure to choose a rather lossless video codec, for
1781     example \textit{Motion-JPEG-A} or even \textit{uncompressed YUV} if you have plenty of storage.
1782     \item Insert the intermediate clip into your original project. Make sure the doubled framerate has been
1783     detected correctly by \CGG{} (by looking in the clip's media \textit{info} in the media resources folder).
1784     \item Apply the \textit{Fields to frames} effect to the intermediate clip. This will combine two adjacent fields
1785     into one interlaced field with the original frame rate.
1786     \item Do the final render on your original project. Now there will be no visual artifacts on the monitor.
1787 \end{enumerate}
1788
1789 \subsection{Freeze Frame}%
1790 \label{sub:freeze_frame}
1791 \index{freeze frame}
1792
1793 In its simplest form, highlight a region of the track to freeze, drop the \texttt{freeze frame} effect on the highlighted region, and the lowest numbered frame in the affected area will play throughout the entire region. Freeze Frame has an enabled option which can be keyframed. Regions of a freeze frame effect which are enabled, repeat the lowest numbered frame since the last keyframe. This has unique possibilities.
1794
1795 \begin{itemize}
1796     \item If a freeze frame effect has a keyframe in the middle of it set to enabled, the frame in the middle is repeated in the entire effect.
1797     \item If a freeze frame effect has several keyframes, each set to enabled, every time a keyframe is encountered the frame under it becomes the frozen one.
1798     \item If a freeze frame effect alternates between enabled and disabled, each time an enabled keyframe is encountered the frame under it is replicated until the next disabled keyframe. The disabled regions play through.
1799 \end{itemize}
1800
1801 \subsection{Gamma}%
1802 \label{sub:gamma}
1803 \index{gamma}
1804
1805 \textit{Log} camera images store colors in a $logarithmic$ scale. The blacks in these images are nearly $0$ and the whites are supposed to be infinity. The graphics card and most video codecs store colors in a $linear$ scale but \CGG{} keeps log camera images in their original logarithmic scale when it renders them. This is necessary because the raw image parser can not always decode the proper gamma ($\gamma$) values for the images. It also does its processing in $16\,bit$ integers, which takes away a lot of information.
1806
1807 Mathematically, the gamma function is exponential
1808 ($output = input^{\gamma}$) and therefore the inverse of the
1809 logarithmic function [$\gamma = \log_{input}{(output)}$]. Actually the formula
1810 used by the \CGG{} plugin is: $output = input^{\frac{1}{\gamma}}$
1811 which allows for a range of values $0 \div 1.0$. The gamma effect
1812 converts the logarithmic colors to linear colors through a
1813 \textit{gamma value} and a \textit{maximum value}. The gamma value
1814 determines how steep the output curve is (i.e.\ the value of the
1815 gamma parameter; for color space Rec709 is $2.4$
1816 ($\frac{1}{\gamma} =0.41\dots$), for sRGB is $2.2$
1817 ($\frac{1}{\gamma} =0.45\dots$), etc.). We use $ \dfrac{1}{\gamma}$ because with $\gamma < 1$ there is gamma compression of the curve, increasing the output values relative to the linear (see figure~\ref{fig:gamma02}.). With $\gamma > 1$ we have gamma expansion, typically used to linearize a compressed gamma curve (\textit{Log}). The maximum value is where
1818 $1.0$ in the output corresponds to maximum brightness in the
1819 input. It serves to avoid clipped values because it allows you to
1820 set the maximum value of the output, $1.0$, whenever range
1821 adjustment is done (see figure~\ref{fig:gamma01}). It is important
1822 to adjust the two parameters accurately in order to avoid undesired
1823 and unexpected effects, such as excessive values, unbalanced image,
1824 incorrect linearization, etc.
1825
1826 \begin{figure}[htpb]
1827     \centering
1828     \includegraphics[width=0.8\linewidth]{gamma01.png}
1829     \caption{settting \textit{Maximun} to $0.6900$}
1830     \label{fig:gamma01}
1831 \end{figure}
1832
1833 The gamma effect has two more parameters to simplify gamma correction. The automatic option causes it to calculate max from the histogram of the image. Use this when making a preview of a long list of images since it changes for every image. The use color picker option uses the value currently in the color picker to set the maximum value. Note that every time you pick a color from the compositor window, you need to click on use color picker to apply the new value.
1834
1835 The best use of the gamma is manually monitoring the waveform as shown in figure~\ref{fig:gamma02}.
1836
1837 \begin{itemize}
1838     \item Look at the highest peak on the \textit{waveform} and measure it with the crosshair observing the numerical value at the top left.
1839     \item Set this value with the \textit{maximum} slider or \textit{textbox}.
1840     \item Then adjust the slider of the \textit{gamma} to our liking, always checking the result on the waveform so to be sure never to exceed the values of clipping, $0 \div 1.0$.
1841 \end{itemize}
1842
1843 \begin{figure}[htpb]
1844     \centering
1845     \includegraphics[width=0.8\linewidth]{gamma02.png}
1846     \caption{Setting \textit{Maximun} to $0.6100$ and \textit{Gamma} to $0.3300$}
1847     \label{fig:gamma02}
1848 \end{figure}
1849
1850 Care must be taken when using gamma correction: if the image carries a specific gamma value, or if it has already been corrected previously (for example automatically in the camera), etc.; then a second application of the gamma leads to excessive and artificial results. Gamma is keyframable.
1851
1852 \subsection{Gradient}%
1853 \label{sub:gradient}
1854 \index{gradient}
1855
1856 The \textit{gradient} effect overlays a smooth color gradient on top of every video frame. It is useful for all sorts of background fills, for partially filtering, adding depth to the image, or for adding moving highlights. The Gradient effect can generate linear or circular color fills / shape. For linear fills, you can choose the \textit{angle}, for circular fills the \textit{center $(X,Y)$} of the created gradient pattern. You can control the \textit{slope} of the color transition by selecting a transition function ($linear$, $logarithmic$, $squared$) and by changing the start (\textit{inner}) and stop (\textit{outer}) radius. Note that both colors used in this color transition can contain an arbitrary \textit{Alpha} value (transparency). All parameters can be keyed and will be interpolated between keyframes.
1857
1858 The first time you use the plugin it may seem complicated, but if you understand that we have to adjust the gradient from an inner spot we choose to an outer spot we also choose, the work will become easy and fast.
1859
1860 \subsubsection*{Use case (Vignette)}
1861 \label{ssub:use_case_vignette}
1862
1863 \begin{enumerate}
1864     \item Setting the shape to radial
1865     \item Setting the rate to Linear (or Log or Square)
1866     \item Position $X$ and $Y$ to center the main figure.
1867     \item Choose inner color=black
1868     \item Adjust inner radius
1869     \item Bring the inner color alpha slider to $0$
1870     \item Choose outer color=black
1871     \item Check that the outer color alpha slider is $1$.
1872     \item Adjust outer radius
1873 \end{enumerate}
1874
1875 \textit{Note:} The inner and outer colors are visibly mixed in the gradient area. If you want to make a vignetting of only black, you must set the two colors to black and then make the inner one transparent so that it does not cover the figure.
1876
1877 \subsection{HistEQ}%
1878 \label{sub:histeq}
1879 \index{histEQ}
1880
1881 Remap colors using blended histogram weights. Figure~\ref{fig:histeq} shows the GUI and the results in a split screen.
1882
1883 \begin{figure}[htpb]
1884     \centering
1885     \includegraphics[width=0.8\linewidth]{histeq.png}
1886     \caption{Control window and split screen}
1887     \label{fig:histeq}
1888 \end{figure}
1889
1890 If the histogram is as wide as the entire range ($0 - 1.0$), the image is high contrast. If the range is small (i.e., the values are close together) the contrast is small. In this case HistEQ is used to distribute the few clustered values across the entire range ($0 - 1.0$), increasing the contrast of the frame.
1891 In order to do this HistEQ equalizes the colorspace through use of a \textit{histogram equalization algorithm}. Parameters are:
1892
1893 \begin{description}
1894     \item[Gain:] when set to $1$, the colorspace is best effort. If the gain is set to $0$, the result is the entire regression line of the color map.
1895     \item[Blend:] goes between a straight and a twisted line.
1896     \item[Split output:] diagonally shows in the compositor, the new results on the left and old on the right.
1897     \item[Plot bins/lut:] displays a plot of the result.
1898 \end{description}
1899
1900 \subsection{Histogram}%
1901 \label{sub:histogram}
1902 \index{histogram}
1903
1904 The histogram allows an immediate view of the contrast amplitude of an image with its distribution of \textit{luma} and \textit{colors} values. If the columns of values occupy the whole range $0-1.0$ (also expressed as a percentage above the graph) then we have maximum contrast; if the range is smaller the contrast is smaller. In fact, contrast is mathematically given by the highest value of the abscissa minus the lowest value. If the values are similar and close together, the difference is smaller and the lower the contrast. If most of the values are on the right of the histogram you have an image with highlights at the limit with values clamped to $1.0$. This is called \textit{overexposure}. However, if most of the values are moved to the left, with the limit of the values clamped to $0$, we have a lowlight image and we talk about \textit{underexposure}. This plugin is a tool for Primary Color Correction, that is, affecting the entire frame. Histogram is keyframable (figure~\ref{fig:histogram}).
1905
1906 \begin{figure}[htpb]
1907     \centering
1908     \includegraphics[width=0.9\linewidth]{histogram.png}
1909     \caption{Master Histogram and RGB Histogram}
1910     \label{fig:histogram}
1911 \end{figure}
1912
1913 The Histogram is always performed in floating point RGB regardless of
1914 the project color space, but with clipping at 1.0. When using the X11
1915 graphics driver and RGBA-FLOAT color model, Histogram allows you to
1916 display greater than (0 - 1.0f) values to accomodate HDR. This does
1917 not work when using X11-OpenGL because it is an 8-bit limited driver.
1918 The display will stop at +110\%, but there is no clipping. By lowering
1919 the brightness all out-of-range values become visible, even those
1920 initially above 110\%.
1921
1922 The histogram has two sets of transfer parameters: the \textit{input transfer} and the \textit{output transfer}. The input transfer has value on the horizontal axis of $x$; it is a normalized scale of values ranging from 0 - 1.0 (which for a depth color of 8 bits corresponds to the range 0 - 255, for 10 bits corresponds to 0 - 65536, etc). The output transfer (the $y axis$) represents the height of the column where a given value $x$ appears. A higher column ($y$ greater) indicates that many pixels have the corresponding value $x$; a lower column indicates that fewer pixels have that value. On the left we have the minimum value $0$, which is the black point. On the right we have the maximum value $1.0$ which is the white point. The intermediate values pass smoothly from one extreme to the other. The three important points (including the midtones) are indicated by cursors (small triangles) at the base of the histogram. You can adjust them to change the values of the three points if you want. Acting on the white or black point involves horizontal shifts only; acting on the midtones triangle also involves vertical movements leading to a "gamma" correction of the curve (Linear to Log or Reverse Log or vice versa). Further down is an additional bar with related cursors and textboxes. It is used to adjust input and output values (on the vertical).
1923
1924 There are 4 possible histograms in the histogram viewer. The red, green, blue histograms show the input histograms for red, green, blue and multiply them by an input transfer to get the output red, green, blue. Then the output red, green, blue is scaled by an output transfer. The scaled red, green, blue is converted into a value and plotted on the value histogram. The value histogram thus changes depending on the settings for red, green, blue. The value transfers are applied uniformly to R, G, B after their color transfers are applied. Mathematically, it is said that the values of $x$ are linked to the values of $y$ by a transfer function. This function, by default, is represented by a line that leaves the values of $x$ and $y$ unchanged, but we can intervene by modifying this line with the cursors or the textboxes.
1925
1926 You need to select which transfer to view by selecting one of the channels on the top of the histogram. You can also choose whether to display the master, i.e.\ only the values of the \textit{luma}, or show the \textit{Parade}, i.e.\ the three RGB channels. You can switch from one to the other with the two buttons in the upper right corner. The input transfer is defined by a graph overlaid on the histogram; this is a straight line. Video entering the histogram is first plotted on the histogram plot, then it is translated so output values now equal the output values for each input value on the input graph.
1927
1928 After the input transfer, the image is processed by the output transfer. The output transfer is simply a minimum and maximum to scale the input colors to. Input values of $1.0$ are scaled down to the output's maximum. Input values of $0$ are scaled up to the output minimum. Input values below $0$ are always clamped to $0$ and input values above $1.0$ are always clamped to $1.0$. Click and drag on the output gradient's triangles to change it. It also has textboxes to enter values into.
1929
1930 Enable the \textbf{Automatic} toggle to have the histogram calculate an automatic input transfer for the red, green, and blue but not the value. It does this by scaling the middle $99\%$ of the pixels to take $100\%$ of the histogram width. The number of pixels permitted to pass through is set by the Threshold \textbf{textbox}. A threshold of $0.99$ scales the input so $99\%$ of the pixels pass through. Smaller thresholds permit fewer pixels to pass through and make the output look more contrasty.
1931 \textit{Plot histogram} is a checkbox that enables plotting the histogram. It can be useful because having a histogram that changes in real-time can use a lot of system resources for computation. In this case it is enabled only at times when it is needed.
1932 \textit{Split output} is a checkbox that enables a diagonal split showing in the compositor, so we can see the effects of the changes from the original frame.
1933 \textit{Reset} returns the four curves to their initial state (neutral) as well as the Value/RGB histogram buttons.
1934
1935 \textbf{Linear to Log} slider: frequency in Linear range to Log range; default is 50\%, but if you want it to be the same as the Videoscope or Histogram Bezier, which are of type Log, set the slider all the way to Log.  The variation is by 10\% steps.  Linear generally represents what the eye sees in the real world.  Log is an exponential look where the small numbers are represented more - that is, the leading digit.
1936
1937 The histogram plugin ordinarily applies a value for a single frame.  A
1938 new feature modifies histogram to show values for a selection of frames.
1939 You use several frames in a video that you want to use the \textit{average}
1940 color to determine the color you want the rest of the video to be.  When
1941 there is a large light or color variation within a range of a few frames,
1942 you spend a lot of time correcting each frame when it would be better to
1943 just get an average value to use.  If you want, then you can make a LUT for
1944 that set of frames instead of each frame.\\
1945 It works by selecting the area on the timeline for
1946 which you would like to see the Histogram averaged and then click on the
1947 \textbf{sum frames} button in the Histogram plugin. If a Selection is set on the timeline, the number of frames will be calculated and equalized to the mean value.
1948
1949 A side note: by using a number of frames, you can get a \textit{dissolve-like
1950 transition effect}.
1951
1952 \paragraph{Theory:} 
1953
1954 For more on the mathematical aspect see here:
1955
1956 {\small \url{https://thirdspacelearning.com/gcse-maths/statistics/histogram/}}
1957
1958 For our discussion, it is enough to understand a few concepts. Each vertical line we see in the histogram is not a simple line, but a rectangle having a certain base. This base is given by the values of $x_i$ present at the edges of the rectangle \textit{i} (pixel range, $x_{max_i} - x_{min_i}$). Rectangles are called \textit{Bins} or Accumulators. The bin's number is of fixed and known size because it depends on the color depth. The bin height is our output $y$ and the bin area ($A_i = f(x_i)$) is known because it represents the \textit{number of occurrences} that are read in bin, also called \textit{frequency ($f_x$)}. The plugin scans the entire range of $x_i$, from 0 to 1.0, and records all the occurrences within each bin. The value of $f_x$ for each bin is the \textit{max} value. At this point knowing base and area, we can obtain the value of $y$ axis that is reported in the histogram.
1959
1960 $width = b_i = x_{max_i} - x_{min_i}$
1961
1962 Having established the depth color, the bin width is always the same (b) for every $bin_i$:
1963
1964 $b_i = b = \dfrac{range(1.0-0)}{\# bins}$
1965
1966 $A_i = f(x_i) = max_i = Base \times High = b \times y_i$
1967
1968 Hence:
1969
1970 $y_i = \dfrac{f(x_i)}{b}$
1971
1972 Dim bins are on the left, bright bins on the right.
1973 You can have discordance of results, looking in the scopes, either by switching from Histogram to Histogram Bezier or after a conversion between color spaces (with associated change in depth color). The number of bins used depends on the color model bit depth:
1974
1975 \begin{description}
1976         \item[Histogram:] 256 for rgb8 and 65536 for all others
1977         \item[Bezier:] 256 for rgb8/yuv8 and 65536 for all others
1978         \item[Scopes:] always uses 65536
1979 \end{description}
1980
1981 All of the bins are scanned when the graph is plotted.  What is shown on the graph, in the Compositor window, and finally on the scopes, depends on which plugin is used:
1982
1983 \begin{description}
1984         \item[Histogram:] was max of the bins in the pixel range, now is the sum (to make it congruent with Bezier and the Scopes)
1985         \item[Bezier:] is the max of the bins in the pixel range
1986         \item[Scopes:] is the max of the bins in the pixel range
1987 \end{description}
1988
1989 Another difference in behavior is regarding the type of curve, whether Linear or Log:
1990
1991 \begin{description}
1992         \item[Histogram:] the curve is Linear, but it is editable with the Linear/Log slider
1993         \item[Bezier:] the curve is Log
1994         \item[Scopes:] the curve is Log
1995 \end{description}
1996
1997 This diversity also leads to different visual results from Histogram Bezier or Videoscope.
1998
1999 When the color space and the bin size are the same, all of the values increment the indexed bins. But if we start from YUV type edits, the plugin will automatically do the conversion to RGB. When the color is the result of yuv $\rightarrow$ rgb float conversion, we go from 256 bins of YUV to 65536 bins of RGB Float and the results \textit{spread} if there are more bins than colors.  This is the same effect you see when you turn on \textit{smoothing} in the vectorscope histogram.
2000
2001 The \textit{total} pixels for each value is approximately the same, but the \textit{max} value depends on the color quantization.  More colors increment more bins.  Fewer colors increment fewer bins.  In both cases, the image size has the same number of pixels. So the pixels will distribute into more bins if you go to a higher depth color; those bins will have a lower count.  The fewer color case increments the used bins, and skips the unused bins.  This sums all of the pixels into fewer bins, and the bins have higher values. That is the \textit{rgb} vs \textit{yuv} case, fewer vs more bins are used. To get more consistent visual feedback (and on scopes), the concept of \textit{sum} was used instead of the maximum number of occurrences (max).
2002
2003 To report something more consistent, the reported value has been changed from the original code to be the \textit{sum} of the accumulated counts for the bins reporting a pixel bar on the
2004
2005 \begin{center}
2006         \begin{tabular}{clccr}
2007                 \hline
2008                 1 &  & & & \\
2009                 1 &  & & 1 & \\
2010                 000100 & 3 pixels & vs & 0011000& 3 pixels \\
2011                 \hline
2012         \end{tabular}
2013 \end{center}
2014
2015 On the left, the course color model piles all 3 pixels into one bin, max
2016 value 3.
2017 On the right, the fine color model puts the counts into 2 bins, max 2, sum 3.
2018
2019 So, by reporting the sum the shape of the results are more similar to Bezier.
2020
2021 \subsection{Histogram Bezier / Curves}%
2022 \label{sub:histogram_bezier_curves}
2023 \index{histogram Bezier}
2024
2025 Histogram Bézier allows an immediate view of the contrast amplitude of an image with its distribution of luma and colors values using a piecewise linear method (bins). In addition it uses a Bézier curve (parametric) on the histogram plot. When mapping color spaces, it has a variety of presentations to get smoother transitions and more pleasing output. It uses more general remapping, not just straight lines but more contour lines. Curves are perhaps the most powerful and sophisticated tool for color correction. For some repetitive details, see the previous description of the Histogram plugin. Histogram Bézier is keyframable. The scale is given in percent ($0 - 100\% \pm 10\%$). The default curve is Log type and can use either RGB or YUV sources without implementing conversions.
2026
2027 NOTE: Histogram Bezier may give results that are not congruent with Histogram plugin. To understand the difference in behavior see the Theory section in Histogram plugin.
2028
2029 The input graph is edited by adding and removing any number of points. Click and drag anywhere in the input graph to create a point and move it. Click on an existing point to make it active and move it. The active point is always indicated by being filled in. The active point's input X and output Y values are given in textboxes on top of the window. The input and output color of the point can be changed through these textboxes. Points can be deleted by first selecting a point and then dragging it to the other side of an adjacent point. They can also be deleted by selecting them and hitting delete (figure~\ref{fig:bezier}).
2030
2031 \begin{figure}[htpb]
2032     \centering
2033     \includegraphics[width=0.9\linewidth]{bezier.png}
2034     \caption{Histogram Bezier / Curves}
2035     \label{fig:bezier}
2036 \end{figure}
2037
2038 \begin{itemize}
2039     \item \textit{Master} (value) and \textit{R}, \textit{G}, \textit{B} histograms.
2040     \item Textbox for input $x$ (\textit{input}) and input $y$ (\textit{output}).
2041     \item \textit{Output min} and \textit{output max}: sets black or white points. If you use both points it works as Master/Color
2042     Offset. Values can also be less than $0$ and greater than $1.0$.
2043     \item Scale for \textit{contrast range}: sets with cursors shown as little triangles.
2044     \item \textit{Automatic} and \textit{Threshold}: enable the Automatic toggle to have the histogram calculate an automatic input transfer for the red, green, and blue but not the value. It does this by scaling the middle $99\%$ of the pixels to take $100\%$ of the histogram width. The number of pixels permitted to pass through is set by the Threshold textbox. A threshold of $0.99$ scales the input so $99\%$ of the pixels pass through. Smaller thresholds permit fewer pixels to pass through and make the output look more contrasty.
2045     \item \textit{Reset:} returns the four curves to their initial state (neutral).
2046     \item \textit{Split picture:} a checkbox that enables a diagonal split showing in the compositor.
2047     \item \textit{Interpolation:} type of algorithm for the parametric curves; linear, polynomial and Bezier.
2048 \end{itemize}
2049
2050 Curves are used by introducing \textit{control points} simply with
2051 the left mouse button and adjusting the value by dragging and
2052 dropping. If you drag along the horizontal line only, you change the
2053 value of $x$ and you can read this value in the input $x$
2054 textbox. If you drag along the vertical line only, you change the
2055 value of $y$ and you can read the value in the input $y$
2056 textbox. This is the output value. The newly clicked control point
2057 becomes active and is full green in color. To delete a point we have
2058 to make it active and then press the Del key, or we can drag the
2059 point beyond the position of another control point to its right or
2060 left or, finally, pressing RMB\@. The control points corresponding to
2061 the black point and the white point are automatically created from
2062 the beginning, to fix their values and prevent clipping.
2063
2064 Curves are generally adjusted by introducing several control points, some to be kept fixed (as anchors) to prevent curve modification beyond them, and others to be dragged to make the desired correction. The power of the curves lies in being able to circumscribe a small interval at will and intervene only on this without involving the remaining parts of the frame. The precision with which you can work is such that you can almost arrive at a secondary color correction.
2065
2066 The most used type of modification is to create a \textit{S curve}. There can be a lot of shapes that use the S curve; the simplest is to create a control point in the shadows, one in the midtones (anchors) and one in the highlights. Moving the highlight point upwards and the shadow point downwards increases the contrast, making the image sharper and improving the color rendering. With the type of \textit{linear} curve you can make hard adjustments, similar to the result of the use of \textit{Color 3 Way}, even if this acts on the color wheel (Hue) while the curves act on individual RGB channels.
2067
2068 The \textit{Polynomial} and \textit{Bézier} types introduce \textit{control handles} that allow for more sophisticated and smoother adjustments. The quality of the result is much better, but they require more experience for their optimal use. By varying the angle of the handles we change the \textit{tangent} and thus the slope of the curve below. Unlike true Bezier curves, there is no effect in extending the handles: there is no change in the radius of the curve. The difference between Polynomial and Bézier lies in the underlying mathematics, but for practical purposes the use is similar. By default Bézier starts with a slight S-curve, as opposed to Polynomial.
2069
2070 Some examples of the use of curves to demonstrate the variety of possible interventions (figure~\ref{fig:ex-bezier}):
2071
2072 \begin{figure}[htpb]
2073         \centering
2074         \includegraphics[width=0.8\linewidth]{ex-bezier.png}
2075         \caption{Gain Up/Down; clamp; S-Shaped curve and Luma Key}
2076         \label{fig:ex-bezier}
2077 \end{figure}
2078
2079 \begin{itemize}
2080     \item Scale the image values by increasing the white point or decreasing the white point (gain up and gain down).
2081         You can decide the scaling value with the formula: $(Input \div Output) = Scale Factor$
2082     \item Limit a value beyond a certain point of brightness (clamp to the value $0.587$ in the figure).
2083     \item S-shaped curve to increase contrast without changing the black and white point (i.e.\ without \textit{clipping}).
2084     \item Make a real \textit{Luma Key} by bringing a certain value of gray to $100\%$ (white) and lowering everything else to $0\%$ (black). The slope of the two sides indicates how much we want to fade the edges of the matte obtained.
2085 \end{itemize}
2086
2087 \subsection{HolographicTV}%
2088 \label{sub:holographictv}
2089 \index{holographicTV}
2090
2091 \begin{figure}[htpb]
2092         \centering
2093         \includegraphics[width=0.55\linewidth]{holographictv.png}
2094         \caption{Holographic messages in CinGG!}
2095         \label{fig:holographictv}
2096 \end{figure}
2097
2098 Incoming objects are projected like holovision seen in the movie Stars Wars as in R2-D2's video message projector of the Princess Leia (figure~\ref{fig:holographictv}). You need a movie or background image and above it a track containing the figure on which to apply the effect. This must have a transparent background. There are no configuration parameters; it only has to be applied to the upper track.
2099
2100 This effect originated from {\small \url{https://effectv.com}}.
2101
2102
2103 \subsection{Hue saturation}%
2104 \label{sub:hue_saturation}
2105 \index{hue saturation}
2106
2107 With this effect you can change hue, saturation and value. The parameters are modified using 3 simple sliders. For maximum precision you can use the input box. The \textit{hue} control shifts the colors circularly in the color plane, normally resulting in false colors. The \textit{saturation} control can be used to reduce color footage to black and white. The \textit{value} control makes any given colors more bright or more subdued. \textit{Clear} buttons are present to reset its slider to default without affecting others.
2108
2109 \subsection{Interpolate Bayer}%
2110 \label{sub:interpolate_bayer}
2111 \index{interpolate bayer}
2112
2113 Uses a Bayer filter algorithm to interpolate (estimate) missing color information. This is needed for some cameras where each pixel location only has an R or G or B value instead of all R, G, and B values for each location. The algorithm creates values for each of the three colors at every location by smearing (interpolating) each set of partial R, G and B values to create values at every pixel location.
2114
2115 \subsection{Interpolate Video}%
2116 \label{sub:interpolate_video}
2117 \index{interpolate video}
2118
2119 \subsubsection*{Theory}
2120 \label{ssub:theory}
2121
2122 Each video has its own framerate. If we want to change it (for \textit{timelapse} or \textit{slow motion}) the best thing is to shoot the scene with suitable framerate. But even in post production we can do something. The simplest method is to remove some frames to speed up the movie or add some to slow it down (from now on, for simplicity we will consider only the timelapse). Needless to say, the result is not smooth and the viewer will notice it immediately. A better method is to use the interpolation, mediating the pairs of frames that alternate. For example, if we have a sequence of frames $1, 2, 3, 4, 5, 6, 7, 8\dots$ we can make a timelapse mixing frames $1$ and $2$, $3$ and $4$, $5$ and $6$, $7$ and $8$ and so on. So we will have a new sequence of $4$ frames instead of the initial $8$: $\underline{12, 34, 56, 78}\dots$ We will get $50\%$ acceleration but it will always be of bad quality because of the too rough blending between the pairs of frames. Blending can be improved by weighing it differently by $50\% frame 1 + 50\% frame 2$, but the result is still unsatisfactory. Further improvements can be achieved by using $logarithmic$ or $exponential$ interpolation instead of $linear$ interpolation. But the most sophisticated methods that lead to better results are based on \textit{optical flow analysis}. These analyses the movement of circumscribed areas over a given period of time. With this method the intermediate frames do not derive from an approximate blending, but from the calculation of the \textit{vector} of the motion between two frames that determines the displacement (\textit{warping}) of the moving figure in the new intermediate frame. \textit{Interpolate Video} works this way.
2123
2124 \subsubsection*{Practice}
2125 \label{ssub:practice}
2126
2127 The practical use of \textit{Interpolate Video} is a little different than the theory. The interpolate effect tries to create the illusion of a higher frame rate from source footage of very low framerates by averaging frames over time. It averages two input frames for each output frame. You choose a zone to be evaluated (\textit{macroblock size}) and a radius (\textit{search radius}) where you can search for this macroblock in the following frames. The \textit{Use optic flow} button is activated and playback starts. The plugin will calculate the motion vector (which can be made visible by the \textit{draw motion vectors} button) and apply it to intermediate frames. This operation is CPU intensive. Once the analysis is done, we can scroll the video by unchecking the two buttons and obtaining the desired result. There are two ways of specifying the input frames. You can specify an input frame rate which is lower than the project frame rate (\textit{imput frames per seconds}). This causes input frames to be taken at even intervals. You can also specify keyframe locations as the positions of the input frames (\textit{use keyframes as input}). In this mode the output frame rate is used as the input frame rate and you just create keyframes wherever you want to specify an input frame.
2128
2129 \subsection{Inverse Telecine}%
2130 \label{sub:inverse_telecine}
2131 \index{inverse telecine}
2132
2133 This is the most effective deinterlacing tool when the footage is a video transfer of a film. This can be used to solve the problem, i.e., undo the damage caused by making film into a TV broadcast.
2134 That process came about because film is at 24\,\emph{fps} while TV is at 29.97\,\emph{fps} and fields are at 60.
2135 So the film was converted from 24\,\emph{fps} to 60\,\emph{fps}.
2136 Roughly speaking, converting every 4 frames into 5 frames plus a slight slow down in speed.
2137 Then the 60\,\emph{fps} was down-sampled to 30\,\emph{fps} by extracting odd and even lines and interlacing the lines.
2138 This process is referred to as \textit{three-two pull down} ($3:2$ pull down) in filmmaking and television production for the post production process of transferring film to video.
2139 The three-two pull down is where the telecine adds a third video field (a half frame) to every second video frame, but the untrained eye cannot see the addition of this extra video field.
2140 The \texttt{IVTC} effect is primarily a way to convert \textit{interlaced} video to \textit{progressive} video.
2141 It reverses the effect of three patterns of interlacing. In the next lines \texttt{A}, \texttt{B}, and \texttt{C} represent fields.
2142
2143 \texttt{A AB BC CD D}
2144
2145 \texttt{AB CD CD DE EF}
2146
2147 \texttt{Automatic}
2148
2149 The first two options are fixed patterns and affected by the pattern \textit{offset} and \textit{odd field first} parameters. The last option creates several combinations of lines for each frame and picks the most progressive combination. It is a brute force algorithm that is trying to resample the lines. This technique does not rely on a pattern like other techniques and is less destructive but the timing is going to be jittery because of the lack of a frame rate reduction. In order to smooth out the timing, you need to follow \textit{inverse telecine} with a \textit{decimate} effect.
2150
2151 \subsection{Invert Video}%
2152 \label{sub:invert_video}
2153 \index{invert video}
2154
2155 Invert video is a method of reversing the colors of a video track. The four parameters refer to channels -- \textit{Red}, \textit{Blue}, \textit{Green}, \textit{Alpha}. A very common use is to invert the alpha channel to change transparency.
2156
2157 \subsection{Lens}%
2158 \label{sub:lens}
2159 \index{lens}
2160
2161 Create the effect of looking through a lens.
2162
2163 \begin{description}
2164     \item[R, G, B, A Field of View:] quantity of deformation of the relative fields. Often used with \texttt{Lock} to simultaneously affect the 4 fields.
2165     \item[Aspect Ratio:] determines the aspect ratio that you intentionally set.
2166     \item[Radius:] radius of curvature of the distortion. At minimum, it is a sphere (\textit{fish eye}) and at maximum, it is a rectangle (no distortion).
2167     \item[Center X, Y:] determines the coordinates of the center of the sphere. It can be made visible with \textit{Draw Center}.
2168     \item[Mode:] determines the type of distortion. The choice is between \textit{sphere shrink}, \textit{sphere stretch}, \textit{rectilinear shrink} and \textit{rectlinear stretch}.
2169     \item[Interpolation] determines the interpolation algorithm; from the fastest and least precise \textit{Nearest}, passing through \textit{BiLinear} to the better \textit{BiCubic}.
2170 \end{description}
2171
2172 \subsection{Linear Blur}%
2173 \label{sub:linear_blur}
2174 \index{linear blur}
2175
2176 This effect acts only in one direction which can vary up to an angle of $180\degree$ with these parameters:
2177
2178 \begin{figure}[htpb]
2179         \centering
2180         \includegraphics[width=0.8\linewidth]{linear.png}
2181         \caption{For clarity of presentation only 2 fields are shown}
2182         \label{fig:linear}
2183 \end{figure}
2184
2185 \begin{description}
2186     \item[Length:] distance between original image and final blur step; corresponds to the distance of the fields.
2187     \item[Angle:] angle of motion in one direction for linear blur
2188     \item[Steps:] number of blur steps to be used in the calculation. Increasing the number takes more CPU.
2189     \item[Channels:] R,G,B,A.
2190     \item[Clear] With the Clear buttons we can bring the slider to default values without affecting the other parameters.
2191 \end{description}
2192
2193 For maximum precision you can use the input box.
2194 Figure~\ref{fig:linear} shown here has the parameters: $Length=19$, $Angle=25$, and $Steps=2$.
2195
2196 \subsection{Live Video}%
2197 \label{sub:live_video}
2198 \index{live video}
2199
2200 This effect reads video directly from the capture card input. It replaces any video on the track so it is normally applied to an empty track. Only one \textit{Live Video} effect can exist at any time on the timeline. It can not be shared by more than one track. 
2201 The configuration for the capture card is taken from the recording preferences. Go to \texttt{Settings $\rightarrow$ Preferences $\rightarrow$ Recording} to set up the capture card.
2202 There is a limitation when both Audio and Video use DV, in that you can not use this plugin at the same time as \textit{Live Audio}. 
2203
2204 In the \textit{Video In} section where it says \textit{Record driver}, it should be set to either \textit{Video4Linux2} or \textit{IEC 61883}. Other video drivers have not been tested with Live Video and probably will not work. For live video, the selection for \textit{File} Format and \textit{Video} needs to be set to a format the timeline can use. The file format must be Quicktime for Linux and video recording must be enabled for it. Click on the wrench to set the video compression.
2205
2206 The video compression depends on the recording driver. For the \textit{Video4Linux2} recording driver, the compression must be \textit{Motion JPEG A}. For the \textit{IEC 61883} driver, the compression must be \textit{DV}. This gets the driver to generate output in a color model that the timeline can use. Some cards provide color and channel settings. Live video takes the color settings from the values set in the Video In window. Go to \texttt{File $\rightarrow$ Record} to bring up the recording interface and the Video In window. Values set in the Video in window are used by Live Video. Any channels the capture card supports need to be configured in the Video In interface since the same channels are used by the Live Video effect.
2207
2208 With the video recording configured, highlight a horizontal region of a video track or define in and out points. Then drop the Live Video effect into it. Drop other effects after Live Video to process the live video in realtime. For best results, you should use OpenGL and a video card which supports GL shading language.  Go to \texttt{Settings $\rightarrow$ Preferences $\rightarrow$ Playback $\rightarrow$ Video Out} to enable the OpenGL driver which will make it possible to process video input in real time.
2209
2210 \subsection{Loop video}%
2211 \label{sub:loop_video}
2212 \index{loop video}
2213
2214 Sections of video can be looped by dropping a loop effect on them. Contrary to the \texttt{settings $\rightarrow$ loop playback} option, the loop effects can be rendered where the \texttt{settings $\rightarrow$ loop playback} option can not be. The loop effects are also convenient for short regions.
2215
2216 The loop effects have one option: the \textit{number of frames} or \textit{samples} to loop. This specifies the length of the region to loop starting from either the beginning of the effect or the latest keyframe. The region is replicated for the entire effect.
2217
2218 Every time a keyframe is set in a loop effect, the keyframe becomes the beginning of the region to loop. Setting several keyframes in succession causes several regions to loop. Setting a single keyframe causes the region after the keyframe to be looped throughout the effect, no matter where the keyframe is. The end of an effect can be looped from the beginning by setting the keyframe near the end.
2219
2220 \subsection{Mirror}%
2221 \label{sub:mirror}
2222 \index{Mirror}
2223
2224 The Mirror plugin splits the image along a line, an axis, and reflects one side onto the other.
2225 When the \texttt{Enable Reflection Center} option is checked you can move the position of this axis, using $X\%$ and/or $Y\%$ slider and/or textbox: $X\%$ for the horizontal position and $Y\%$ for the vertical position. Mainly in the Mirror effect there are 2 cases: with or without the \textit{Enable Reflection Center} checked.
2226
2227 \begin{figure}[htpb]
2228         \centering
2229         \includegraphics[width=0.7\linewidth]{mirror.png}
2230         \caption{Possible combinations with both Horizontal and Vertical checked}
2231         \label{fig:mirror}
2232 \end{figure}
2233
2234 When the \textit{Enable Reflection Center} option is UNCHECKED, the used reflection is on the center of the image (i.e. $X=50\%$, $Y=50\%$) and the options about \textit{Reflection Center}, $X\%$ and $Y\%$, are disabled (grayed).
2235 The Horizontal option reflects the left side of the image on the right. If the \texttt{Swap LEFT-RIGHT side} option is checked then the right side to the left will be reflected.
2236 The Vertical option reflects the top on the bottom. If the \texttt{Swap TOP-BOTTOM side} option is checked then the bottom to the top will be reflected.
2237 There are special combinations when both Horizontal and Vertical checkboxes are enabled (and\textit{ Enable Reflection Center} is always UNchecked, of course). You can see those combinations in the figure~\ref{fig:mirror}.
2238
2239 When the \textit{Enable Reflection Center} option is CHECKED the options about \textit{Reflection Center}, i.e. $X\%$ and $Y\%$, are enabled, and the two "Swap ... side" options are disabled and hidden. These two "Swap ... side" are disabled because the $X\%$ and $Y\%$ allow the swap side feature automatically. The $X\%$ and $Y\%$ positions move the center of the reflection to fit to the user's need.
2240
2241 \subsection{Motion51}%
2242 \label{sub:motion51}
2243 \index{Motion51}
2244
2245 Note: Motion and Motion51 plugins are complex and slow to use for video stabilization. If you are stabilizing an entire video, you may want to preprocess by using ffmpeg's \textit{vidstabdetect} and \textit{vidstabtransform} plugins before importing the video into \CGG{}.
2246
2247 This plugin compensates for unwanted motion and stabilizes the picture. The \textit{Motion51} Plugin simplifies motion stabilization so that without a lot of tweaking you can easily achieve reasonable results, either by using the defaults or varying a single parameter. Since the motion in every clip is specific, there are some additional parameters useful to adjust the settings accordingly. 
2248 The Motion51 plugin uses different methods for tracking than the other motion plugins. Motion Stabilization is very useful if you have jittery video, for example when taken from a car window, or while walking.
2249
2250 The better results require more samples. Setting the \textit{sample set size} is probably the most important setup change. Also, when computing motion compensation, the entire history of the image motion is important, and so it is desirable to enable the playback setting \textit{play every frame} in order to get good results. When every frame has to be processed, it can be time-consuming. Reasonable results are possible with small sample sets. After setup, the sample size can be increased to produce a high quality rendered result.
2251
2252 \subsubsection*{Description of what the program is doing}
2253 \label{ssub:description_program_doing}
2254
2255 The motion is detected by \textit{sampling} the video image in a circular field. This size and placement of the sample region defaults to most of the image area. When the \textit{draw vectors} feature is enabled, the outer line trace encloses the searched region. The dotted circles define the target pixel set as the reference sample. The image is sampled using the circle pattern in a grid search. The best match is used to find the center and amount of rotation to transform the current image so that the reference area motion is canceled.
2256
2257 The amount of sampling does not significantly change for smaller or larger search areas. This means that a wide area can be searched just as easily as smaller areas. The main parameter which determines how hard it looks at the image is the \textit{samples} parameter. It represents the number of possible rotations, as well as the search precision. More samples mean more precision, and less jitter, but the program will run more slowly (figure~\ref{fig:motion51}).
2258
2259 \begin{figure}[htpb]
2260     \centering
2261     \includegraphics[width=0.9\linewidth]{motion51.png}
2262     \caption{Motion51 plugin window with its default options set.}
2263     \label{fig:motion51}
2264 \end{figure}
2265
2266 The Samples box at the top is most often the only parameter that you may want to vary.
2267
2268 \subsubsection*{Program Parameters Description follows}
2269 \label{ssub:program_parameters_description}
2270
2271 \begin{description}
2272     \item[X11-OpenGL:] setting can speed up the computation significantly in some cases when hardware OpenGL is available.
2273     \item[Samples:] is the number of pixels which the software will examine to stabilize the picture. The sample set is arranged in 4 equal concentric circular sets. Each sample dot represents content and position for a pattern matching test. Setting the samples to larger values improves the match by adding lots of placement possibilities. The samples/pixels that will be utilized are distributed throughout the selected area -- this is seen within the circles drawn when Draw Vectors is enabled. See figure~\ref{fig:motion51}.
2274     \item[Draw vectors:] demonstrates the search operation of motion stabilization. When enabled, the outer search boundary (oval), the search grid area (rectangle), and the reference sample (circles) are visible. 4 concentric circles show the reference sample set (target). You will also see an arrow in the center of the circle which shows each image displacement from frame to frame. When you render the video using the motion plugin, these dots/lines/circles are drawn into the rendered output. Draw vectors helps to visualize the meaning of the parameters to aid in setup. You should disable Draw Vectors before the final rendering.
2275     \item[Sample Radius:] is the radius of a circle that denotes the area of the sample locations. It is expressed as a percentage of the smallest image edge. For example, if it is set to $50\%$, then the circle will overlap about $\frac{1}{2}$ of the image. This does not change the number of samples. It does change the area from where the samples are gathered. If you have Draw vectors on, you can see the faint outline of a circle used for the radius.
2276     \item[Center X/Y:] is the center position of the sample circle, as a percentage of image width and height.
2277     This is useful to reset the reference focal point in cases where the important feature target is off-center.
2278     When both $X$ and $Y$ are set to $50\%$, the samples will be used from around the center of the video.
2279     \item[Search W/H:] determines the width and height of the rectangular area used for the grid pattern search. Samples are taken by moving the center of the circles in a grid pattern.
2280     \item[Horiz/Vert shake limit:] (Shaking refers to image translation) determines translation constraints. If the motion determined by the search exceeds the limit, it is clipped to a value that is at the limit boundary. For example, if the match indicates that the motion is $60\%$ off the reference target, but the limit is $50\%$, then the actual translation used will be limited to only $50\%$.
2281     \item[Shake fade:] determines how fast the translation cancellation fades away, and the image resettles to its actual appearance. Every frame that is processed accumulates the motion of the past. The amount of the past motion which is applied is reduced by the fading factor. The current match is then added to the fading past motion history. Fading works fast. It is applied every frame. So if fade is $10\%$, and no new motion occurs in the input, the history will be $90\%, 81\%, 73\%, 66\%\dots$ and in $30$ frames only $4.2\%$ of the past motion will be present in the effect. Fading insures that the image will eventually settle re-centered when the image motion ends.
2282     \item[Twist limit:] (Twisting refers to image rotation) determines the rotation constraints. If the rotation determined by the search exceeds the limit, it is clipped to the limit boundary. Its operation is similar to the shake limits.
2283     \item[Twist fade:] determines how fast the rotation cancellation fades away, and the image resettles to its actual appearance. Its operation is similar to the shake fade.
2284     \item[Enable Tracking:] caches the search results in a file so that subsequent playback does not have to be recalculated. When tracking is enabled, before a frame is processed the frame number is used to look for cached results. If cache data is available, it is used. If no data is available, the frame is processed by the motion tracking search, and the results are added to the cache file. If tracking is not enabled, the data is always sourced from the motion tracking search and the tracking file is not updated.
2285     \item[Tracking file:] is the name of the file which will contain the calculated values to be saved. Note that the default is \texttt{/tmp/motion51} which can be hazardous, since a system crash or a reboot can delete \texttt{/tmp} files.
2286     \item[Reset Defaults:] button is used to revert to the initial defaults built into the program.
2287     \item[Reset Tracking:] will delete the current Tracking file and disables tracking so that any previously calculated values are no longer available. However, because motion stabilization can often be cpu intensive, if the default file already exists, it will create a file name from the loaded asset.
2288     \item[Play Every Frame:] shows if you are Currently using: Play every frame. For best results, set play every frame. This can be set in \texttt{Settings $\rightarrow$ Preferences $\rightarrow$ Playback A} Tab in the \textit{Video out} section.
2289 \end{description}
2290
2291 \subsection{Motion}%
2292 \label{sub:motion}
2293 \index{Motion}
2294
2295 Note: Motion and Motion51 plugins are complex and slow to use for video stabilization. If you are stabilizing an entire video, you may want to preprocess by using ffmpeg's \textit{vidstabdetect} and \textit{vidstabtransform} plugins before importing the video into \CGG{}.
2296
2297 The \textit{motion tracker} is almost a complete application in itself. The motion tracker tracks two types of motion: \textit{translation} and \textit{rotation}. It can track both simultaneously or one only. It can do $\frac{1}{4}$ pixel tracking or single pixel tracking. It can stabilize motion or cause one track to follow the motion of another track. Although the motion tracker is applied as a realtime effect, it usually must be rendered to see useful results. The effect takes a long time to precisely detect motion so it is very slow.
2298
2299 Motion tracker works by using one region of the frame as the region to track (Match Box). It compares this region between $2$ frames to calculate the motion. This region can be defined anywhere on the screen. Once the motion between $2$ frames has been calculated, a number of things can be done with that \textit{motion vector}. It can be scaled by a user value and clamped to a maximum range. It can be thrown away or accumulated with all the motion vectors leading up to the current position.
2300
2301 To save time the motion result can be saved in a file for later reuse, recalled from a previous calculation, or discarded. The motion tracker has a notion of $2$ tracks, the \textit{master} layer and the \textit{target} layer. The \textit{master} layer is where the comparison between $2$ frames takes place. The \textit{target} layer is where motion is applied either to track or compensate for the motion in the \textit{master} layer (figure~\ref{fig:motion}).
2302
2303 \begin{figure}[ht]
2304         \centering
2305         \includegraphics[width=0.99\linewidth]{motion.png}
2306         \caption{Motion plugin GUI}
2307         \label{fig:motion}
2308 \end{figure}
2309
2310 Motion tracking parameters\protect\footnote{credit Georgy (sge)}:
2311
2312 \begin{description}
2313     \item[Track translation] Enables translation operations. The motion tracker tracks $X$ and $Y$ motion in the \textit{master} layer and adjusts $X$ and $Y$ motion in the \textit{target} layer.
2314
2315     \item[Translation block size] For the translation operations, a block is compared to a number of neighboring blocks to find the one with the least difference. The size of the Match Box to search for is given by this parameter.
2316     \item[Translation search radius] The size of the area to scan for the translation block.
2317     \item[Translation search steps] Ideally the search operation would compare the translation block with every other pixel in the \textit{Translation search radius}. To speed this operation up, a subset of the total positions is searched. Then the search area is narrowed and re-scanned by the same number of search steps until the motion is known to $\frac{1}{4}$ pixel accuracy.
2318     \item[Translation direction] Tracking translation is possible in any direction, or in horizontal or vertical direction only, depending on this selection.
2319     \item[Block X, Y] These coordinates determine the center of the translation block based on percentages of the width and height of the image. The center of the block should be part of the image which is visible at all times.
2320     \item[Maximum absolute offset] The amount of motion detected by the motion tracker is unlimited if this is $100$. If it is under $100$ the amount of motion is limited by that percentage of the image size.
2321     \item[Motion settling speed] The motion detected between every frame can be accumulated to form an absolute motion vector. Settling speed determines how fast the accumulated translation fades away, and the image resettles to its actual appearance. If the settling speed is 0\% the total absolute vector is added to the next frame. So every frame that is processed accumulates the whole motion of the past. If the settling speed is 100\% the absolute vector is cancelled completely, adding no past translation to the next frame. If the settling speed is intermediate between 0\% and 100\% the absolute vector is downscaled by (100 $-$ settling amount) before being added to the next frame.
2322     \item[Track rotation] Enables rotation operations. The motion tracker tracks rotation in the \textit{master} layer and adjusts rotation in the \textit{target} layer.    
2323     \item[Rotation search radius] This is the maximum angle of rotation from the starting frame the rotation scanner can detect. The rotation scan is from this angle counterclockwise to this angle clockwise. Thus the \textit{Rotation search radius} is half the total range scanned.
2324     \item[Rotation search steps] Ideally every possible angle would be tested to get the rotation. To speed up the rotation search, the \textit{Rotation search radius} is divided into a finite number of angles and only those angles compared to the starting frame. Then the search radius is narrowed and an equal number of angles is compared in the smaller radius until the highest possible accuracy is achieved. Normally you need one search step for every degree scanned. Since the rotation scanner scans the \textit{Rotation search radius} in two directions, you need two steps for every degree in the search radius to search the complete range.
2325     \item[Rotation center] Usually this parameter is zero, and the rotation search
2326     range is $+/-$ \textit{Rotation search radius}.  Otherwise, it shifts the rotation search range to the area of angles between (\textit{Rotation center} $-$ \textit{Rotation search radius}) and (\textit{Rotation center} $+$ \textit{Rotation search radius}).
2327     \item[Maximum angle offset] The total accumulated amount of rotation is unlimited
2328     if this is 90 degrees.  If it is under 90, the total amount of rotation is
2329     limited by the given maximum angle.
2330     \item[Rotation settling speed] This parameter determines how fast the accumulated
2331     rotation fades away.  Analogously to the \textit{Motion settling speed}, if it is 0\%,
2332     the total accumulated rotation is added to the next frame, and every frame
2333     accumulates the whole rotation of the past.  If the settling speed is 100\%,
2334     no past rotation is added to the next frame.  If the settling speed is
2335     intermediate between 0\% and 100\%, the amount of accumulated rotation is
2336     downscaled by (100 $-$ settling amount) before being added to the next frame.
2337     \item[Motion noise level] This parameter allows to compensate such undesirable
2338     behavior when motion tracker wildly springs away because some outlying area
2339     of a noisy picture becomes accidentally more "similar" to the reference
2340     picture than the right one.  If noise level is set to 0\% (its normal value),
2341     then it is not taken into account at all.  When it is set to 100\%, then
2342     similarity of the match block contents is totally ignored, and the current
2343     motion vector will be zero.  An intermediate value between 0\% and 100\%
2344     defines the proportional noise level between minimum and maximum difference
2345     of all examined match block positions.  From all such positions whose
2346     difference is found below noise level, that one is chosen which has the
2347     shortest translation relative to the reference frame.
2348     \item[Rotation noise level] This parameter has similar meaning to the \textit{Motion noise level}.  It influences rotation tracking.  If set to 0\% (its normal value),
2349     it is not taken into account.  The 100\% setting completely suppresses
2350     rotation detection.  An intermediate value between 0\% and 100\% defines the
2351     proportional noise level between minimum and maximum difference of all
2352     examined rotated match blocks from that of the reference picture.  From all
2353     rotation angles whose match block differences are found below noise level,
2354     that one is chosen which has the minimum rotation angle relative to the
2355     reference frame.    
2356     \item[Draw vectors] When translation is enabled, $2$ boxes are drawn on the frame. One box represents the translation block. Another box outside the translation block represents the extent of the \textit{Translation search radius}. In the center of these boxes is an arrow showing the translation between the $2$ master frames. When rotation is enabled, a single box the size of the rotation block is drawn rotated by the amount of rotation detected.
2357     \item[Two pass tracking] Although this parameter can be enabled at any time, it is useful only while simultaneous tracking both translation and rotation, when
2358     the rotation amount is large.  The normal tracking algorithm firstly
2359     examines translation, then rotation.  However, comparison of a strongly
2360     tilted picture with the reference one can lead to rather inaccurate
2361     determination of the translation vector.  The subsequent determination of
2362     rotation will be also inexact because of the preceding translation error.  The
2363     second tracking pass, if enabled, refines translation and rotation.
2364     
2365     If motion and/or rotation noise level is set above 0\% and \textit{Two pass tracking}
2366     is enabled, then both noise levels affect the first tracking pass only.
2367     During the second tracking pass of two pass tracking both noise levels are
2368     ignored.
2369     
2370     It should be noted that two pass tracking is not twice slower than the usual
2371     single pass tracking.  Actually it is only about 40\% slower.  As the second
2372     pass serves only for motion refinement, it starts from the reduced search
2373     range for block positions and rotation angles.  And, as the first pass only
2374     yields an approximate position, which will be later refined during the
2375     second pass, it skips subpixel position search and examines rotation angles
2376     with the accuracy reduced to 1 degree.
2377     \item[Track single frame] When this option is used the motion between a single
2378     starting frame and the frame currently under the insertion point is
2379     calculated.  The starting frame is specified in the \textit{Frame number} box.  The
2380     motion calculated this way is taken as the absolute motion vector.  The
2381     absolute motion vector for each frame replaces the absolute motion vector
2382     for the previous frame.  \textit{Settling speed} has no effect on it since it does
2383     not contain any previous motion vectors.  Playback can start anywhere on the
2384     timeline since there is no dependence on previous results.  We talk about
2385     \textit{Keep shape} and it is the most precise way to calculate the motion vector;
2386     but it only works well when the object to be traced does not change along
2387     the clip, remaining identical in shape, size and luminance.
2388     
2389     Strong rotation of the picture can also have a bad impact on the tracking
2390     accuracy.  If it is the case, accuracy can be significantly improved by
2391     enabling \textit{Two pass tracking}.
2392     
2393     \item[Frame number] The number of the reference frame used for motion tracking in
2394     the \textit{Track single frame} mode is specified in this input field.  Frame
2395     number is set as the 0-based absolute number starting from the very
2396     beginning of the whole timeline.  Instead of manual calculating, it is
2397     possible to get \textit{Frame number} directly from the current cursor position by
2398     pressing the \textit{Get current} button.
2399     
2400     \item[Get current] Pressing this handy button provides a convenient way to set the
2401     \textit{Frame number} parameter to the value of the current cursor position.
2402     
2403     \item[Add (loaded) offset from tracked frame] This toggle can help when the tracked
2404     object changes shape, leaves the screen area or becomes obscured by other
2405     objects somewhere in the middle of the \textit{Motion} effect.  Sometimes it can help
2406     also if a strong rotation causes the motion tracker to miss the right
2407     tracked object and wildly spring away.
2408     
2409     To overcome this problem, one has to define two keyframes: the first one at
2410     the start of the \textit{Motion} effect, the second shortly before the problematic
2411     location in the clip.  At the first keyframe one defines the \textit{Motion} effect
2412     parameters as usual, the \textit{Add offset} toggle being switched off.  At the
2413     second keyframe the match block can be redefined to cover another region of
2414     the picture which remains visible during the following part of the effect.
2415     The \textit{Frame number} parameter should be set several frames before position of this second keyframe, and the \textit{Add offset} toggle switched on.
2416     
2417     After defining the two keyframes (even more can be added in the similar way)
2418     one switches at all the defined keyframes \textit{Calculation} mode to \textit{Save coords
2419     to tracking file}, \textit{Action} mode to \textit{Do Nothing}, rewinds the timeline cursor
2420     to the beginning of the \textit{Motion} effect, and starts playback.  The determined
2421     motion vectors will be written to the tracking file, the \textit{Add offset}
2422     parameter having no effect during the \textit{save} stage.
2423     
2424     After playback finishes and all the relevant motion vectors are saved in the
2425     tracking file, one switches at all the defined keyframes \textit{Calculation} mode to
2426     \textit{Load coords from tracking file}, \textit{Action} mode to whatever one needs, rewinds again to the beginning of the \textit{Motion} effect and starts playback or
2427     rendering.  After reaching the second keyframe, where \textit{Add offset} was
2428     switched on, the program continues to follow the second object adding the
2429     total motion and rotation, accumulated so far.
2430     
2431     Of course, the \textit{Add offset} toggle can be used in the \textit{Track single frame} mode only.  In the other tracking modi such a technics is unnecessary.
2432     \item[Track previous frame] Causes only the motion between the previous frame and
2433     the current frame to be calculated (\textit{Follow shape}).  This is added to an
2434     absolute motion vector to get the new motion from the start of the sequence
2435     to the current position.  After every frame processed this way, the block
2436     position is shifted to always cover the same region of the image.  Playback
2437     must be started from the start of the \textit{Motion} effect in order to accumulate
2438     all the necessary motion vectors.  This method is less precise because you
2439     have error propagation between frames.  However, it is essential when the
2440     object changes shape, size or luminance.  Possible inaccuracies caused by
2441     rotation of the picture can partly be reduced by enabling \textit{Two pass tracking}
2442     \item[Previous frame same block] This is useful for stabilizing jerky camcorder footage. In this mode the motion between the previous frame and the current frame is calculated. Instead of adjusting the block position to reflect the new location of the image, like \textit{Track Previous Frame} does, the block position is unchanged between each frame. Thus a new region is compared for each frame.
2443     \item[Master layer] This determines the track which supplies the frames for the
2444     motion calculation.  If it is \textit{Bottom} the bottom track of all the tracks
2445     sharing this effect is the \textit{master} layer.  Then the top track of all the
2446     tracks is the \textit{target} layer.  And vice versa, if the \textit{master} layer is \textit{Top},
2447     then the \textit{target} layer is bottom.
2448     \item[Calculation] This determines whether to calculate the motion at all and
2449     whether to save it to disk.  If it is \textit{Don't Calculate} the motion calculation is skipped.  If it is \textit{Recalculate} the motion calculation is performed every  time each frame is rendered.  If it is \textit{Load coords from tracking file}, the motion vectors are loaded  from a previous \textit{save} calculation.  If the previous \textit{save} calculation does not provide the data for the currently processed frames, a new motion  calculation is performed for that frames.  If \textit{Calculation} mode is \textit{Save coords to tracking file} the motion vectors can be still loaded from disk if the previously
2450     calculated data exist.  Otherwise, a new motion calculation is performed,
2451     and the calculated motion vectors are saved.
2452     \item[Tracking file] This parameter determines the name of the file where the
2453     motion data are saved and/or loaded from.  By default it is \texttt{/tmp/motion}
2454     but it can have any name and reside anywhere on the disk.  \textit{Tracking file} is
2455     a text file where each line contains four numbers: the absolute frame number
2456     (0-based integer), the X and Y translation displacements of subpixel
2457     precision (a subpixel is $\frac{1}{4}$ pixel in size, and to give integer values of X and Y these subpixel coords are multiplied by 4), and the rotation angle in
2458     degrees (as a floating point value).  The user may have different tracking
2459     files for different timeline regions, it is possible to do any manipulations
2460     on them if necessary and even manually edit in a text editor.
2461     \item[Generate tracking file name] This handy pushbutton suggests a tracking file
2462     name based on the name of the current asset.  It helps to maintain more
2463     different tracking files with unique but predictable names used in the same
2464     project.  When tracking file name is changed (either via the pushbutton or
2465     after entering it in the corresponding input field), the contents of that
2466     files (both the old and the new ones) remains unchanged.
2467     \item[Clear tracking file contents] The values and meaning of the saved motion data depend on such a bunch of parameters, they can be even edited manually, so
2468     one can hardly predict whether the outdated motion vectors are to be reset
2469     or left untouched.  Therefore the existing motion data are never altered
2470     implicitly (only newly calculated data may be added).  And, should the user
2471     need to reset them here and right now, it is possible to clear the given
2472     tracking file contents explicitly by pressing this pushbutton.
2473     
2474     As protection against accident clearing tracking file contents, right before
2475     clearing the program ensures closing the current tracking file and renames
2476     it to the same name with the suffix \texttt{.old}.  This way, the user can undo an erroneous clearing action by manual restoring the saved file.
2477     \item[Action] Once the motion vector is known this determines whether to move the \textit{target} layer opposing the motion vector or following the motion vector. If it is \textit{Do Nothing} the \textit{target} layer is untouched. If it is \textit{Track\dots} the \textit{target} layer is moved by the same amount as the \textit{master} layer. This is useful for matching titles to objects in the frame. If it is \textit{Stabilize\dots} the \textit{target} layer is moved opposite to the motion vector. This is useful for stabilizing an object in the frame. The \textit{Motion} operations can be accurate to single pixels or subpixels by changing the \textit{Action} setting.
2478 \end{description}
2479
2480 As motion tracking works consistently only in the \textit{Play every frame} mode,
2481 the corresponding info on the current playback mode is shown in the bottom
2482 right edge of the effect dialog.  The needed playback mode is defined in the
2483 Preferences dialog of \CGG{} main window.
2484
2485 \subsubsection*{Secrets of motion tracking}
2486 \label{ssub:secrets_motion_tracking}
2487
2488 Since it is a very slow effect, there is a method to applying the motion tracker to get the most out of it. First disable playback for the track to do motion tracking on. Then drop the effect on a region of video with some motion to track. Then rewind the insertion point to the start of the region. Set \textit{Action $\rightarrow$ Do Nothing}; set \textit{Calculation $\rightarrow$ Don't calculate}; enable \textit{Draw vectors}. Then enable playback of the track to see the motion tracking areas.
2489
2490 Enable which of translation motion or rotation motion vectors you want to track. By watching the compositor window and adjusting the \textit{Block X, Y} settings, center the block on the part of the image you want to track. It is advisable to choose elements that have evident edges in the $x$ and $y$ directions because the calculations are made on these coordinates. Then set \textit{search radius}, \textit{block size} and \textit{block coordinates} for translation and rotation.
2491
2492 Once this is configured, set \textit{Calculation} to \textit{Save coords} and do test runs through the sequence to see if the motion tracker works and to save the motion vectors. Next, disable \textit{Draw vectors}, set the motion \textit{Action} to perform on the \textit{target} layer and change \textit{Calculation} to \textit{Load coords}.
2493
2494 When using a single starting frame to calculate the motion of a sequence (\textit{Keep Shape}), the starting frame should be a single frame with the least motion to any of the other frames. This is rarely frame $0$. Usually it is a frame near the middle of the sequence. This way the search radius need only reach halfway to the full extent of the motion in the sequence. The suitable reference frame number can be defined conveniently via the \textit{Get current} pushbutton.
2495
2496 Summarizing:
2497
2498 \begin{enumerate}
2499         \item In the Master Layer create and save the tracking file:
2500         \begin{itemize}
2501                 \item \textit{Draw vectors}: checked
2502                 \item \textit{Action}: Do Nothing
2503                 \item \textit{Calculation}: Save coords to Tracking File
2504         \end{itemize}
2505         \item Clone the track, which becomes the Target Layer. The \textit{Motion} plugin will also be copied.
2506                 \begin{itemize}
2507                         \item \textit{Draw vectors}: unchecked
2508                         \item \textit{Action}: Do Nothing
2509                         \item \textit{Calculation}: Load coords from Tracking File
2510                 \end{itemize}
2511         \item Add a third track to place the video of the object to be superimposed. Add the shared effects of the \textit{Motion} plugin taken from the Master Layer.
2512                 \begin{itemize}
2513                         \item \textit{Draw vectors}: unchecked
2514                         \item \textit{Action}: Track Subpixel
2515                         \item \textit{Calculation}: Load coords from Tracking File
2516                 \end{itemize}
2517 \end{enumerate}
2518
2519 If the motion tracker is used on a render farm, \textit{Save coords} and \textit{Previous frame} mode will not work. The results of the \textit{Save coords} operation are saved to the hard drives on the render nodes, not the master node. Future rendering operations on these nodes will process different frames and read the wrong coordinates from the node filesystems. The fact that render nodes only visualize a portion of the timeline also prevents \textit{Previous frame} from working since it depends on calculating an absolute motion vector starting on frame $0$.
2520
2521 \subsubsection*{2 step motion tracking}
2522 \label{ssub:2_step_motion_tracking}
2523
2524 The method described above is \textit{two-step motion tracking}. One step is used just to calculate the motion vectors. A second step is used to apply the motion vectors to the footage. This is faster than a single pass because errors in the motion vector calculation can be discovered quickly. This also allows the motion tracking to use a less demanding colormodel like \textit{RGB888} in the scanning step and a more demanding colormodel like \textit{RGB Float} in the action step. The scanning step takes much longer than action. This has the disadvantage of not being practical for extremely long sequences where some error is acceptable and the picture quality is low to begin with, like stabilizing camcorder footage.
2525
2526 The slower method is to calculate the motion vectors and apply them simultaneously. This method can use one track as the motion vector calculation track and another track as the target track for motion vector actions. This is useful for long sequences where some error is acceptable.
2527
2528 \subsubsection*{Pre-processing the shot}
2529 \label{ssub:pre_processing_shot}
2530
2531 \begin{enumerate}
2532     \item The \textit{Motion} plugin uses \textit{luminance} to do its own calculations, so we can edit the clip to enhance contrast and make it easier to calculate motion vectors. You can even create a copy of the monochrome clip and optimize it for the plugin. It lengthens the time but minimizes errors. The saved file can then be used for the original clip.
2533     \item  Correct lens distortion, especially if the object to be tracked moves to the edges of the frame.
2534     \item Study the entire shot well: if necessary, divide it into many edits, each with its own \textit{Motion} plugin. For example, if the object to be tracked leaves the frame or is covered by some other element or changes in shape, size or rotation. You can try to use the \textit{Offset Tracking} technique described below.
2535 \end{enumerate}
2536
2537 \subsubsection*{Using blur to improve motion tracking}
2538 \label{ssub:blur_improve_motion_tracking}
2539
2540 With extremely noisy or interlaced footage, applying a blur effect before the motion tracking can improve accuracy. Either save the motion vectors in a tracking pass and disable the blur for the action pass or apply the blur just to the \textit{master} layer. You can even use a copy of the track formed only by the channels of Red + Green, because the channel of Blue is the noisiest. Another trick is to enlarge the Match Box to minimize the effect of noise.
2541
2542 \subsubsection*{Using histogram to improve motion tracking}
2543 \label{ssub:histogram_improve_motion_tracking}
2544
2545 A histogram is almost always applied before motion tracking to clamp out noise in the darker pixels. Either save the motion vectors in a tracking pass and disable the histogram for the action pass or apply the histogram just to the \textit{master} layer. Finally, you can use the histogram to increase contrast.
2546
2547 \subsubsection*{Using two pass tracking to improve accuracy and stability}
2548 \label{ssub:two_pass_improve_accuracy}
2549
2550 A common source of inaccuracy when tracking single frame is rotation of the
2551 picture.  Ideally, the motion vectors should be determined by checking all
2552 possible rotation angles at every possible match block location.  But such
2553 an algorithm would be unacceptably slow.  Therefore the program finds for
2554 each frame the translation vector first, and then the rotation angle.  A
2555 strong rotation can prevent motion tracker from finding accurate translation
2556 displacements.  Then the subsequent rotation search will be also inaccurate
2557 because translation has been estimated not sufficiently well.  In the \textit{Two
2558 pass tracking} algorithm the first, coarse estimation of translation and
2559 rotation is followed by the second, refinement pass yielding more exact
2560 motion vectors.
2561
2562 Sometimes, particularly if the amount of rotation is large, the translation
2563 tracker can lose its right object and wildly spring away.  Then the
2564 following strategy may help.
2565
2566 Firstly switch \textit{Two pass tracking} off, \textit{Track rotation} off, set \textit{Motion noise level} to zero.  Switch \textit{Draw vectors} on, \textit{Action: Do Nothing}, \textit{Calculation: Save coords to tracking file}.  Start playback and watch if the motion tracker has problems finding the right displacements (you can also examine the tracking file afterwards on the existence of discontinuities in coordinates).  If there are such, try to increase \textit{Motion noise level}, let's say, to 10\% or 20\%, \textit{clear tracking file contents}, repeat playback and look if tracker does not spring away any more.  A single pass translation tracking can be relatively fast, while tracking rotation is expensive.
2567
2568 When a sufficient motion noise level is found, switch \textit{Track rotation} on, \textit{Two
2569 pass tracking} on, \textit{clear tracking file contents} and perform the complete
2570 translation + rotation tracking pass.  As the refinement pass uses
2571 restricted search area and ignores the noise level parameters, the result
2572 should be more stable and accurate.
2573
2574 \subsubsection*{Possible sources of errors}
2575 \label{ssub:possible_sources_errors}
2576
2577 \begin{description}
2578     \item[Search radius too small:] the traced object moves too fast with respect to the size of the search box set.
2579     \item[Search radius too large:] The search box is so large that it also collects other similar items in the frame.
2580     \item[Occlusions:] the traced object is temporarily hidden by some other element. \textit{Offset tracking} or splitting of the video into several homogeneous clips is required.
2581     \item[Focus change:] you may get errors if the object changes its focus. The video must be divided into several homogeneous clips.
2582     \item[Motion Blur:] blurs the object making the calculation of the motion vector less precise. Very little can be done.
2583     \item[Shape change:] you can use \textit{Track previous frame} or the subdivision of the video in more homogeneous clips.
2584     \item[Lighting change:] Contrast change can produce errors. \textit{Track previous frame} or color correction can be used to return to the initial illumination.
2585 \end{description}
2586
2587 \subsubsection*{Tracking stabilization in action}
2588 \label{ssub:tracking_stabilization_action}
2589
2590 This is an explanation of how to stabilize a video as in the case of a video taken from a vehicle.
2591
2592 First select on the timeline the part of the footage you want to stabilize, using the in and out points. Then apply the \textit{Motion} effect on that part of the video. Select the \textit{Previous frame same block} option. That option is recommended for stabilizing jerky camcorder footage. Its goal is not to \textit{follow} an object. The block stays exactly at the same place during all the effect length.
2593
2594 Enlarge the block and select almost half the size of the video. Select the \textit{Stabilize subpixel} option as it will give a finer stabilization. Reduce the \textit{Maximum absolute offset} value to limit the stabilization amplitude. You probably prefer to get a non-perfect stabilization on some places on the video rather than having a very large black border on one side of the picture during big shakes. Set the \textit{Translation search steps} value to $128$. Increasing that value will not give a better result and only considerably increases the rendering time. Make sure the \textit{Draw vectors} option is selected, and render the part of the video where the \textit{Motion} effect is applied.
2595
2596 If the result is good, deselect the \textit{Draw vectors} option so that the block and vectors are not drawn anymore on the video. Then, render your video to a \texttt{.dv} file, and import it into your project. You will notice the video is stabilized but there are black borders which appear on sides of the frame. You have to \textit{zoom in} and define projector keyframes to move the projector around the screen, in order to remove those black borders. The more your footage is jerky, the more you have to zoom in to discard the black borders. That is why the result is better with HDV footage than with DV footage.
2597
2598 An interesting side note about \textit{Add offset} usage is explained next\protect\footnote{credit Pierre Marc Dumuid}
2599
2600 To stabilize video, the \textit{Motion} plugin uses a \textit{tracking frame} to which to track to and a region within that frame to track (generally an object in the background) in the current frame.  When the region is obscured, often by something in the foreground or by leaving the screen, then the motion compensation would fail, and the video jumps all over the place.
2601
2602 You set a second region to track, and then \textit{add offset}.
2603
2604 This shows how it is used.  It works very well:
2605
2606 \begin{verbatim}
2607 ------k-------k-----------------
2608 ^      ^^
2609 A      BC
2610
2611 A - object1 is visible in the background up until C
2612 B - (the frame before C) has both object1 and object2 visible
2613 C - has only object2 visible
2614 \end{verbatim}
2615
2616 \begin{enumerate}
2617     \item Make a keyframe and set to track object1.
2618     \item Make a keyframe at C and track frame at B, set to track object2.
2619     \item Set keyframe at C to add offsets that were calculated at B.
2620 \end{enumerate}
2621
2622 \subsubsection*{Tips}
2623 \label{ssub:tips}
2624
2625 \begin{enumerate}
2626     \item Motion plugin\protect\footnote{Thanks to Georgy} algorithm in \CGG{} is rather difficult to understand (the most efficient way to understand it is to look inside its C++ code:). Moreover, it has some tricks that, although can be derived knowing the details of the algorithm, are absolutely non-intuitive by themselves. Moreover, it is rather slow, and the results cannot be visible immediately while altering the settings.
2627     \item The Motion plugin \textit{cache} (or\textit{ motion vector} or \textit{tracking file}) sometimes allows to play with very sophisticated techniques. For example, by editing the cache, perhaps with some custom script, you can induce some kind of motion which would be difficult to make in other way. But in the same time the existence of the cache file can trigger user's mistakes. So you must always pay attention, which cache file may be used in the moment. //
2628     Motion's cache data are absolute-frame-number based. If you insert some small piece of video before that where the plugin was attached, the frame numbers get displaced relative to the cached numbers, and the result may become incorrectly stabilized.
2629     \item The motion vector is a text file located in \texttt{/tmp}. We can open it with a plain editor and modify the wrong $X\,Y$ coordinates, i.e.\ those that deviate from the linearity, to correct the errors that always happen when we perform a motion tracking (jumps). It can be a long and tedious job, but it leads to good results.
2630     \item It is not possible to switch Motion cache off. While working, \textit{Motion} always looks in its cache. If it contains some data assigned to the current frame numbers, that cached data will be used unconditionally. If not, that data will be calculated, stored in the cache, and later reused, also unconditionally.
2631     \item In the Motion plugin dialog there is a button \texttt{Clear tracking file contents}. When in doubt, you can press this button, the cached data will be erased and fresh recalculated on the next pass.
2632     \item It is quite usual to wish independent caches for different parts of video. It is possible to set such distinct cache file names (either manually, or let software generate them with \texttt{Generate tracking file name}). When you generate new names, the plugin automatically switches Calculation off, just for security. You switch it on again when needed.
2633     \item If \texttt{play track} is switched off for the track where the Motion plugin was attached, the plugin will calculate nothing. Also, if \texttt{Play every frame} was not active in \texttt{Preferences}, some video frames can get skipped from processing.
2634     \item You can try tracking using reverse playback of the track. Sometimes it may lead to a better calculation.
2635 \end{enumerate}
2636
2637 \subsection{Motion 2 Point}%
2638 \label{sub:motion_2_point}
2639 \index{Motion 2 Point}
2640
2641 Motion plugin using 2 \textit{Match box} for tracking. For theory and explanations refer to the \hyperref[sub:motion]{Motion} plugin.
2642
2643 \subsection{Motion Blur}%
2644 \label{sub:motion_blur}
2645 \index{Motion Blur}
2646
2647 Uses X/Y camera automation vectors to apply a linear blur trailing camera direction due to movement.
2648 \begin{description}
2649     \item[Length] distance between original image and final blur step; corresponds to the distance of the fields.
2650     \item[Steps] number of blur steps to be used in the calculation. Increasing the number takes more CPU.
2651 \end{description}
2652
2653 \subsection{Oil painting}%
2654 \label{sub:oil_painting}
2655 \index{oil painting}
2656
2657 This effect makes video tracks appears as a painting. It can be controlled by \textit{Radius} slider and \textit{intensity of colors} can be chosen as an option.
2658
2659 % Leave the Video and Audio parenthesis due to latex2html dual conflict
2660 \subsection{Overlay (Video)}%
2661 \label{sub:overlay}
2662 \index{overlay video}
2663
2664 This effect can combine several tracks by using the Overlayer. This is a basic internal device normally used by \CGGI{} to create the dissolve transitions and for compositing the final output of every track onto the output bitmap. The Overlayer has the ability to combine one or several image layers on top of a "bottom layer". It can do this combining of images in several different (and switchable) output modes such as \textit{Normal}, \textit{Addition}, \textit{Subtract}, \textit{Multiply} (Filter), \textit{Divide}, \textit{Max} and \textit{Replace}. For a detailed list and some differences in output expectations, refer to the \hyperref[cha:overlays]{Overlays} chapter  -- PorterDuff.
2665
2666
2667 The \textit{overlay} plugin enables the use of this Overlayer device in the middle of any plugin stack, opening endless filtering and processing possibilities. It is only useful as a \textit{shared plugin} (i.e.\ a multitrack plugin). To use the overlay plugin:
2668
2669 \begin{enumerate}
2670     \item Add the effect to Track A.
2671     \item Choose \textit{attach effect} from the context menu of another track (Track B).
2672     \item Choose Track A: Overlay as a shared plugin.
2673     \item Manipulate the plugin parameters in Track A.
2674 \end{enumerate}
2675
2676 In the Overlay plugin's parameter window you can choose the overlay "Layer order"
2677 to select which track plays the role of the "bottom layer" and which plays the
2678 role of the "top layer". For some overlay modes this can make quite a
2679 difference, for example the bottom layer is subtracted from the top layer for
2680 "Subtract" mode. Also in the parameter window, you can choose on which of the tracks
2681 to overlay the combined output by changing the "Output layer" and it too can make
2682 quite a difference.
2683 (Hint: in most cases, you will want to mute the other track so you only see the
2684 combined output).
2685
2686 \subsection{Perspective}%
2687 \label{sub:perspective}
2688 \index{perspective}
2689
2690 The \textit{perspective} plugin (aka Corner Pinning) allows you to change the perspective of an object and is used to make objects appear as if they are fading into the distance. Basically, you can get a different view. A transformation is used which preserves points, lines, and planes as well as ratios of distances between points lying on a straight line.
2691
2692 In (figure~\ref{fig:perspective}) you can see that there are four options for the endpoints used for the edges.
2693
2694 \begin{figure}[htpb]
2695     \centering
2696     \includegraphics[width=0.5\linewidth]{perspective.png}
2697     \caption{perspective control window}
2698     \label{fig:perspective}
2699 \end{figure}
2700
2701 \begin{description}
2702     \item[Default] if OpenGL is being used with your graphics card, this will be the option in effect. If no OpenGL, then it will be Cubic.
2703     \item[Nearest] using software, nearest neighbor can look step-py.
2704     \item[Linear] software implementation of a linear algorithm.
2705     \item[Cubic] smoothest looking on the
2706     edges and considered the best.
2707 \end{description}
2708
2709 Key Presses for using the Perspective plugin:
2710
2711 \begin{tabular}{ll}
2712     \hline
2713     Left mouse button & drags the corner that is closest to current location \\
2714     Alt key + left mouse & translates the perspective; drags the whole image \\
2715     Shift key + left mouse & zooms the perspective \\
2716     Alt+Shift + left mouse & translates view but does not change output \\
2717     \hline
2718 \end{tabular}
2719
2720 Note that the red color lines in the box show the composer boundary.
2721
2722 In order to see endpoints that go off the screen, you can use the zoom slider which changes only the zoom view and does nothing else. The slider uses a logarithmic scale ranging from $\frac{1}{100} to 100$.  Although not shown in the 
2723 image here, each endpoint is labeled in yellow with 1-4 and the Current X
2724 endpoint is shown in the menu to make it easier to tell which point is in play.
2725
2726 Figure~\ref{fig:perspective01} show the results of the 4 different smoothing options.
2727
2728 \begin{figure}[hbtp]
2729     \centering
2730     \includegraphics[width=0.8\linewidth]{perspective01.png}
2731     \caption{Clockwise: Nearest; Linear; OpenGL and Cubic}
2732     \label{fig:perspective01}
2733 \end{figure}
2734
2735 Just a side note about the possibility of ending up with a divide by 0 case when manipulating
2736 the endpoints.  Sometimes this results in a single frame anomaly but you can workaround this
2737 by setting the X value for the middle keyframe of a series to just a little more than 0,
2738 such as .01 so that dividing by 0 is avoided. The actual cause of the problem is that the
2739 interpolated X1..X4 auto coordinates used by perspective eventually have x1==x2, x3==x4, so
2740 that all points x are scaled by zero. Another solution is to tweak the frame count to an even
2741 number, so that the center is not over the point where x1==x2, x3==x4, or perturb the midpoint
2742 position a little so that the answers are not exactly zero.
2743
2744 \subsection{Polar}%
2745 \label{sub:polar}
2746 \index{polar}
2747
2748 The \textit{Polar} effect bends and warps your video in weird ways. Mathematically, it converts your video from either \textit{polar} coordinates to \textit{rectangular} coordinates, or the reverse. For maximum precision you can use the input box. With the \textit{Clear} buttons we can bring the slider to default values without affecting the other parameters.
2749
2750 \subsection{Posterize}%
2751 \label{sub:posterize}
2752 \index{posterize}
2753
2754 Reduces the color depth so as to decrease the displayed color gradients, up to the bands typical of posterization. It is used by setting the number of \textit{steps} from 0 to 255.
2755
2756 \subsection{RGB-601}%
2757 \label{sub:rgb-601}
2758 \index{rgb-601}
2759
2760 For analog video or MPEG (including DVD) output, the maximum range for R,G,B is $[16,235]$ ($8\,bit$). For YUV, the maximum range for intensity (\textit{Y}) is $[16, 235]$ ($8\,bit$). This range corresponds to gray levels from $6\%$ to $92\%$. When rendering, values outside of these ranges will be clipped to these limits.
2761
2762 To render to MPEG, add the \textit{RGB-601} effect to all video tracks where material uses the full intensity scale ($0-100\%$), and enable \textit{RGB$\rightarrow$601} compression. Consider adding the \textit{Videoscope} effect after RGB-601 to see how RGB-601 affects your dynamic range. To preview how your rendered MPEG would look without \textit{RGB$\rightarrow$601} compression, instead enable \textit{601$\rightarrow$RGB} expansion and you will observe a noticeable contrast increase. Although RGB-601 will reduce contrast in your video tracks, the contrast will be restored during MPEG playback.
2763
2764 \subsection{RGBShift}%
2765 \label{sub:rgb-shift}
2766 \index{rgb shift}
2767
2768 Most cameras take the light coming into the lens, and convert that into $3$ sets of numbers, one for Red (R), one for Green (G), and one for Blue (B). Figure~\ref{fig:rgbshift} showing RGB shift before and after.
2769
2770 \begin{figure}[hbtp]
2771         \centering
2772         \includegraphics[width=0.8\linewidth]{rgbshift.png}
2773         \caption{Bad Misaligned color and after color aligned}
2774         \label{fig:rgbshift}
2775 \end{figure}
2776
2777 Some of the older cameras were composed of $3$ sensors and originally the RGB sensors were on $3$ separate planes and had to be aligned. If they were misaligned in the video, you can use \textit{RGBShift} to get them realigned. To move a specific color up/down, modify the \textit{dy} value using the slider bar in the RGBShift window. To move a color left/right, modify the corresponding \textit{dx} value. For maximum precision you can use the input box. \textit{Clear} buttons are present to reset its slider to default without affecting others. Note that the current values of the RGBShift are maintained in the \texttt{.bcast5} defaults file and will be retained across sessions. If using the YUV color space, you will want to use \textit{YUVShift} instead.
2778
2779
2780 \subsection{Radial Blur}%
2781 \label{sub:radial_blur}
2782 \index{radial blur}
2783
2784 Radial blur is a \textit{Bokeh} effect that creates a whirlpool which simulates a swirling camera. You can vary the location, type, and quality of the blur.
2785
2786 \begin{figure}[hbtp]
2787         \centering
2788         \includegraphics[width=0.8\linewidth]{radial.png}
2789         \caption{For clarity of presentation only 2 fields are shown}
2790         \label{fig:radial}
2791 \end{figure}
2792
2793 \begin{description}
2794     \item[X,Y] center of the circle of movement.
2795     \item[Angle] angle of motion in one direction.
2796     \item[Steps] number of blur steps to be used in the calculation; increasing this number uses more CPU.
2797     \item[Clear] to reset its slider to default without affecting others.
2798 \end{description}
2799
2800 For maximum precision you can use the input box.
2801 Figure~\ref{fig:radial} has the parameters: $Angle=-35$ and $Steps=2$.
2802
2803
2804 \subsection{ReframeRT}%
2805 \label{sub:reframert}
2806 \index{reframeRT}
2807
2808 ReframeRT changes the number of frames in a sequence of video
2809 directly from the timeline. The faster method for getting the same
2810 results as this plugin is to use the \textit{speed curve} which was
2811 a later addition. But if you need very precise results,
2812 \textit{ReframeRT} is most useful. There are two ways to do this,
2813 which can be selected from the checkboxes in the configuration
2814 GUI\@. The first \textit{Stretch} mode changes the number of frames in
2815 the sequence, and therefore its length, but not the framerate. The
2816 \textit{Downsample} mode instead keeps the length of the movie by
2817 varying the framerate.  It is important to understand that the
2818 plugin works by varying the frames, the possible change of
2819 \textit{fps} is only a side effect of the creation of new frames due
2820 to interpolation. The interpolation algorithm is simply the slope of a linear curve. This plugin is keyframable and the \textit{Interpolate} option works between keyframes. A simpler and more handy version is the \textit{Speed PerCent} plugin.
2821
2822 \subsubsection*{Stretch}%
2823 \label{ssub:stretch}
2824 \index{stretch}
2825
2826 Stretch mode multiplies the current frame number of its output by the \textit{scale factor} to arrive at the frame to read from its input. The scaling factor is not entered directly but using a number of \textit{input} frames to be divided by the number of \textit{output} frames.
2827
2828 \vspace{1ex} \texttt{Scale factor (SF) = Input frames / Output frames}
2829
2830 \[\frac{1}{8} \Rightarrow scale\, factor = 0.125 \qquad (slow\, motion)\]
2831
2832 For slow motion we leave 1 for the frames of the input and we increase the number of frames of the output (for example putting 8 for the output we have slow motion $8\times$, with $SF=\frac{1}{8}=0.125$). For fast motion we leave 1 for the output and we increase the number for the input (for example 8 to have $8\times$, with $SF=\frac{8}{1}=8$). Another possibility is to put the frame rate of the media (e.g 120 fps) in the input and the project frame rate in the output (e.g 30 fps) or the opposite.
2833
2834 The stretch mode has the effect of changing the length of output video by the inverse of the scale factor. If the scale factor is greater than $1$, the output will end before the end of the sequence on the timeline. If it is less than $1$, the output will end after the end of the sequence on the timeline. The ReframeRT effect must be lengthened to the necessary length to accommodate the scale factor. Change the length of the effect by clicking on the endpoint of the effect and dragging.
2835
2836 Although stretch mode changes the number of the frames read from its
2837 input, it does not change the framerate of the input. Effects before
2838 ReframeRT assume the same frame rate as ReframeRT\@.  In stretch
2839 mode to create a fast play effect enter a value greater than $1$ to
2840 get accelerated playback.  For a slow motion effect, use ReframeRT
2841 in stretch mode with a value less than $1$.
2842
2843 \textit{Example:} you have a clip that you want to put in slow motion. The clip starts at $33.792\, seconds$ and ends at $39.765$. The clip is $5.973\, seconds$ long. You want to play it at $\frac{4}{10}^{ths}$ normal speed. You divide the clip length by the playback speed ($5.973\div0.4$) to get a final clip length of $14.9325\,seconds$. You create an in point at the start of your clip: $33.792\,seconds$. You put an out point $14.9325\,seconds$ later, at $48.7245\,seconds$ ($33.792 + 14.9325$). You attach a \texttt{ReframeRT} effect, set it to $0.4$ and stretch. You change the out point at $48.7245$ to an in point. You start your next clip after the slow motion effect at the $48.7245$ out point. You can do this without making any calculations by first applying the effect and then lengthening or shortening the bar to where the stretched movie ends.
2844
2845 Now in the timeline we have the affected part of the plugin where we see the slow/fast effect, and the continuation of the timeline from where the plugin ends. We then have to select the interval on which the plugin acts and render it or transform it into a nested clip or nested asset. In this way we can replace or overlap it with the part of the timeline that originally included all of the part we wanted to slow down/speed up. See also the \textit{Reframe} render effect for direct rendering.
2846
2847 \subsubsection*{Downsample}%
2848 \label{ssub:downsample}
2849 \index{downsample}
2850
2851 Downsample mode does not change the length of the output sequence. It multiplies the frame rate of the output by the scale factor to arrive at a frame rate to read the input. This has the effect of replicating the input frames so that they only change at the scaled frame rate when sent to the output. It does not change the length of the sequence. If the scale factor is $0.5$ and the output frame rate is $30 \,fps$, only $15$ frames will be shown per second and the input will be read at $15 \,fps$. Downsample is only useful for scalefactors below $1$, hence the name downsample.
2852
2853 Downsample mode changes the frame rate of the input as well as the number of the frame to read, so effects before ReframeRT see the $frame rate \times scale factor$ as their frame rate. If the scale factor is $2$ and the output frame rate is $30$, the input frame rate will be $60$ and the input frame number will by doubled. This will not normally do anything, but some input effects may behave differently at the higher frame rate.
2854
2855 \subsubsection*{Other important points}%
2856 \label{ssub:other_important_points}
2857
2858 \begin{itemize}
2859     \item ReframeRT uses the fps indicated in \texttt{Settings $\rightarrow$ Format $\rightarrow$ fps} project and not the \texttt{fps} of the assets.
2860     \item It can be associated with Nested Clips.
2861     \item As an alternative to ReframeRT you can use the \textit{speed curve}, or change the framerate in \texttt{Resources $\rightarrow$ info} and in the \texttt{Project}; or using \textit{Reframe} render effect, or using \textit{Speed PerCent} plugin.
2862     \item It is keyframmable.
2863     \item ResampleRT with the same settings is used to act on audio tracks.
2864 \end{itemize}
2865
2866 \subsection{Reroute}%
2867 \label{sub:reroute}
2868 \index{reroute}
2869
2870 The \textit{Reroute} plugin\protect\footnote{By Hermann Vosseler} enables you to selectively transfer the Alpha channel or the Components (RGB or YUV) or both from a \textit{source} track to a \textit{target} track, partially overwriting the target's contents.
2871
2872 \begin{description}
2873         \item[Target Track:] you can choose between \textit{Top} and \textit{Bottom}.
2874         \item[Operation:] you can choose between \textit{Replace Target},  \textit{Components Only} and \textit{Alpha Replace}.
2875         \begin{itemize}
2876                 \item \textit{replace Target} (component + alpha channels), this allows you to have the ability to overwrite everything on the target track with the source track where the the plugins are inserted.
2877                 \item \textit{Components only} (color channels only), replace the RGB or YUV components of the target track by the RGB or YUV components of the source track. The Alpha of the target track does not change.
2878                 \item \textit{Alpha replace} (alpha channel only), only the Alpha of the target track is changed but the components are not. This makes it easy to create an alphs channel on a track and then use that to apply it easily to another track.
2879         \end{itemize}   
2880 \end{description}
2881
2882 It works as a shared plugin. The typical usage scenario is to build up a possibly animated Mask in one track and then to transfer the Alpha channel to another target track.
2883
2884 \subsection{Reverse video}%
2885 \label{sub:reverse_video}
2886 \index{reverse video}
2887
2888 Media can be reversed on the timeline in realtime. This is not to be confused with using the reverse playback on the transport panel. The \texttt{reverse} effects reverse the region covered by the effect regardless of the transport direction. The region to be reversed is first determined by what part of the track the effect is under and second by the locations of keyframes in the effect. The reverse effects have an enabled option which allows you to set keyframes. This allows many possibilities.
2889
2890 Every enabled keyframe is treated as the start of a new reversed region and the end of a previous reversed region. Several enabled keyframes in succession yield several regions reversed independent of each other. An enabled keyframe followed by a disabled keyframe yields one reversed region followed by a forward region.
2891
2892 \subsection{Rotate}%
2893 \label{sub:rotate}
2894 \index{rotate}
2895
2896 The \textit{Rotate} filter can rotate the video in $90$ degree increments or by any number of degrees through use of the \textit{wheel} and about any \textit{pivot point}. It can also reverse and flip the video.
2897
2898 \subsection{Rumbler}%
2899 \label{sub:rumbler}
2900 \index{rumbler}
2901
2902 The \textit{Rumbler} plugin can be used to create dream-like or earthquake-like noise in the video. It creates noise by jiggling the corners through use of perspective transformation at the corners. The algorithm used is:
2903
2904 \[Rumbler\,(value) = (value\, at\, time) + amplitude \times (random\, generator)\]
2905
2906 The random generator varies from $-0.5\, to\, 0.5$. The rumble perturbs the normal values at time points which occur rate times a second. The values used between the rumble points are interpolated, so that the value jiggles rate times a second, by as much as the rumble amplitude. The time unit is frames per second. The corners are in units of percent width/height (figure~\ref{fig:rumbler}).
2907
2908 \begin{figure}[hbtp]
2909     \centering
2910     \includegraphics[width=0.45\linewidth]{rumbler.png}
2911     \caption{Rumbler control window}
2912     \label{fig:rumbler}
2913 \end{figure}
2914
2915 Screencast shows:
2916
2917 \textit{Time jittering} - $20\, fps$ 1 time a second.
2918 \textit{Corners jittering} - $25\%$  $5$ times a second.
2919 Using \textit{random seed} $0$ for a rumble sequence.
2920
2921 Plugin variables:
2922
2923 \begin{description}
2924     \item[Rumbler:] gain applied to random rumbler.
2925     \item[Rate:] number of times per second.
2926     \item[Time:] number of frames per rate times a second; if 0 has no effect on results.
2927     \item[Space:] corners jiggling in percentage per rate times a second; if 0 has no effect on results.
2928     \item[Seq:] is a random seed number; any reasonable positive or negative number you choose.
2929 \end{description}
2930
2931 \subsection{SVG via Inkscape}%
2932 \label{sub:svg_via_inkscape}
2933 \index{SVG via Inkscape}
2934
2935 This plugin allows the user to manipulate an SVG (scalable vector graphics) image with \textit{Inkscape} without having to leave the program. The associated \CGG{} window provides the ability to change the DPI, the Out $x/y$ coordinates, and the Out w/h values. For more information on use of inkscape, refer to: {\small \url{https://inkscape.org/develop/about-svg/}}
2936
2937 \begin{description}
2938     \item[DPI] is Dots per inch and it represents the resolution of the SVG image. Since the image is scaled with interpolation mode linear, the edges will look blurry when the input resolution is lower than the output resolution. You can either set the desired \textit{DPI value} in the window or use the tumbler on the integer text box, then use the \textit{update dpi} button to have the change take effect. Changing DPI causes the entire image to be re-exported via inkscape. DPI changes cause adjustments in the resolution, speed of re-import, and storage needed for the image data.
2939     \item[Out\_x/Out\_y] allow for changing the location of the SVG via the $x$ or $y$ coordinates.
2940     \item[Out\_w/Out\_h]  The scaling is controlled by width and height as they are normal parameters to overlay.
2941 \end{description}
2942
2943 \begin{figure}[hbtp]
2944         \centering
2945         \includegraphics[width=1.0\linewidth]{svg.png}
2946         \caption{Control window and Inkscape}
2947         \label{fig:svg}
2948 \end{figure}
2949
2950 Figure~\ref{fig:svg} shows the menu options plugin window and the SVG image in the Inkscape window.
2951
2952 \subsection{Scale}%
2953 \label{sub:scale}
2954 \index{scale}
2955
2956 Reduce or expand the image size depending on the ratio.
2957
2958 \begin{description}
2959     \item[Size] Height and Width in pixel; plus pulldown menu with preset.
2960     \item[Scale] Aspect ratio
2961     \item[Constrain ratio] Lock height to width rate
2962 \end{description}
2963
2964 \subsection{Scale Ratio}%
2965 \label{sub:scale_ratio}
2966 \index{acale ratio}
2967
2968 With the Scale Ratio plugin you can manipulate your video to maintain the pixel aspect ratio (proportional geometry), possibly for a different output Display device (figure~\ref{fig:scaleratio}).
2969
2970 \begin{figure}[hbtp]
2971     \centering
2972     \includegraphics[width=0.5\linewidth]{scaleratio.png}
2973     \caption{Many parameters of scale ratio}
2974     \label{fig:scaleratio}
2975 \end{figure}
2976
2977 \textit{In R} and \textit{Out R} representing the current input and output aspect ratios. Use the arrows to change to your desired values. Next you have the \textit{In W/H} and the \textit{Out W/H} for Width and Height. In the middle of the plugin on the right-hand side, you can set the Scale type of \textit{None}, \textit{Scaled}, \textit{Cropped}, \textit{Filled}, \textit{Horiz edge} and \textit{Vert edge}. The top part (aspect ratio data) is used to compute the bottom part when the Apply button is pressed. The bottom part allows you to reposition the image input or output to customize the results. When the in/out aspect ratios are different, the output must be cropped or filled to fit the output and maintain pixel square appearance. Left and right sides of the bottom portion show the \textit{Source} and the \textit{Destination X, Y, W, H} values. As you change the values on the left side, you can see how this will affect the output as you observe the results in the compositor window. For example, as you change the values for \textit{SrcY} in a \textit{cropped} Scale scenario, you see up/down movement.
2978
2979 \subsection{Selective Temporal Averaging}%
2980 \label{sub:selective_temporal_averaging}
2981 \index{selective temporal averaging}
2982
2983 This plugin is designed to smooth out non-moving areas of a video clip (figure~\ref{fig:staveraging}).
2984 \vspace{2ex}
2985 \begin{wrapfigure}[18]{O}{0.4\linewidth}
2986    \vspace{-2ex}
2987     \includegraphics[width=0.9\linewidth]{staveraging.png}
2988     \caption{STA control window}
2989     \label{fig:staveraging}
2990 \end{wrapfigure}
2991
2992 \textit{Denoise} is generally done on a spatial basis, mediating the values of a group of adjacent pixels to achieve greater uniformity. The effectiveness of Denoise can be increased by also introducing a \textit{time average} between a group of successive frames. The union of these two phases is the basis of the plugin. In fact the smoothing is performed by averaging the color component for each pixel across a number of frames. The smoothed value is used if both the standard deviation and the difference between the current component value and the average component value are below a threshold. The standard deviation is a mathematical index used to estimate the variance of a group of pixels: at high values corresponds more variation of the pixels and therefore more noise.
2993
2994 The \textit{Selective Temporal Averaging} plugin plays on the homogenization of the values of a group of pixels in a group of frames, based on a threshold below which the original values are left and above which the average is performed and then the noise reduction.
2995
2996 The \textit{average} and \textit{standard deviation} are calculated for each of the components of the video. The type of components averaged is determined by the color model of the entire project. The average and standard deviation of the frames can be examined by selecting the specific radio button in the plugin options window.
2997 The region over which the frames are averaged is determined by either a \textit{fixed offset} or a \textit{restart marker system}. In a restart marker system, certain keyframes are marked as beginning of sections. Then for each section, the frames surrounding the current frame are used as the frames to average over, except when approaching the beginning and end of a section, where the averaging is performed over the $N$ beginning or ending frames respectively.
2998
2999 An example of common usage is to select the number of frames you wish to average.
3000
3001 \begin{enumerate}
3002     \item Enter a reasonable number of frames to average (for example, $10$).
3003     \item Select the \textit{Selective Temporal Averaging} method and enter $1$ and $10$ for all the \textit{Av. Thres.} and \textit{S.D. Thres.} respectively. This basically causes all pixels to use the average value.
3004     \item Turn the \textit{mask} for the first component on. This should make the whole frame have a solid color of that specific component.
3005     \item Slowly reduce the \textit{S.D. Thres.} value. As you do so, you will notice that the regions vastly different from the average will have a flipped mask state. Continue to reduce the threshold until you reach the point at which non-moving regions of the video have a flipped masked state. This value is known as the \textit{noise-floor} and is the level of natural noise generated by the CCD in the camera.
3006     \item Repeat the same procedure for the \textit{Av. Thres.}
3007     \item Turn off the \textit{mask}.
3008     \item Repeat this for all channels.
3009 \end{enumerate}
3010
3011 \subsection{Sharpen}%
3012 \label{sub:Sharpen}
3013 \index{sharpen}
3014
3015 Sharpen the video, either the \textit{luminance}, \textit{horizontal}, or \textit{interlace}. You can use sliders or, for maximum precision, you can use the input box. With the \textit{Clear} buttons we can bring the slider to default values without affecting the other parameters.
3016
3017 \subsection{Shift Interlace}%
3018 \label{sub:shift_interlace}
3019 \index{shift interlace}
3020
3021 Shift the interlace lines using \textit{odd} or \textit{even}. With the Clear buttons we can bring the slider to default values without affecting the other parameters.
3022
3023 \subsection{Sketcher}%
3024 \label{sub:Sketcher}
3025 \index{sketcher}
3026
3027 Now you can sketch \textit{lines}, \textit{curves} or \textit{shapes}, on your video in different colors using various pen widths and pen type with the \texttt{sketcher} plugin. You can even fill them. You can do rotations and scaling and apply two anti-aliasing modes; single and double. Getting started is fairly easy -- simply hold down the \textit{shift key} while using the \textit{left mouse button} to create a bunch of points in the compositor window. However, to do more than that you will need to understand the buttons and options or you may end up with unexpected results.
3028
3029 (figure~\ref{fig:sketcher}) shows the Sketcher gui and the sketch lines/curves created in the Compositor.
3030
3031 \begin{figure}[hbtp]
3032     \centering
3033     \includegraphics[width=1.0\linewidth]{sketcher.png}
3034     \caption{Sketcher control window and sketch on Compositor}
3035     \label{fig:sketcher}
3036 \end{figure}
3037
3038 In the screencast, note the Sketcher window gui \textit{Curve top section} and the \textit{Point bottom section}. The pink circle sketch is $id\,\#1$ in the curve section. Since $id\,\#2$ is highlighted in the Curve section, the X/Y coordinates in the Point section below show the points used to create the blue shape. Point 6 is selected so we see a red crosshair (\textit{Drag point}) inside the rectangle. The yellow arrow on the image is $id\,\#3$ curve. Finally the cursor shows Double anti-aliasing.
3039
3040 \subsubsection*{Some basic rules}%
3041 \label{ssub:some_basic_rules}
3042
3043 Uncheck \textit{Drag} before rendering; if you do not uncheck, the drag points will show in your output.
3044 Drag must be checked on to edit the data. Drag must be checked off to use \textit{Click to play}.
3045 If the drag button flickers when clicked then another window has drag focus. Un-focus it first.
3046 Turn drag off to see what the sketcher figure will look like when rendered.
3047
3048 Curves can be any number of points or just a single point.  You must
3049 create a \textit{new} curve if you want a new string of points not
3050 connected to the current curve.  Highlight the curve $id\,\#$ for a
3051 specific curve to modify its values.
3052 %
3053 Left mouse click or right mouse click on an existing point on the
3054 highlighted line/curve $id\,\#$ will automatically highlight the
3055 selected point in the Point section of the gui and turn red in the
3056 image. We can drag this point to the desired position using
3057 \texttt{CTRL + LMB}; or we can translate the entire selected curve
3058 using \texttt{CTRL + RMB}.
3059
3060 With the mouse wheel we can rotate our curves; the center of rotation is given by the position of the cursor. Normally the scroll is slow to be more precise. If you make a fast scroll you have an acceleration that allows you to make complete rotations in a short time. Using the mouse wheel with the SHIFT key we can instead scale the size of the curve; the fixed scaling point is still given by the mouse position.
3061
3062 There will always be $1$ empty curve automatically defined when you start or even reset.
3063 You can not delete the empty default curve but you can use it for a curve.
3064
3065 LMB click almost anywhere on the compositor screen will automatically show, in the currently highlighted curve, the closest point by turning it red.
3066
3067 There is no \textit{undo} recorded between gui updates. It is recommended that you use the option "b" to save a backup if you get to a place where you want to make sure you do not lose your sketch.
3068
3069         \begin{longtable}{{m{12em}m{13em}m{12em}}}
3070                 \caption{Sketcher controls}
3071                 \label{tabular:sketcher_controls} \\ % note that double backslash is mandatory here
3072                 \toprule
3073                 \textbf{Compositor: Mouse usage} &
3074                 \textbf{Compositor: Action} &
3075                 \textbf{Plugin GUI}\\\midrule
3076                 shift+left mouse button &
3077                 create a new line point &
3078                 New button in Point (line)\\\midrule
3079                 shift+right mouse button &
3080                 create a new arc (curve) point &
3081                 New button in Point (curve)\\\midrule
3082                 left mouse button &
3083                 select a single line point &
3084                 Click point listbox item \\\midrule
3085                 right mouse button &
3086                 select a single arc (curve) point &
3087                 Click curve listbox item \\\midrule
3088                 ctrl+left mouse button &
3089                 drag point & \\\midrule
3090                 ctrl+right mouse button &
3091                 drag curve & \\\midrule
3092                 alt+left mouse button &
3093                 drag all of the curves together & \\\midrule
3094                 alt+right mouse button &
3095                 create a new curve &
3096                 New button in Curve section \\\midrule
3097                 ctrl+shift+left mouse button &
3098                 create a new fill point &
3099                 New button in Point (fill) \\\midrule
3100                 ctrl+shift+right mouse button &
3101                 create a new off point &
3102                 New button in Point (off) \\\midrule
3103                 Wheel mouse &
3104                 rotate curve &
3105                 \\ \midrule
3106                 Wheel mouse + shift &
3107                 scale curve &
3108                 \\ \midrule
3109                 delete key &
3110                 deletes highlighted points &
3111                 Del button in Point section \\\midrule
3112                 delete key+shift &
3113                 deletes highlighted curves &
3114                 Del button in Curve section \\
3115                 \bottomrule
3116         \end{longtable}
3117
3118 \subsubsection*{Other Button and Label Descriptions}%
3119 \label{ssub:other_button_label_description}
3120
3121 \begin{description}
3122         \item[Anti-Aliasing] You can set Off; On or Double. Default is On.
3123     \item[Color] refers to the current curve pen color. Click on the \textit{Color rectangle} to bring up the Color window to change any of the color values, including alpha.
3124     \item[Drag] check to create curves and to be able to see any Off type curves. Uncheck for render/viewing.  If you need to clear the Drag enabled, you can easily do this with \textit{Allow keyframe spanning} whose use is described in \nameref{sec:allow_keyframes_spanning}.
3125     \item[Reset] -- in the \textit{Curve section}, all of the curve lines will be deleted except for an empty default curve;
3126     -- in the \textit{Point section}, all points for the highlighted curve in the Curve section will be deleted.
3127     \item[Width] integer width of line; width of $1$ is the default; width of $0$ is the smallest size of $1$ pixel.
3128     \item[ID] is the label number of the curve or point.
3129     \item[Pen] value can be set with the pulldown to \textit{box} (a square), \textit{+}, \textit{/}, \textit{x} or \textit{off}. The default is \textit{x}.
3130     \item[Alpha] alpha value as set in the Color window. Default is $1$ which is totally opaque.
3131     \item[Arc Type] value can be set with this pulldown, which is to the right of the \texttt{Drag} checkbox, to either \textit{off}, \textit{line}, \textit{curve}, or \textit{fill}. \textit{Off} is the default. If the line type is off when you uncheck drag, you will no longer see the line/curve. \textit{Fill} specifies a point be inside the region to be filled with the chosen color. Multiple fill points can be used within a single curve.
3132     \item[Up] moves the highlighted Curve or Point Up in the stacking order. Multiple points, but not multiple curves, can be highlighted and moved.
3133     \item[Dn] moves the highlighted Curve or Point(s) down in the stacking order.
3134     \item[X] is the point’s $X$ coordinate.
3135     \item[Y] is the point’s $Y$ coordinate.
3136 \end{description}
3137
3138 \subsubsection*{ID number detailed information}%
3139 \label{ssub:id_number_detailed_information}
3140
3141 Points and curves are identified by numeric ids, and not the table position. This is so that deleting and inserting points/curves does not shift the interpretation of which points are associated for interpolation. For purposes of this discussion, \textit{prev} refers to \textit{previous}. The prev keyframe constitutes the draw list of curves and points. The prev ids are used to access the next keyframe interpolation input data. When \textit{next} exists for prev.id the interpolation functions apply. When next does not exist, prev is returned for the interpolation value. The keyframes may be any id sequence; both the prev and next keyframe id sequences are arbitrary non-unique sets. This means that if an id is specified redundantly, it causes a redundant draw when it is the prev keyframe, and only the last item with the id in the next keyframe is used for interpolation.
3142
3143 \subsubsection*{Fill detailed information}%
3144 \label{ssub:fill_detailed_information}
3145
3146 The \textit{fill} point is a marker point, and not really part of the curve. That point identifies the inside of the loop. It can also be used to identify the outside of the loop in order to fill that. The loop is created by drawing a line from the last point to the first point in the curve. The line of this last segment is from the last point of the curve. If there are isolated loops in the curve (it is self intersecting) then you will be able to use multiple fill points to fill these regions.
3147
3148 \subsection{Speed PerCent}%
3149 \label{sub:speed_per_cent}
3150 \index{speed percent}
3151
3152 It works like the \texttt{ReframeRT} plugin in \textit{Stretch} mode. The interpolation algorithm is simply the slope of a linear curve. It allows you to change the speed of the video track, or an edit, or a region of the track quickly and intuitively. There are presets to set the speed to 100\% (default) or 25\%; 50\%; 200\% and 400\%. Or we can enter the value directly in the text box or use the slider until the desired value is reached. \textit{Interpolate} option works between keyframes. It requires setting the right limits for applying the effect and then rendering that region, or turning it into a nested clip, which will replace the original one.
3153
3154 \subsection{Sphere Cam}%
3155 \label{sub:sphere_cam}
3156 \index{sphere cam}
3157
3158 Converts multiple fisheye images into a panoramic projection.
3159
3160 \subsection{Swap Frames}%
3161 \label{sub:swap_frames}
3162 \index{swap frames}
3163
3164 Swap the position of two consecutive frames. There are two modes of exchange:
3165
3166 \qquad \textit{swap: 0-1, 2-3, 4-5\dots} \qquad or \qquad \textit{swap: 1-2, 3-4, 5-6\dots}
3167
3168 \subsection{Swap channels}%
3169 \label{sub:swap_channels}
3170 \index{swap channels}
3171
3172 Swap color, R G B, and Alpha channels with another channel or even turn channels off completely.
3173
3174 \subsection{Threshold}%
3175 \label{sub:threshold}
3176 \index{thresold}
3177
3178 \textit{Threshold} converts the image to pure luminance, and replaces pixels with one of three colors based on the luminance. Pixels with luminance values in the low range are replaced with black, pixels in the middle range are replaced with white, and pixels in the high range are replaced with black. \textit{Color} and \textit{alpha} (transparency) for each range are configurable with the buttons and interpolate according to keyframes.
3179
3180 The threshold window shows a \textit{histogram} of luminance values for the current frame. Click dragging inside the histogram creates a range (blue) to convert to white. SHIFT-clicking extends one border of this range. Values for the threshold range can also be specified in the \textit{text boxes}.
3181
3182 This effect is basically a primitive \textit{luminance key} to produce a \textit{matte}. A second track above the track with the threshold effect can be \textit{multiplied}, resulting in only the parts of the second track within the threshold being displayed.
3183
3184 \subsection{Time average}%
3185 \label{sub:time_average}
3186 \index{time average}
3187
3188 Time average is one effect which has many uses besides creating trail patterns of moving objects (figure~\ref{fig:timeaverage}).
3189 The main use is reducing noise in still images (or in the motionless parts of a video). Merely point a video camera at a stationary subject for $30$ frames, capture the frames, and average them using time average and you will have a high quality print. In floating point color models, time average can increase the dynamic range of low quality cameras.
3190
3191 Inside the time average effect is an accumulation buffer and a divisor. A number of frames are accumulated in the \textit{accumulation} buffer and divided by the divisor to get the average (for $10$ accumulated frames the divisor is $10$). Because the time average can consume large amounts of memory, it is best applied by first disabling playback for the track, dropping the time average in it, configuring time average for the desired number of frames, and re-enabling playback for the track.
3192
3193 \begin{figure}[hbtp]
3194         \centering
3195         \includegraphics[width=0.3\linewidth]{timeaverage.png}
3196         \caption{GUI for Time Average}
3197         \label{fig:timeaverage}
3198 \end{figure}
3199
3200 \begin{description}
3201     \item[Frames count] this determines the number of frames to be accumulated in the accumulation buffer. Ranges from $1 to 1024$ frames.
3202     \item[Accumulate] this outputs the accumulation buffer without dividing it.
3203     \item[Average] this causes the accumulation buffer to be divided before being output. This results is the average of all the frames. The result is similar to \textit{Selective Temporal Averaging}, but not configurable.
3204     \item[Replace] (\textit{Threshold}, \textit{Border}): causes the accumulation buffer to be replaced by any pixels which are not transparent. In combination with motion tracking it allows entire sequences to be combined to form panoramas.
3205     \item[Restart for every frames] if an effect before the time average is adjusted the time average normally does not reread the accumulation buffer to get the change. This forces it to reread the accumulation buffer when other effects change.
3206     \item[Don’t buffer frames] in order to represent the accumulation of only the specified number of frames, the time average retains all the previous frames in memory and subtracts them out as it plays forward. It would run out of memory if it had to accumulate thousands of frames. By disabling subtraction the previous frames are not stored in memory and only the average function is affected by the frame count.
3207 \end{description}
3208
3209 \subsection{TimeBlur}%
3210 \label{sub:timeblur}
3211 \index{timeblur}
3212
3213 The TimeBlur plugin provides a way to blur a number of \textit{Frames}.
3214
3215 \subsection{Timefront}%
3216 \label{sub:timefront}
3217 \index{timefront}
3218
3219 Space-temporal warping enables time to flow differently at different locations in the video (figure~\ref{fig:timefront}).
3220 \begin{wrapfigure}[13]{O}{0.3\linewidth}
3221     \vspace{-2ex}
3222     \includegraphics[width=0.8\linewidth]{timefront.png}
3223     \caption{Temporal bands for Timefront}
3224     \label{fig:timefront}
3225 \end{wrapfigure}
3226 This plugin divides the frame into segments (bands) whose type, position and size can be configured at will. Each segment will move with a different speed from the others, greater than the band that precedes it and less than the band that follows.
3227
3228 \textit{Type} allows you to choose a \textit{Linear} or \textit{Radial} segmentation; or to make it depend on the alpha channel or on another track (with \textit{Shared Effect}). In the case of Linear you can choose the orientation of the strips (\textit{Angle}); in the case of Radial you can choose the coordinates (\textit{X,Y}) of the center. For a more precise adjustment we can make the bands visible with the button \textit{Show Grayscale} (for tuning).
3229
3230 With \textit{Inner} and \textit{Outer Radius} we can position the beginning and end of the bands in the frame (similar to the \texttt{Gradient} plugin), so you can choose the spatial range in which to apply the effect.
3231
3232 With \textit{Time Range} we decide the size (and therefore the number) of the bands.
3233
3234 \textit{Rate} allows you to choose the type of algorithm to use when switching between the start and end bands. You can reverse the direction with the \textit{Invers} button. The three modes are: \textit{Linear}, \textit{Log} or \textit{Quadratic} (exponential). This is a warping framework plugin based on this article: {\small \url{http://www.vision.huji.ac.il/videowarping/HUJI-CSE-LTR-2005-10_etf-tr.pdf}}
3235
3236 \subsection{Timelapse Helper}%
3237 \label{sub:timelapse_helper}
3238 \index{timelapse helper}
3239
3240 It is used to get a timelapse quickly and easily. It sets the number of frames to be skipped during playback. The default value of \textit{Number of Frames x block} is 10; playback (and rendering) displays frames 1 - 10 - 20 - ... and not the intermediate ones.
3241
3242 \subsection{Title}%
3243 \label{sub:title}
3244 \index{title}
3245
3246 The \textit{Titler} allows you to add text from within \CGG{}. It has many configuration capabilities. Often it is convenient to apply the plugin on a separate track (shared or not), in order to make it independent from the video track and have more freedom in editing and configuration. For example, you can apply the \textit{Rotation} plugin to rotate the title without rotating the underlying video. Another thing to keep in mind when using the Titler plugin is that it works on the \textit{temporary} and therefore it is not affected by Camera movements (curves), but only by Projector movements.
3247
3248 The titler has standard options for font, size, and style plus many options as described next (figure~\ref{fig:title01})
3249
3250 \begin{figure}[hbtp]
3251         \centering
3252         \includegraphics[width=1.0\linewidth]{title01.png}
3253         \caption{GUI of the Title plugin}
3254         \label{fig:title01}
3255 \end{figure}
3256
3257
3258 \begin{description}
3259     \item[Justify] justifies the text relative to the entire frame. Once justified, the $X$ and $Y\, offset$ is applied. This allows text to be justified while at the same time letting you push it within the title safe region.
3260     \item[Motion type] scrolls the text in any of the four directions. When using this, the text may disappear. Make sure the speed is set to a reasonably high value (for example $150$) and move the insertion point along the timeline until the text is far enough along the animation to reappear. The text scrolls on and scrolls off. Setting \texttt{loop} causes the text to scroll completely off and repeat. Without loop the text scrolls off and never reappears. The speed of the animation is determined by speed in pixels per second. Set it higher to speed up the animation.
3261     \item[Smooth] with \textit{Chroma Key}, a shadow may show; remove by enabling this to add/remove the shadow.
3262     \item[Drop shadow] draws a black copy of the text to the bottom right of the original text. This is useful when drawing text over changing video to keep the border always visible.
3263     \item[Fade in/Fade out] are a second type of animation. If the fade seconds are $0$, no fading is done.
3264     \item[Color and Outline] allows you to pick the color for using to draw the text or its outline.
3265     \item[Stamp timecode] replaces text with the current position on the timeline in seconds, frames or samples.
3266 \end{description}
3267
3268 To create special effects for your title you can place it on a dedicated track and insert other realtime video effects just under the title effect and/or use camera and projector. With keyframing you can animate your title and make it change position, size, color, transparency, texture, or shape over time.
3269
3270 For improving playback performances of titles with effects, you can reduce the size of the dedicated track. Right click on the track and select \textit{Resize track\dots} Enter the smallest resolution that still keeps the title visible.
3271
3272 To include graphical elements like \textit{logos}, you may want to import your title as a PNG image (alpha channel transparency is possible), move it with camera and projector or add effects.
3273
3274 \subsubsection*{Some recently added options}%
3275 \label{ssub:some_recently_added_options}
3276
3277 \begin{description}
3278     \item[Drag] initial default checkbox is \textit{off} so that the Title plugin will work as it always has. With Drag active, we can create a box that works as a region to the title; we can resize and translate it as we wish, and we can add a background image (or video) to it. See later how to use the background image.
3279     \begin{description}
3280         \item[Anchors] When you turn on the Drag feature, nine different anchors/handles will appear on compositor window. The \textit{middle anchor} allows you to drag your title wherever you want in the compositor window ($X, Y$ coordinates). The other 8 handles, drawn as arrows in each corner and in the middle of each side, let you change the size of the drag area box so that your title is within that area if it fits and as it is directed.  If you need to clear the Drag enabled, you can easily do this with \textit{Allow keyframe spanning} whose use is described in \nameref{sec:allow_keyframes_spanning}. Another way to reset the box to default, i.e. the entire frame, is to set X and Y to 0 and W and H to the frame resolution (e.g. 1920x1080 for FullHD).
3281         \item[W/H] the values in these 2 boxes specify the size of the drag area box measured in pixels as shown in the compositor window. You can set these manually and if you can't see the location of your box or find your handles, set them to zero because $0$ sets it to the same as the width/height of the media.
3282         The Drag effect ignores all boundaries, including the \textit{Title Safe Region} of the Compositor so that if you drag your titles off the screen, it will look like they disappeared completely. Reset X and Y to reasonable values to have it reappear. The Title \textit{text}, \textit{background}, and \textit{pngs} are applied on a single layer so that they will drag together as an entity. All of the Title capabilities work in conjunction with dragging so if you want to justify the title, you can still use the \textit{Left/Center/Right/Top/Mid/Bottom} within the drag area. Be sure to turn off Drag when rendering or the box will show in the video; keep in mind that drag bars do not appear until there is some text in the text box and you can not actually drag until the Title window controls are available.
3283     \end{description}
3284     
3285     
3286     \begin{figure}[hbtp]
3287         \centering
3288         \includegraphics[width=0.3\linewidth]{title02.png}
3289         \caption{Pulldown Attributes}
3290         \label{fig:title02}
3291     \end{figure}
3292         
3293     \item[Attributes] in the Text box where you type your Title information, you can now change several attributes to give you plenty of flexibility (figure~\ref{fig:title02}). Each of these special attributes begin with an open angle bracket < and ends with a closing angle bracket >. Until the closing angle bracket is keyed in, the actual characters you type, will be seen in the compositor window. In addition, if you do not use the exact syntax or you keyin a filename that is not available, all of the characters will continue to show up. This helps to see what needs to be fixed or is missing. The attributes usage is described in the table below.
3294 \end{description}
3295
3296     \begin{longtable}{{m{6em}m{14em}m{14em}}}
3297         \caption{Titler attributes}
3298         \label{tabular:titler_attributes} \\ % note that double backslash is mandatory here
3299         \toprule
3300         \multicolumn{1}{c}{\textbf{Attribute name}}&\multicolumn{1}{c}{\textbf{Attribute value}}&\multicolumn{1}{c}{\textbf{Notes}}\\
3301         \midrule % \endhead  % here the common page header
3302         color &
3303         color name such as RED from \textit{<cin\_path>/guicast/colors.h} &
3304         Or use the hex value like \textit{\#a000a0}; color-hex.com shows examples \\\midrule
3305         font &
3306         exact name from \textit{Font} pulldown &
3307         When you set font, bold/size and  italic will be as currently set up \\\midrule
3308         alpha &
3309         floating-point number between 0 and 1&
3310         0 is transparent; 1 is opaque \\\midrule
3311         size &
3312         + increases the size by $\frac{5}{4}$, - decreases $\frac{4}{5}$ or use a number > 0 but less than 2048 &
3313         Examples: \textit{<size +++>}, or \textit{<size ->} or \textit{<size 14.5>} (floating-point ok) \\\midrule
3314         png &
3315         filename of a \textit{.png} file &
3316         Example, add a logo. Full pathname needed if not in current directory \\\midrule
3317         bold &
3318         1 for \textit{on} (default) or use 0 for \textit{off} &
3319         Font used must have bold available \\\midrule
3320         italic &
3321         1 for \textit{on} (default) or use 0 for \textit{off} &
3322         Font must have italic already set up \\\midrule
3323         blink &
3324         a number in seconds to flash on and off; a negative number for fade in and out &
3325         Can be a floating-point number; \textit{<blink>} with no value is like 1 \\\midrule
3326         ul &
3327         underline 1 for \textit{on} (default), 0 for \textit{off} &
3328         \\\midrule
3329         caps &
3330         1 for \textit{on}, 0 for \textit{off}, -1 for lower case &
3331         If no value set, treated same as 1 \\\midrule
3332         sup &
3333         1 for superscript; 0 ends; -1 for subscript; positive bumps up by $\frac{1}{2}$ of font size;  negative sinks by 1/2 of current size &
3334         Size of text will be $\frac{1}{3}$ of font size; example: \textit{12<sup 1>10<sup 0>}; <sup> with no values, acts like 1 \\\midrule
3335         fixed &
3336         number of pixels between characters;  fixed with no value uses $\frac{3}{4}$ current size &
3337         A fixed font is very useful for tables; /fixed reverts to previous fixed size \\\midrule
3338         nudge &
3339         x,y to move the text by that amount;  displacement is in number of pixels. Can be negative or positive &
3340         Example: \textit{<nudge 8,8>abc</nudge>} \\\midrule
3341         smooth &
3342         add anti-aliasing to smooth jagged edges &
3343         Turn off smooth for chroma key
3344         \\\bottomrule
3345     \end{longtable}
3346
3347 These attributes stay in effect until you change them or reset them. Additional cpu time is needed for the \textit{blink} attribute because it requires redrawing every frame and for the background option described below. Note that some Title window controls can not be set, such as Justify and Outline color. The lines below are examples for testing purposes. The accompanying screenshot displays the corresponding \CGG{} output.
3348
3349 \vspace{1ex} Examples of Title line keyins:
3350
3351 Figure~\ref{fig:title03}.
3352
3353 \vspace{1ex}
3354 \begin{lstlisting}[style=sh]
3355 <size 15>Buddy, the <color red><bold 1>bad dog</bold><color white> ate my homework !<png /tmp/buddy.png><ul 1><size +>There are<ul 0><size +>2<sup 1>10<sup 0>cats <font Action man (misc)>to chase?
3356 \end{lstlisting}
3357
3358 \begin{figure}[hbtp]
3359     \centering
3360     \includegraphics[width=1.0\linewidth]{title03.png}
3361     \caption{Final result of the exemple}
3362     \label{fig:title03}
3363 \end{figure}
3364
3365 \paragraph{Special Characters (< > / \textbackslash \#)} Besides the previously described <, >, and / characters, there are two special characters: backslash “\textbackslash”, and the pound sign “\#”. The backslash character is used for two things. With the advent of the attribute name and value, your line may become quite long so you can use “\textbackslash” followed by the carriage return to continue on the next line as if it is just a single line. It also can be used to designate that the following character does not represent the beginning of an attribute. For example, if you want to use the opening angle character “<“ as a title character, precede it with the backslash character. The pound sign, “\#”, designates the whole line as a comment or if in the middle of the line, then the rest of the line is a comment (this includes the carriage return).
3366
3367 \begin{description}
3368     \item[Background] in this box you can keyin the name of a file of the type that \CGG{} accepts and use that file as a background for your Title characters (media video or image). This will be seen in the compositor window on top of the video that is loaded in the main track canvas. Besides typing in the filename, you must also check the checkbox. This makes it easy to turn it \textit{On} and \textit{Off} to see what it looks like. Next to the background box is a \textit{Loop} checkbox. If the background file takes less time than the main track canvas video to run, you can turn on the loop checkbox so that it runs over and over again to match the time size of your video. By default the background image will occupy the whole frame, but if we activate \textit{drag} mode and create a box of the desired size, the image will occupy only the box leaving the rest of the frame visible.
3369     \item[Stroker] to add \textit{pen strokes} to the text letters, adjust the stroke width numerically. This looks particularly nice on certain fonts and with a negative adjustment of the \textit{Drop shadow}.
3370     \item[Text: chars:] to output and update the number of characters already used. The only limit to the number of characters based on a count of single $8\, bit$ characters is the available resources on the user computer available for \CGG{} use. Keep in mind that unicode or other special characters may consist of $2$ to $4$ $8\,bit$ bytes. Also, newlines are a character and any of the attributes you use count in the total. There is now a horizontal scroll bar as well as the vertical one in the textbox and they only appear when there are more lines or characters than can fit in the original sized textbox.
3371     \item[Unicode Insertion] if you want to enter a special character like the mathematical \textit{summation} symbol, you can use the unicode equivalent to do so. Press Ctrl-Shift-U followed by $2022$ and a carriage return is an example of the bullet. Refer to section \hyperref[sec:textbox_non_std_character_unicode]{17.5} for details.
3372     \item[Popup Helper] put your cursor where you want to add an attribute, then right mouse will bring up a list of the available attributes for you to choose, along with a submenu to choose from. The program will insert that attribute for you and all you have to add is a value when required! (see figure~\ref{fig:title02}).
3373 \end{description}
3374
3375 \subsubsection*{Color Picker Usage}%
3376 \label{ssub:color_picker_usage}
3377
3378 The Text Color window has several enhanced features as listed here and seen in figure~\ref{fig:title04}.
3379
3380 \begin{figure}[hbtp]
3381         \centering
3382         \includegraphics[width=0.7\linewidth]{title04.png}
3383         \caption{Screencast showing the Color Picker menu.}
3384         \label{fig:title04}
3385 \end{figure}
3386
3387
3388 \begin{enumerate}
3389     \item The hex value of the color you choose shows in the textbox and you can also keyin a value there.
3390     \item A small square next to the hex text box, is a green \textit{eyedropper} color picker. Use the left mouse button to click on the square to enable picking and you will see it turn red to designate that it is enabled. Your cursor will switch to a two-colored reticle. You can now move the mouse around to choose a color anywhere on the screen and then click there to have it picked. If you hold down the right or left mouse button while moving, you can see the color changing in the vertical bar in the color palette area as you move to give you a bigger view of the actual color.
3391     \item A history of $16$ of your last chosen colors is available to easily use again. Any time you choose a new color in any methodology, it will become the latest choice in the history either immediately or after checking OK/and leaving. History shows latest color starting left to right.
3392     \item Besides HSV, RGB, there is also a YUV color model to choose from.
3393     \item Several of these items may have associated \textit{Tool Tips}.
3394 \end{enumerate}
3395
3396 \subsubsection*{Font Choice}%
3397 \label{ssub:font_choice}
3398 The X Window system originally did not have a suitable font renderer for video. It also is restricted to the current bit depth. It does not have a convenient way to know which fonts work with the suitable font renderer in the desired bit depth. The easiest way we have found to support fonts in the titler is to have a directory for them at \texttt{/usr/lib/cinelerra/fonts}.
3399 Or if not system installed, at \texttt{<cinelerra\_install\_path>/bin/plug\-ins/fonts}.
3400
3401 In order to choose a font faster, you can keyin the first few characters of the font name, being sure to use capital characters if used since it is case-sensitive. The steps to follow are:
3402
3403 \begin{enumerate}
3404     \item next to the font box, click on the \textit{down arrow} pulldown;
3405     \item keyin the first character(s) of the desired font and you will see the first match become highlighted;
3406     \item you can see the characters you keyed in the upper right corner of the fonts.
3407 \end{enumerate}
3408 It is important to note that because there are checkboxes for both Bold and Italic, the pulldown will not include these specific fonts
3409 as an addition to a Regular font.  They will be used via the checkboxes but not viewed in the pulldown.
3410
3411 One last item of information about fonts that may lead to some confusion. The checkbox for Bold and Italic will occasionally be ghosted out if no bold or italic version of the selected font is available. This is no guarantee, but currently as good as it can get due to inconsistency in the creation of fonts. It is mostly just a hint. If boxes are checkmarked, but ghosted, you can not uncheck until you change to a font that does not ghost out the boxes. If you use the popup helper with the boxes checked, and attempt to keyin a font that does not have the bold/italic attribute as checked, the font will be considered illegal.
3412
3413 Also of note, if the video is displayed on a consumer TV, the outer border is going to be cropped by $5\%$ on each side. To avoid text which is too close to the edge looking bad, you may want to enable the \textit{title-safe} tool in the compositor window. The text should not cross the inner rectangle.
3414
3415 \subsubsection*{Font Addition / Font Subtraction}%
3416 \label{ssub:font_addition_subtraction}
3417
3418 If using a compiled build (that is, NOT an AppImage) to add true type fonts, copy the \texttt{.TTF} files to the fonts directory at \texttt{/usr/lib/cinelerra/fonts}
3419 or if not system installed, at \texttt{<cinelerra\_install\_path>/bin/plug\-ins/fonts}. In that directory run
3420 \vspace{1ex}
3421 \begin{lstlisting}[style=sh]
3422     # /usr/lib/cinelerra/fonts
3423     ttmkfdir && mv fonts.scale fonts.dir
3424 \end{lstlisting}
3425 and restart \CGG{}. The new fonts should appear. However, keep in mind that the next
3426 time you install a new version of CINELERRA-GG, your changes will be written over so
3427 you will have to make sure to save them elsewhere and then re-establish.
3428 The usage of ttmkfdir changes frequently so this technique might not work.  The titler supports mainly \textit{TTF}, true type fonts. It supports others such as OTF, but TTF are the most reliable. 
3429
3430 AppImage does not provide this specific method unless you use the workaround as described in the Appendix \nameref{cha:faq_problems_workarounds}.
3431 However, if you use Ubuntu Studio 2304 with AppImage, you can easily add font files directly to ~/.fonts and you will have all of these available in the Title fonts list. And, there may be other operating systems with specific implementations that also allow for this easier methodology to add additional fonts.
3432
3433 Some of the system fonts are automatically included in the set of fonts being used by \CGG{}. The easiest way to add additional system or other application available fonts for the Title plugin's set, is to use ones available in specific directories on your computer as long as they have a \texttt{fonts.scale} file already set up. You can run \texttt{mkfontscale} to create this file within that directory. In order to include a specific directory you set an environment variable before starting \CGG{} which stays in effect until it is unset or until the next reboot. Below is the method and an example.
3434
3435 \vspace{1ex}
3436 \begin{lstlisting}[style=sh]
3437 export BC_FONT_PATH=<colon-separated-search-path-for-fonts>
3438 export BC_FONT_PATH=/usr/share/fonts
3439 \end{lstlisting}
3440
3441 The current set of fonts in \CGG{}'s directory will be automatically included and will be the default set if this environment variable is not set. Keep in mind that if you add a lot of fonts, it will considerably slow down the startup every time you bring up the Title plugin.
3442
3443 If you want to only have a limited number of fonts set up, you can manipulate the \CGG{} directory directly at \texttt{<cinelerra\_install\_path>/bin/plug\-ins/fonts}.
3444 Here you will find the default set of fonts that come with the install. Copy any other fonts you would like to include here with read permission, delete any fonts you do not want to have, then execute \texttt{mkfontscale} which creates the file \texttt{fonts.scale} that \CGG{} will read. However, the next time you install a new version of \CGG{}, your changes will be written over so you will have to make sure to save them elsewhere and then re-establish.
3445
3446 If you have problems with a specific font or set of fonts, there is a debug option available to determine which font is an issue. When starting \CGG{}, you should set up the variable:
3447
3448 \vspace{1ex}
3449 \begin{lstlisting}[style=sh]
3450 export BC_FONT_DEBUG=1  (default is 0 for no debug)
3451 unset BC_FONT_DEBUG             (to remove debug messages)
3452 \end{lstlisting}
3453
3454 Then start \CGG{} from a terminal window to see the fonts being loaded and previewed in the Titler. This should point out any issues. Another debug methodology is to remove all fonts from being used and subsequently add in the ones that you want.
3455 This not only speeds the load up, it ensures that the fonts you actually are using are the ones you expect because the order that
3456 \CGG{} finds various fonts makes a difference in which one of potential duplicates shows up in the
3457 pulldown.  So you might not see the one you expect if it was written over by a system font.
3458
3459 \vspace{1ex}
3460 \begin{lstlisting}[style=sh]
3461 export BC_FONT_PATH=:   #(the : "colon" removes all automatic system and Cinelerra fonts)
3462 export BC_FONT_PATH=:/usr/share/fonts #(remove all fonts and then add /usr/shar/fonts)
3463 \end{lstlisting}
3464
3465 \subsubsection*{Kerning}%
3466 \label{ssub:kerning}
3467
3468 When using the Titler, kerning is applied in order to allow parts of a letter to go outside the standard sized letter box.  Kerning is the process of adjusting the space between individual letters.  It is not the same as proportional spacing.  In kerning, a bounding box is allowed to overlay another bounding box.  The philosophy here is to aim at the ability to have boxes overlap in order to make the letters look more visually appealing.  Bounding box and escapement are tracked separately.  In addition to adjusting individual letter spacing, the program will also expand the render box in order to have any parts of the letter extend outside the standard letter box.  Kerning is applied to any and all fonts (figure~\ref{fig:title05}).
3469
3470 \begin{figure}[hbtp]
3471         \centering
3472         \includegraphics[width=0.4\linewidth]{title05.png}
3473         \caption{Kerning in action}
3474         \label{fig:title05}
3475 \end{figure}
3476
3477 \subsection{Tracer}%
3478 \label{sub:tracer}
3479 \index{tracer}
3480
3481 Tracer creates an outline around an object after a few points are designated, so it traces the object. Its operates in a similar manner to that of Gimp's \textit{magic wand}. You can then Fill the alpha channel with a mask, like with a gradient or another object on another track or Invert that fill. Although it works best for still images or objects that stay in the same place on a video like a logo, you can also add keyframes. To limit the mis-tracking that occurs when working on a moving object, we can increase the number of points so that the tracking is more accurate and relies on a solid foundation. Rather than \textit{points} as in a mask, tracer is based on \textit{edges} to form an outline (figure~\ref{fig:tracer-01}). Frequently it will be desirable to use either RGB or YUV as the color model without the -A for Alpha.
3482
3483 \begin{figure}[hbtp]
3484         \centering
3485         \includegraphics[width=0.55\linewidth]{tracer-01.png}
3486         \caption{Gui for Tracer plugin}
3487         \label{fig:tracer-01}
3488 \end{figure}
3489
3490 \begin{description}
3491         \item[New] to create a new point.
3492         \item[Up/Dn] to move highlighted point up or down.
3493         \item[Del] to delete the highlighted point.
3494         \item[X, Y] are the point’s $x/y$ coordinate.
3495         \item[Invert] to change the mask to outside.
3496         \item[Feather] to sort of blur the edges (inward and outward). Feather influences the softness of the edge. The higher the number Feather is set to, the softer the edges become.
3497         \item[Radius] for varying the size a little. Radius extends the area further in or out to cover more or less area.
3498         \item[Drag] to enable or disable moving.  If you need to clear the Drag enabled, you can easily do this with \textit{Allow keyframe spanning} whose use is described in \nameref{sec:allow_keyframes_spanning}.
3499         \item[Draw] to draw the outline for visual.
3500         \item[Fill] to black out the object (no alpha); figure~\ref{fig:tracer-02}.
3501         \item[Mouse wheel] rotate the outline, centered on cursor. Note that this rotates the outline around the nearest point. The slower you scroll, the more precise the the result. If you scroll faster, an accelerator kicks in that allows you to make complete rotations more quickly.
3502         \item[Mouse wheel + shift] scale the outline, centered on cursor.
3503 \end{description}
3504
3505 \begin{figure}[hbtp]
3506         \centering
3507         \includegraphics[width=0.7\linewidth]{tracer-02.png}
3508         \caption{Rug in the top picture is traced in order to black it out or replace later}
3509         \label{fig:tracer-02}
3510 \end{figure}
3511
3512 Be sure to uncheck \textit{Draw} and \textit{Drag} before rendering so that the lines do not show in the video output.
3513
3514
3515
3516 \subsection{Translate}%
3517 \label{sub:translate}
3518 \index{translate}
3519
3520 This effect allows displacing, cropping, and/or scaling the source video horizontally and/or vertically. The \textit{In} and \textit{Out} parameters operate similar to the \textit{camera} and \textit{projector} functions in the Compositor:
3521
3522 \begin{description}
3523     \item[In X/Y] specifies how many pixels from the left/top of the source you want to start (camera).
3524     \item[Out X/Y] defines where on the screen you want the output to start (projector).
3525     \item[In W/H] defines how many pixels of the source you want to include in each direction.
3526     \item[Out W/H] defines how many pixels on the screen you want that source to take up.
3527 \end{description}
3528
3529 Identical values for both \textit{In} and \textit{Out} that are less than the source dimension will simply crop the source. Different values will stretch (or compress if \textit{Out > In}) the source in that direction (and crop if \textit{In} is less than the source dimension).
3530
3531 This effect supports keyframes so these parameters can change smoothly over time. You can use this effect for many things such as having a cropped insert clip move across the screen, or have it change size or stretch while doing so. Be forewarned though, that for interlaced footage horizontal displacements are likely to destroy the field order, resulting in all sort of flickering and jumping movements.
3532
3533 \subsection{Unsharp}%
3534 \label{sub:Unsharp}
3535 \index{unsharp}
3536
3537 This effect applies a traditional \textit{darkroom} technique, the so called \textit{unsharp mask} to every video frame. With different parameter values, this can be used to soften or to sharpen the image. You can use sliders or, for maximum precision, you can use the input box. Its parameters are:
3538
3539 \begin{description}
3540     \item[Amount] moving the slider to the right makes dark areas get darker and light areas get lighter.
3541     \item[Radius] this slider controls how much blurring is used in the \textit{edge-finding} stage. The practical effect of this is to specify how large a region is darkened or lightened.
3542     \item[Threshold] this slider controls how big a difference between a pixel in the blurred copy and the original copy is needed before any darkening or lightening will be applied.
3543     \item[Clear] to reset its slider to default without affecting others.
3544 \end{description}
3545
3546 \subsection{Videoscope}%
3547 \label{sub:videoscope}
3548 \index{videoscope}
3549
3550 Videoscope summarizes intensity and color on a calibrated display. The Videoscope can be used in conjunction with other \CGG{} plugins such as \textit{Color 3 Way}, \textit{YUV}, \textit{Brightness}, \textit{Color Balance} or \textit{Histogram} to accurately correct video for contrast, clarity, conformance (to normalize various videos shot under different light settings), or for cinematic purposes. The human eye is not specialized to match precise level of light and color, but Videoscope is. Videoscope contains three displays: the waveform scope and the vectorscope, plus the histograms (figure~\ref{fig:videoscope01}). Instead of applying the plugin to the tracks/edits we want to examine, we can use the Videoscope buttons in the Composer and Viewer windows. \includegraphics[height=\baselineskip]{scope.png} In this way the monitors act on the frame indicated by the insertion point, without taking into account the stack of tracks or on which edits to apply the plugin.
3551
3552 \begin{figure}[hbtp]
3553         \centering
3554         \includegraphics[width=1.0\linewidth]{videoscope01.png}
3555         \caption{GUI of the Videoscope. You see Histogram, RGB Parade and Vectorscope}
3556         \label{fig:videoscope01}
3557 \end{figure}
3558
3559 When using the X11 graphics driver and RGBA-FLOAT color model, Videoscope allows you to display greater than (0 - 1.0f) values  to accomodate HDR. This does not work when using X11-OpenGL because it is an 8-bit limited driver. The display will stop at -10\% or +110\%, but there is no clipping.  For example, by varying the brightness all out-of-range values become visible on Waveform, even over 110\%. However you must disable the "smooth" option which always causes clipping.
3560
3561 The Videoscope menu window has many options.
3562
3563 \paragraph*{Scopes:} we can choose between two histograms:
3564
3565 \begin{itemize}[noitemsep]
3566         \item \textit{Histogram}
3567         \item \textit{Histogram RGB}
3568 \end{itemize}
3569 three waveforms: 
3570 \begin{itemize}[noitemsep]
3571         \item \textit{Waveform}
3572         \item \textit{Waveform RGB} (aka RGB Parade)
3573         \item \textit{Waveform Ply} (which superimposes the three Waveform RGB graphs in a single view.)
3574 \end{itemize}
3575 and two vectorscopes: 
3576 \begin{itemize}[noitemsep]
3577         \item \textit{Vectorscope}
3578         \item \textit{VectorWheel}
3579 \end{itemize}
3580
3581 \paragraph*{Settings:} It is divided into two sections. The upper section contains two items:
3582
3583 \begin{description}
3584         \item[Smooth:] serves to make the graph more homogeneous, improving its visualization. However, it has a side effect: in case of frames that have data in the range of 100-110\% (i.e., outside the normal range of 0-100\%, also called super-white), it causes a clip by cutting off this data and reporting only of normal data. If we don't want this clip disable Smooth.
3585         \item[Refresh on Stop ON:] [checked -- only for Transport buttons] scopes are updated when you stop playback at a given location. Instead, they are locked at the start position while you playback. This saves system resources and makes playback smoother. By dragging the cursor the scopes are updated in realtime.
3586         \item[Refresh on Stop OFF:] [unchecked -- for Transport buttons and dragging cursor] the display of the scopes is synchronized with the playback. Every variation of the graphs is in realtime. There may be some decrease in fps during playback.
3587         \item[Refresh on Release:] This works for the Viewer and Compositor windows. Scopes are not updated during playback. The update occurs only when you stop playback, that is at the final position (either by dragging the cursor or using the Transport buttons). When in the timeline, if you drag on the TimeBar or reposition in the TimeBar in either Drag and Drop or Cut and Paste mode, the release of the button also will update the Scopes.  This saves system resources and makes playback smoother.  Because there is no update when playing in the main window, you can still easily get a videoscope update simply by moving the mouse to the Compositor and a single click there will update the scopes without changing the frame (as long as Click to Play is not enabled).
3588 \end{description}
3589
3590  The lower section, called \textit{VectorWheel Grids}, it is only active when VectorWheel is set up in Scopes pull-down and contains four entries (figure~\ref{fig:videoscope06}):
3591
3592  \begin{figure}[hbtp]
3593         \centering
3594         \includegraphics[width=1.0\linewidth]{videoscope06.png}
3595         \caption{Pull-down Settings}
3596         \label{fig:videoscope06}
3597  \end{figure}
3598  
3599  \begin{description}
3600         \item[None:] It only shows the colour wheel, without any superimposed graticula.
3601         \item[All:] Shows the most complete grid that allows precise and useful measurements. It also shows the skintones area.
3602         \item[Hue:] Show a more minimal grid.  It also shows the I-Line.
3603         \item[IQ:] Show shows only I-Line and Q-Line.
3604  \end{description}
3605
3606
3607 You can create custom grids. These are raster .png images of adequate resolution and must be put in:
3608
3609 \begin{lstlisting}[style=sh]
3610 [your cinelerra path]/bin/plugins/scopes/custom_grid.png
3611 \end{lstlisting}
3612
3613 More information in the later section on Vectorscope.
3614
3615 \paragraph*{Sliders:} allow for varying the \textit{solidity} of the dots shown in Waveforms and Vectorscope. You can get to the subpixel level for precision. They are accompanied by Reset buttons that restore them to default values.
3616
3617
3618
3619 \subsubsection*{Waveform/RGB Parade/Waveform Ply}%
3620 \label{ssub:waveform_rgb_parade_ply}
3621 \index{videoscope!waveforms}
3622
3623 The \textit{Waveform Scope} displays image intensity (luminance) versus image $X$ position. The \textit{Waveform RGB} displays image RGB intensity versus image $X$ position (one graph per channel). The \textit{Waveform Ply} shows the three channels in a single graph. The Waveform Scope appears on the left side or in the middle of the Videoscope window. The display is calibrated vertically from $0\%$ intensity (black) at the bottom up to $100\%$ intensity (white) at the top. Each column of pixels in the image corresponds to one column of pixels in the Waveform Scope (figure~\ref{fig:videoscope02}). Note that the height of the values of a waveform/waveform RGB corresponds exactly to the values on the $x\, axis$ in the \textit{histogram}. A vertical/horizontal correspondence is therefore obtained.
3624
3625 \begin{figure}[hbtp]
3626     \centering
3627     \includegraphics[width=1.0\linewidth]{videoscope02.png}
3628     \caption{Colortest 75\% with Waveform RGB (left) and Waveform (right)}
3629     \label{fig:videoscope02}
3630 \end{figure}
3631
3632 On the left is shown waveform RGB: instead of the color shadows as in figure~\ref{fig:videoscope01}, we have lines representing the color bar test at $75\%$. They are pure colors, so all pixels have the same value. In fact, they are all at the level of $75\%$ except for the $100\%$ white band and the $0\%$ black band. In the waveform on the right, we have the same behavior with regard to luminance: the white band is $100\%$; the black band is $0\%$ and all the others $75\%$.
3633
3634 If we left-click on the graph with the mouse, we will see a crosshair that we can place exactly where we want to measure. We can read the precise values of X and Luminance (Value) in the pop-up box that appears at the bottom right (figure~\ref{fig:videoscope03}).
3635
3636 \begin{figure}[hbtp]
3637         \centering
3638         \includegraphics[width=1.0\linewidth]{videoscope03.png}
3639         \caption{Examples of waveform (with crosshair and the coordinates' box), waveform RGB and waveform Ply}
3640         \label{fig:videoscope03}
3641 \end{figure}
3642
3643 The Waveform scope helps correct image light levels for contrast range or for conforming light levels on various scenes originally shot on different light settings. The same can be done with Waveform RGB or the convenient overlapping representation (Waveform Ply).
3644
3645 \subsubsection*{Adjusting luminance}%
3646 \label{ssub:adjusting_luminance}
3647
3648 \begin{enumerate}
3649     \item Add the \textit{Brightness/Contrast}, \textit{Histogram}, \textit{Color 3 Way} or another video adjustment effect on your track/edit.
3650     \item Add the Videoscope effect on the track. Make sure that it is placed below in the stack of effects, so it can see the adjustment effect's results. If it is not, right-click and move it down. Or do not use the plugin but activate the Videoscope button in the Compositor window.
3651     \item Show both the effect and Videoscope.
3652     \item Adjust the contrast while observing the waveform to match the desired light level.
3653     \item Precise adjustments can be made by measuring the values on the waveform with the crosshair (by clicking LMB, and reading numeric values on the pop-up box) and reporting these numbers in the effects window (\textit{Histogram Bézier}, for example).
3654 \end{enumerate}
3655
3656 For example, if you are looking for maximum contrast range, adjust the \textit{Brightness/Contrast} levels to align the darkest point on the scope with the $0\%$ level and the brightest portion with $100\%$. Anything above $100\%$ is over saturated. Limits may be highlighted with checkbox controls.
3657
3658 \subsubsection*{HDTV or sRGB (ITU-R BT.709)}%
3659 \label{ssub:hdtv_srgb_bt709}
3660
3661 The maximum pixel range for HDTV or sRGB is $[0, 255]$. This range corresponds with levels $0\%$ and $100\%$.
3662
3663 \subsubsection*{MPEG or Analog video (ITU-R BT.601)}%
3664 \label{ssub:mpeg_analog_video_bt601}
3665
3666 For analog video or MPEG (including DVD), the maximum range for RGB is $[16, 235]$ ($8\, bit$). For YUV, the maximum range for intensity (Y) is $[16, 235]$ ($8\, bit$). This range corresponds to gray levels from $6\%$ to $92\%$. Reference \textit{RGB-601} plugin.
3667
3668 \subsubsection*{NTSC Television broadcast}%
3669 \label{ssub:ntsc_television_broadcast}
3670
3671 If you are producing a video for NTSC television broadcast, keep the intensity between $7.5\%$ and $100\%$. The minimum black value which can be broadcast is IRE $7.5\%$ (indicated by the \textit{7.5 level}), and values below this level are no darker.
3672
3673 \subsubsection*{Vectorscope}%
3674 \label{ssub:Vectorscope}
3675 \index{videoscope!vectorscope}
3676
3677 The Vectorscope displays \textit{hue} (angle on the color wheel) and \textit{saturation} (radius). Each pixel in the source image is drawn as a point on the color wheel. The distance from the center is the color saturation. Gray values are close to the center, and high saturation values are near the perimeter ($100\%$). In the center there is pure white ($0\%$). By clicking with the mouse on the color wheel a radius and circle will appear whose values of hue and saturation are shown in the  pop-up box at the bottom right of the window, similar to the values of $X$ and luminance of the Waveform and RGB Parade (figure~\ref{fig:videoscope05}).
3678
3679 \begin{figure}[hbtp]
3680         \centering
3681         \includegraphics[width=0.8\linewidth]{videoscope05.png}
3682         \caption{Vectorscope (with H/S pop-up box) and VectorWheel (with 3 default grids)}
3683         \label{fig:videoscope05}
3684 \end{figure}
3685
3686 Note that when you choose \textit{VectorWheel} from \textit{Scopes} pulldown, you can choose between different grids in the \textit{Settings} pulldown. In addition, any number of user-supplied grid patterns can be added in the form of a square image of type png.  The user can design and maintain individual grid overlays for various purposes.  The user would keep their overlays in a safe spot on their disk and make a copy of them in the \texttt{\{cinelerra\_pathname\}/bin/plugins/scopes} every time a new version of \CGG{} is installed.
3687
3688 Generally the Vectorscope has the following uses:
3689
3690 \begin{enumerate}
3691         \item Compare saturation levels (radius) between Edits.
3692         \item Compare the hues (angle) between Edits.
3693         \item Compare skin tones, sky and vegetation.
3694         \item Display the color balance or color cast.
3695         \item Check the legal limits of the video signal.
3696 \end{enumerate}
3697
3698  For example, skin tones are found along an axis (\textit{+ I-line}) between yellow and red, and between $0$ and $50\%$ saturation values. The blue of the sky is more or less along the opposite axis to that of the skin (\textit{- I-line}), with a much wider saturation range.
3699
3700 \begin{figure}[hbtp]
3701     \centering
3702     \includegraphics[width=0.9\linewidth]{videoscope04.png}
3703     \caption{Balancing a yellow color cast}
3704     \label{fig:videoscope04}
3705 \end{figure}
3706
3707 In figure~\ref{fig:videoscope04}, the top image is white balanced. Vectorscope shows many pixels in the yellow region and few in the white region. To remove the yellow tint, the Color Balance effect is used to first shift the vectorscope plot towards magenta (Mg), and then towards blue (B) until the region previously near the center surrounds the center. In the bottom image, yellow highlights have become white highlights (green triangles). Note that the corresponding features in waveform also appear whiter (green triangles).
3708 The Vectorscope can also be used to verify that the video output will display properly on various monitors. Any points along the inner radius will be displayed as pure white and any points above the $100\%$ radius, will probably not be correctly displayed on the screen.
3709
3710 \subsubsection*{Histogram}%
3711 \label{ssub:histogram}
3712 \index{videoscope!histogram}
3713
3714 You can also display the 4 histograms (master or RGB) on the left of the window. (see figure~\ref{fig:videoscope01}).
3715
3716 \subsection{Wave}%
3717 \label{sub:wave}
3718 \index{wave}
3719
3720 The \textit{wave} effect adds waves on the image. \textit{Amplitude}, \textit{Phase}, and \textit{Wavelength} parameters can be adjusted. You can use sliders or, for maximum precision, you can use the input box. With the \textit{Clear} buttons we can bring the slider to default values without affecting the other parameters.
3721
3722 \subsection{Whirl}%
3723 \label{sub:whirl}
3724 \index{whirl}
3725
3726 Creates a whirl (spiral) of the video around the center. You can use sliders or, for maximum precision, you can use the input box. With the \textit{Clear} buttons we can bring the slider to default values without affecting the other parameters.
3727
3728 \subsection{YUV}%
3729 \label{sub:yuv}
3730 \index{yuv}
3731
3732 Modify the Y, U, V settings. You can use sliders or, for maximum precision, you can use the input box. With the \textit{Clear} buttons we can bring the slider to default values without affecting the other parameters.
3733
3734 \subsection{YUV411}%
3735 \label{sub:yuv411}
3736 \index{yuv411}
3737
3738 YUV411 plugin\protect\footnote{credit Eric Olson}
3739 modifies the 411 yuv to look like 420 color space instead. If the edit to which the effect is applied is not YUV type, a red warning message will appear.
3740
3741 \subsection{YUVShift}%
3742 \label{sub:yuvshift}
3743 \index{yuv shift}
3744
3745 \begin{figure}[hbtp]
3746         \centering
3747         \includegraphics[width=0.8\linewidth]{yuvshift.png}
3748         \caption{Before and after YUVShift adjusting}
3749         \label{fig:yuvshift}
3750 \end{figure}
3751
3752 This effect is used for YUV input video from older cameras using $3$ sensors. It is possible to have misalignment of the $3$ sets of numbers: \textit{Y}, which represents the luminance or brightness component, and for \textit{U} and \textit{V} representing the chrominance (color) components. If they were misaligned in the video, you can use \textit{YUVShift} to realign. To move a specific component up/down, modify the \textit{dy} value using the slider bar in the RGBShift window. To move a component left/right, modify the corresponding \textit{dx} value. For maximum precision you can use the input box. With the \textit{Clear} buttons we can bring the slider to default values without affecting the other parameters. If you are using an RGB color space, you will want to use the \textit{RGBShift} effect instead.
3753
3754 Figure~\ref{fig:yuvshift} (top) shows the blue \textit{U} component aligned too far to the right/down. And the red \textit{V} component is misaligned too far to the right/down. Note the \textit{U\_dx} current slider bar set to $0$ as shown by the input box value in the YUVShift plugin window. All components are currently at zero.
3755 A corrected video image is shown in the bottom. Now the red and blue colors are correctly aligned. Note how \textit{U\_dx} is now at $+26$ and \textit{V\_dx} is now $+41$ to realign the image.
3756
3757 \subsection{Zoom Blur}%
3758 \label{sub:zoom_blur}
3759 \index{zoom blur}
3760
3761 Blurs the video from the center outwards, like the sun’s rays, and uses a zoom effect.
3762
3763 \begin{figure}[hbtp]
3764         \centering
3765         \includegraphics[width=0.8\linewidth]{zoom.png}
3766         \caption{For clarity of presentation only 3 fields are shown}
3767         \label{fig:zoom}
3768 \end{figure}
3769
3770 \begin{description}
3771     \item[X,Y] center of the origin field.
3772     \item[Radius] Zoom on the fields.
3773     \item[Steps] number of blur steps to be used in the calculation. Increasing the number takes more CPU.
3774     \item[Clear] With the Clear buttons we can bring the slider to default values without affecting the other parameters.
3775     \item[Reset] To reset all parameters to default at the same time.
3776 \end{description}
3777
3778 You can use sliders or, for maximum precision, you can use the input box.
3779 Figure~\ref{fig:zoom} shows the parameters: Radius=21 and Steps=3.
3780
3781 \section{CUDA plugins}%
3782 \label{sec:cuda_plugins}
3783 \settocdepth{section}
3784 \index{CUDA!plugin}
3785
3786 Only for Nvidia GPU and Cuda SDK
3787
3788 \subsection{Mandelbrot}%
3789 \label{sub:mandelbrot}
3790 \index{CUDA!mandelbrot}
3791
3792 Produce fractal figures (figure~\ref{fig:mandelbrot}). Use case:
3793
3794 \begin{figure}[hbtp]
3795         \centering
3796         \includegraphics[width=0.8\linewidth]{mandelbrot.png}
3797         \caption{Mandelbrot Cuda plugin}
3798         \label{fig:mandelbrot}
3799 \end{figure}
3800
3801 \begin{enumerate}
3802         \item add the Mandelbrot Cuda video effect to the timeline
3803         \item you must enable Drag in the plugin popup menu
3804         \item drag the mouse with the RMB down and you will see the fractal change
3805         \item enable "Generate keyframes while tweaking" and move to another spot on the timeline and RMB drag again
3806         \item so now when you play the video from the beginning because you have keyframes, the fractal will be animated between keyframes.
3807 \end{enumerate}
3808
3809 \subsection{N\_Body}%
3810 \label{sub:n_body}
3811 \index{CUDA!n\_body}
3812
3813 Produce animated particles (figure~\ref{fig:n_body}).
3814
3815 \begin{figure}[hbtp]
3816         \centering
3817         \includegraphics[width=1.0\linewidth]{n_body.png}
3818         \caption{N\_Body Cuda plugin}
3819         \label{fig:n_body}
3820 \end{figure}
3821
3822 \section{OpenCV plugins}%
3823 \label{sec:opencv_plugins}
3824 \settocdepth{section}
3825 \index{openCV}
3826
3827 There are currently 6 OpenCV plugins hooked into Cinelerra static and dynamic tars with the most
3828 widely known being FindObj.  The \textit{Find Object} plugin searches a Scene for an Object and
3829 then the Object can be overlaid with a Replacement object. The other 5 are FlowObj, GaborObj,
3830 MoveObj, PuzzleObj, and StylizeObj. These  plugins require the thirdparty \textit{OpenCV}
3831 (Open Computer Vision) library.  Of note for OpenCV is that the \textit{Surf} algorithm is non-free
3832 and has been removed from the user supplied versions of OpenCV being built.
3833
3834 There are some potential pitfalls with using OpenCV to include:
3835
3836 \begin{enumerate}
3837     \item openCV code is constantly changing, making it difficult to keep the plugins up to date
3838     \item there is some confusion about licensing/patents for specific algorithms, notably Surf
3839     \item some parts don’t work all that well and it can be slow
3840     \item internally the colormodel is converted to greyscale, which means the color information
3841 is not used
3842     \item cmake is minimally required to be at version 3.5.1 for OpenCV version 4.2; therefore
3843 for some older verions of distros with a lower cmake version, OpenCV is only at 3.4.1; and in
3844 really old versions such as Ubuntu14 32/64 bit, it is not in the build at all
3845 \end{enumerate}
3846
3847 Because of the build size of OpenCV, the source is not included in the thirdparty directory.
3848 Building OpenCV adds a lot of storage demand ($4\,GB$) to the \CGG{} build tree, and its compile
3849 time is significant. For these reasons, \textit{findobject} and the other 5 plugins are not
3850 included in System build packages.  We recommend using the static library build which has the OpenCV
3851 plugins included for consistency and to avoid problems.
3852
3853 \subsection{Adding OpenCV Plugins to the System Package Builds}%
3854 \label{sub:adding_opencv_to_system_builds}
3855
3856 The OpenCV plugins are built only in the 64-bit tarball builds, both static and dynamic, but due
3857 to size these plugins are not included with pkgs, i.e. the System builds. However it is relatively
3858 easy to add the current plugins for your distro via a simple procedure of copying the plugins
3859 from the static tarball to the cin5 install plugin path (AppImage does not provide this capability). They are:
3860
3861 \begin{lstlisting}[style=sh]
3862 cin/plugins/opencv/findobj.plugin
3863 cin/plugins/opencv/flowobj.plugin
3864 cin/plugins/opencv/gaborobj.plugin
3865 cin/plugins/opencv/moveobj.plugin
3866 cin/plugins/opencv/puzzleobj.plugin
3867 cin/plugins/opencv/stylizeobj.plugin
3868 \end{lstlisting}
3869
3870 \begin{enumerate}
3871     \item do your package install of the current build for your distro as usual
3872     \item look in {\small \url{https://cinelerra-gg.org/download/tars}} to see your distro name's static tar
3873     \item download the corresponding distro static tarball;
3874     for example for arch:
3875 \end{enumerate}
3876
3877     {\small \url{https://cinelerra-gg.org/download/tars/cinelerra-5.1-arch-{date}-x86_64-static.txz}}
3878
3879 \begin{enumerate}[resume]
3880     \item create a temporary directory on your computer
3881     \item \texttt{cd} that-directory
3882     \item \texttt{tar -xf} location-of-the-tarball-you-downloaded
3883     \item \texttt{cp plugins/opencv/*obj.plugin <see below for your location>/.} (note the period on the end)
3884     \item Start \CGG{} and look for the six plugins in Video Effects
3885     \item To reverse this, simply delete the six plugin files (for example:
3886
3887     \texttt{rm /usr/lib*/cin*/*obj.plugin}).
3888 \end{enumerate}
3889
3890 The location for most User installs is:
3891
3892 \hspace{4em}\texttt{<cinlib\_path>/plugins/video}
3893
3894 Location for some System installs is:
3895
3896 \hspace{4em}\texttt{/usr/lib/cin/plugins/video} (most ubuntu distros)
3897
3898 \hspace{4em}\texttt{/usr/lib64/cin/plugins/video} (Leap distro)
3899
3900 \subsection{How to Build OpenCV Plugins}%
3901 \label{sub:how_build_opencv_plugins}
3902
3903 For users who do their own build or for administrators who want to create a System build that
3904 includes OpenCV, here are some notes to facilitate doing so.  Building findobject will configure
3905 and build OpenCV into the thirdparty library build area if needed (it does not rebuild if done
3906 previously).  Network access is required to obtain the OpenCV source, at least once. You will
3907 need a minimum of $4\, GB$ in the thirdparty build directory and more time to compile.
3908
3909 \subsubsection*{Build using stable tarballs}%
3910 \label{ssub:stable_tars}
3911
3912 Instead of using the latest git version, there is a custom archive source tarball on the
3913 website already created to build and test OpenCV versions.  The reason for this is that OpenCV
3914 is quite volatile, and may or may not work on any given day so this is an already tested version
3915 that is considered to be more stable.  A build using the tarball requires that your
3916 system have \textit{wget} already installed to initially download the prepared source tar. 
3917 There are currently 2 tarballs of stable versions on the website used for user builds.
3918 The 20180401 version:\newline
3919 {\small \url{ https://cinelerra-gg.org/download/opencv/opencv-20180401.tgz}}\newline
3920 works with older version of cmake, and 20200308 is the current 4.2 release:\newline
3921 {\small \url{https://cinelerra-gg.org/download/opencv/opencv-20200306.tgz}}
3922
3923 To build using the tarballs on the website, use this bld.sh procedure (you may want to run "make
3924 clean" first):
3925 \begin{lstlisting}[style=sh]
3926 #!/bin/bash
3927 ( ./autogen.sh
3928   ./configure --with-single-user --with-booby \
3929     --with-opencv=sta,tar=http://cinelerra-gg.org/download/opencv/opencv-20200306.tgz
3930   make && make install ) 2>&1 | tee log
3931 mv Makefile Makefile.cfg
3932 cp Makefile.devel Makefile
3933 \end{lstlisting}
3934
3935 \subsubsection*{Build using current git version}%
3936 \label{ssub:current_git}
3937
3938 To build findobject and the other plugins using OpenCV, access the src using git:
3939
3940 \begin{lstlisting}[style=sh]
3941 git clone --depth 1 "git://git.cinelerra-gg.org/goodguy/cinelerra.git" cinelerra5
3942 \end{lstlisting}
3943 To use the latest version, the method for creating a tarball is:
3944  
3945 \begin{enumerate}
3946      \item download both opencv and opencv\_contrib source tarballs from the web:
3947        {\small \url{https://sourceforge.net/projects/opencvlibrary/files/4.2.0/}}
3948        {\small \url{https://github.com/opencv/opencv\_contrib/archive/4.2.0.tar.gz}}
3949      \item create a temporary directory opencv\_src and unpack the tarballs into the src directory
3950      \item rename these sources to opencv and opencv\_contrib
3951      \item run a test build, using opencv\_build for config:
3952 \end{enumerate}
3953
3954 \begin{lstlisting}[style=sh]
3955 cd opencv\_src
3956 mkdir build
3957 cd build && cmake \
3958   -DCMAKE\_BUILD\_TYPE=RELEASE \
3959   -DWITH\_IPP=OFF \
3960   -DWITH\_LAPACK=OFF \
3961   -DWITH\_GPHOTO2=OFF \
3962   -DBUILD\_SHARED\_LIBS=ON \ 
3963   -DINSTALL\_C\_EXAMPLES=ON \
3964   -DINSTALL\_PYTHON\_EXAMPLES=ON \
3965   -DBUILD\_EXAMPLES=ON .. \
3966   -DBUILD\_opencv\_python3=no \
3967   -DCMAKE\_INSTALL\_PREFIX=/usr/local \
3968   -DOPENCV\_EXTRA\_MODULES\_PATH="\$(opencv)\_contrib/modules/"
3969 \end{lstlisting}
3970
3971 Next configure the build, but add the \texttt{-{}-with-opencv} configure parameter. An example
3972 of usage of shown next.
3973
3974 \begin{lstlisting}[style=sh]
3975 cd <path>/cinelerra-5.1
3976 ./autogen.sh
3977 ./configure <add std params, eg: --with-single-user> --with-findobect=sta
3978 --with-opencv may be set to [<bld>][,<src>]
3979 bld=typ sta,dyn,sys:     sta=static, dyn=shared, sys=system libraries
3980 src=typ git,tar,git=url,tar=url: git (default git\_url), tar (default: tar\_url)
3981
3982 # Use one of the following:
3983 --with-opencv=sta
3984 --with-opencv=dyn
3985 --with-opencv=sta,tar=https://cinelerra-gg.org/download/opencv/opencv-20180401.tgz
3986
3987 # For example: ./configure <params> --with-opencv=sta,git
3988 \end{lstlisting}
3989
3990 Once thirdparty/opencv is built, it will be reused.  To remove \texttt{thirdparty/opencv*}, use
3991 \texttt{mrclean}.
3992
3993 Ordinarily OpenCV requires the network to download pieces. But to avoid downloading the same
3994 source multiple times as you do test builds, you can instead use the following procedure.
3995
3996 \begin{enumerate}
3997      \item Create a new opencv\_src directory with the needed source (src) files, plus
3998 the missing pieces in ./opencv/.cache/;  This source base does not require the network, and
3999 so is usable for batch builds.  
4000      \item Store the tarballs in a safe location, and reference them from an httpd server
4001 running locally on the build system.  for example:\newline
4002 /var/www/html/cinelerra.patch\newline
4003 /var/www/html/opencv-20180401.tgz -> /mnt0/opencv-20180401.tgz\newline
4004 /var/www/html/opencv-20200306.tgz -> /mnt0/opencv-20200306.tgz\newline
4005      \item systemctl start httpd
4006 \end{enumerate}
4007
4008 \subsection{Description of Find Object Plugin}%
4009 \label{sub:description_findobj_plugin}
4010 \index{openCV!find object}
4011
4012 As in the standard OpenCV FindObj program, there are $5$ \textit{detector} methods and $2$ \textit{matcher} methods which can be selected. They detect features and match them as a rectangular projection. The matched region will be overlayed with a replacement image if replace object is enabled. This is done using a variety of feature detectors and region matches. The match works by creating sets of Feature points. These points are generated for both the source and reference object frames. Then the two sets are matched for \textit{Homography} (a regional similarity).
4013
4014 \subsubsection*{Matchers}%
4015 \label{ssub:matchers}
4016
4017 \begin{description}
4018     \item[FLANN] Fast Library for Approximate Nearest Neighbors
4019     \item[BF] (flann not selected) Brute Force
4020 \end{description}
4021
4022 \subsubsection*{Detectors Algorithm}%
4023 \label{ssub:detectors_algorithm}
4024
4025 \begin{description}
4026     \item[SIFT] Scale-Invariant Feature Transform
4027     \item[SURF] Speeded-Up Robust Features
4028  Be aware that \textit{Surf} is non-free and has been removed from versions of OpenCV being built.
4029  If you have used it in a past project, it could result in a SEGV crash.
4030     \item[ORB] Oriented fast and Rotated Brief
4031     \item[AKAZE] Accelerated Keypoint detector And descriptor Extractor
4032     \item[BRISK] Binary Robust Invariant Scalable Keypoin
4033     \item [Don’t Calculate] Do nothing
4034 \end{description}
4035
4036 The \CGG{} plugin has several additional features for ease of use and more flexibility. A description of parameters is outlined below.
4037
4038 \begin{description}
4039     \item[Mode:]
4040     \begin{itemize}[noitemsep]
4041         \item Square
4042         \item Rhombus
4043         \item Rectangle
4044         \item Parallelogram
4045         \item Quadrilateral (default)
4046     \end{itemize}
4047     \item[Reset:] to get back to the default values.
4048     \item[Algorithm:] detector selections as described above.
4049     \item[Replace object:] checked if replacing the object is the desired outcome.
4050     \item[Use FLANN:] use the Matcher, or if unchecked just use brute force.
4051     \item[Draw match:] will display a blue line around the matching object only for the purpose of verifying the placement. The starting point for the box is designated by a white outlined circle in corner \#1.
4052     \item[Scene/object/replace layer:] number designating the attachment track of each findobject plugin element.
4053 \end{description}
4054
4055 After matching, the resulting projection corners are used to do reshaping. The general procedure is:
4056
4057 \begin{itemize}[noitemsep]
4058     \item Calculate centroid, translate center to $0,0$; check for bowties and rotation direction.
4059     \item Calculate replacement object corners using \textit{mode}, \textit{central angles}, \textit{scale}, and \textit{aspect} of the projection.
4060     \item Using the replacement, apply the inverse aspect, rotation, scaling, and translation as specified.
4061 \end{itemize}
4062
4063 \subsubsection*{Selectable specifications}%
4064 \label{ssub:selectable_specifications}
4065
4066 \begin{description}
4067     \item[Aspect] when set, the matching aspect ratio is applied, otherwise the original object aspect is applied.
4068     \item[Scale] when set, the match surface area is used for scaling, otherwise the original surface area is used.
4069     \item[Rotate] when set, the match orientation is used in the projection, otherwise the original orientation is used (orthonormal).
4070     \item[Translate] when set, the match replacement is centered to the projection center, otherwise the original object center is used.
4071 \end{description}
4072
4073 Once the replacement corners are calculated, the replacement object is overlayed to the scene frame.
4074
4075 \begin{description}
4076     \item[Scene/Object/Replace Drag] only 1 can be checked on at a time (and that includes counting the \textit{Title}
4077     plugin \textit{drag box}). The Drag boxes are faster alternatives to using the column dials.
4078     \item[Scene/Object/Replace columns of X/Y/W/H] $x$ and $y$ positions along with width and height; $0\div100\%$ + Replace $\Delta X$ and $\Delta Y$ deltas for the Replace column.
4079     \item[Draw keypoints] when enabled shows the detection points created by the feature detection and used in the matcher Algorithm calculation.
4080     \item[Draw scene/object/replace border] displays each of the borders which helps to determine correctness.
4081     \item[Object blend amount] can dampen (smooth) the corner motion from frame to frame to reduce jitters.
4082 \end{description}
4083
4084 \subsection{An example of how to use Find Object}%
4085 \label{sub:example_how_use_findobj}
4086
4087 The following steps were used to set up the example in figure~\ref{fig:findobj}.
4088
4089 \begin{figure}[htpb]
4090     \centering
4091     \includegraphics[width=0.9\linewidth]{findobj.png}
4092     \caption{Timeline; control window and compositor for FindObj}
4093     \label{fig:findobj}
4094 \end{figure}
4095
4096 \begin{enumerate}
4097     \item For best results, set \textit{Play every frame} in \texttt{Settings $\rightarrow$ Preferences $\rightarrow$ Play\-back A}.
4098     \item Load 3 tracks of png/jpg files – this is one of the more useful working cases:
4099     \begin{itemize}
4100         \item $1^{st}$ track should be the \textit{scene}; that is the output
4101         \item $2^{nd}$ track is the \textit{object} to find
4102         \item $3^{rd}$ track is the \textit{replacement} object
4103     \end{itemize}
4104     \item Drag the \textit{Find Object} plugin onto track \#1.
4105     \item On each of other $2$ tracks, click the right mouse button;
4106       choose \textit{attach effect}, highlight \textit{Find Object}
4107       in the \textit{shared effect} column, and click OK\@. All
4108       three tracks should now have a findobj plugin effect bar. One,
4109       (probably the first one) is the master plugin and the others
4110       are attached input tracks.
4111     \item Check the plugin show icon on the master track to bring up the controls for the FindObj plugin. You will see that \textit{Use FLANN} is checked for using nearest neighbors.
4112     \item Set \textit{Output scene}, \textit{Object}, and \textit{Replacement object} layers’ track number accordingly (numbered from zero).
4113     \item Check \textit{Draw scene} border and you will see a white border in the compositor window surrounding the whole image of the scene. This assumes default settings for \textit{Scene center X,Y}(at $50\%$), and area \textit{W,H} ($100\%$). Adjust these however you need to via the dials or more simply by checking \textit{Drag} and dragging any of the $9$ drag points. As shown above this in the controls, units are in $0-100\%$.
4114     \item Turn off \textit{Play track} in the patchbay on the first track so you can see track $\#2$ in the compositor and then use the \textit{Object X,Y,W,H} dials. You will see a blue-dotted line which should then be adjusted to surround the desired object. Since it can be a little tedious to use the dials, you will want to turn off the previous Drag box of track $\#1$ and check this instead to do your dragging placement from drag points.
4115     \item Turn off \textit{Play track} in the patchbay on this track $\#2$ so that track $\#3$ is visible and if necessary, adjust the dials/drag box in the same manner. The border will have a pink-dotted line around it.
4116     \item Turn back on all of the desired \textit{Play tracks} in the patchbays.
4117     \item Set the detector choice (should have \textit{Don’t calculate} set initially), for example use \textit{SIFT}.
4118     \item Turn off all of the \textit{Draw borders} and whichever \textit{Drag box} that may still be checked.
4119     \item Check \textit{Replace object} to see the replacement overlay. At this time you may still want to change the checkboxes of \textit{Aspect}, \textit{Rotate}, \textit{Scale}, and \textit{Translate} and adjust \textit{DX/DY} in the Replace column.
4120 \end{enumerate}
4121
4122 \subsection{MoveObj, FlowObj, GaborObj, StylizeObj, PuzzleObj}%
4123 \label{sub:move_flow_gabor_stylize_puzzle}
4124
4125 \textit{MoveObj} plugin moves an object and stabilizes it.
4126
4127 \textit{FlowObj} plugin retards image motion as shown with optical flow. You can turn on/off draw vectors.
4128
4129 \textit{GaborObj} creates an interesting fractalius-like image effect using the Gabor filter.
4130
4131 \textit{PuzzleObj} makes a puzzle out of an image. You can make the puzzle pieces smaller or larger with the Pixels slider bar. The Iterations slider bar allows for varying morphing distance (figure~\ref{fig:opencv}).
4132
4133 \begin{figure}[htpb]
4134     \centering
4135     \includegraphics[width=0.8\linewidth]{opencv.png}
4136     \caption{FlowObj; GaborObj (before and after) and PuzzleObj}
4137     \label{fig:opencv}
4138 \end{figure}
4139
4140 The \textit{StylizeObj} \index{openCV!stylizeobj} plugin can be used to create some interesting edge effects using various options (figure~\ref{fig:stylizeobj01}).
4141
4142 We can apply 6 different styles:
4143
4144 \begin{figure}[htpb]
4145     \centering
4146     \includegraphics[width=0.6\linewidth]{stylizeobj01.png}
4147     \caption{Pulldown of Stylize mode on the original image}
4148     \label{fig:stylizeobj01}
4149 \end{figure}
4150
4151 \subsubsection*{Edge Smooth / Edge Recursive}%
4152 \label{ssub:edge_smooth_recursive}
4153
4154 There are two edge preserving methods available -- one to smooth the image edges, and the other to not smooth the edges/color boundaries, but instead replace the color values at a pixel by the average of the pixels around the area which have color similar to that pixel.
4155
4156 \subsubsection*{Detail Enhance}%
4157 \label{ssub:detail_enhance}
4158
4159 This option enhances the details of an image to make it look sharper.
4160
4161 \subsubsection*{Pencil Sketch / Color Sketch}%
4162 \label{ssub:pencil_color_sketch}
4163
4164 Pencil like line drawings -- either applied to a grayscale version of the images, which can give you thin pencil to charcoal like results, or applied to the color input image, which will look like a colored pencil drawing. For best results you can vary the Smoothing (the size of the surrounding area), the Edges (how dissimilar colors in the surroundings will be averaged; a larger value results in large regions of constant color) and the shading (simple scaling of the output image intensity with the higher the value, the brighter the result).
4165
4166 \subsubsection*{Stylization}%
4167 \label{ssub:stylization}
4168
4169 Produces output that looks like the images were painted using water colors, which often gives the impression of cartoon-like pictures. It abstracts regions of low contrast while either preserving or enhancing features of high contrast.
4170
4171 Figure~\ref{fig:stylize} show the images after adding the 6 various styles.
4172
4173 \begin{figure}[htpb]
4174     \centering
4175     \includegraphics[width=0.95\linewidth]{stylize.png}
4176     \caption{Clockwise: Edge Smooth and Recursive; Detail Enhance; Stylization; Color and Pencil Sketch}
4177     \label{fig:stylize}
4178 \end{figure}
4179
4180 \section[FFmpeg Audio and Video Plugins]{FFmpeg Audio and Video Plugins}%
4181 \label{sec:ffmpeg_audio_video_plugins}
4182 \index{ffmpeg!plugins}
4183
4184 \CGGI{} currently comes with more than $140$ of the video plugins and $55$ of the audio plugins developed by the FFmpeg project {\small \url{www.ffmpeg.org}}. These plugins do not have a GUI with buttons like the rest of plugins, therefore to change settings it is necessary to change the variables by hand by highlighting the \textit{option}, typing a value in the \textit{Range} box, and then hitting the \textit{Apply} button. Many of these plugins provide tooltips at the bottom right corner of the window when the option is highlighted. A \textit{slider} bar and a \textit{dial} for numerical values can be used to easily vary the values which take effect immediately.
4185
4186 Figure~\ref{fig:ffchromakey} shows what an FFmpeg video plugin looks like; example is \texttt{F\_chromakey}.
4187
4188 \begin{figure}[htpb]
4189     \centering
4190     \includegraphics[width=0.6\linewidth]{ffchromakey.png}
4191     \caption{GUI for FFmpeg plugins}
4192     \label{fig:ffchromakey}
4193 \end{figure}
4194
4195 \subsection{FFmpeg Icons and how to Replace}%
4196 \label{sub:ffmpeg_icons_how_replace}
4197
4198 Currently FFmpeg audio and video plugins that do not have a personalized icon use one of the default icons as shown below.
4199
4200 Default Audio Icon: \quad \includegraphics[height=\baselineskip]{ffaudio.png}
4201 \quad Default Video Icon: \quad \includegraphics[height=\baselineskip]{ffvideo.png}
4202
4203 If you want to replace the icon with a more descriptive picture, see a previous section on Updatable Icon Image Support and Details on where to put Plugin Icons.
4204
4205 \subsection{How to Use FFmpeg Audio/Video Plugins}%
4206 \label{sub:use_ffmpeg_audio_video_plugins}
4207
4208 Simply drag and drop the plugin on the timeline. To enter the settings option, once you have added the plugin to the timeline, right click on the colored bar that appears below the timeline track of the plugin and highlight the \textit{show} option. Alternatively, you can left click the \textit{magnifying glass} icon that appears on the right side of the colored bar. For the audio plugins, if the plugin is not working at all, you will hear a trouble tone waveform to indicate that. If the value is unspecified, it uses default. If you specify the default, the value becomes unspecified which means that nothing gets sent into the program.
4209
4210 Some of the ffmpeg plugins are not usable with \CGGI{} due to input/output requirements. Also, some do not come with legal initial supplied values for the parameters (ffmpeg works on filtergraph, while \CGG{} works on stack). These plugins get tested at least once and if they crash, cause problems, or are deemed unusable, they are commented out in the \texttt{plugin.opts} file in the \CGG{} ffmpeg subdirectory. Generally they are not retested so if the ffmpeg software changes them making them usable, they will still not be accessible until the \texttt{plugin.opts} file is changed. You can easily retest these, by temporarily uncommenting the copy of the \texttt{plugin.opts} file in the \texttt{bin} subdirectory and using \texttt{Settings $\rightarrow$ Preferences $\rightarrow$ Interface tab $\rightarrow$ Reload plugin index}
4211
4212 FFmpeg’s plugin guide is at the link:
4213 \href{https://ffmpeg.org/ffmpeg-filters.html}{ffmpeg-filters}.
4214
4215 \subsection{FFmpeg Audio Plugins}%
4216 \label{sub:ffmpeg_audio_plugins}
4217 \index{ffmpeg!audio plugin}
4218
4219 The following is a list of the integrated audio plug-ins\protect\footnote{credit to WPfilmmaker} .
4220 \begin{description}
4221 \item [F\_abench]~\\Benchmark part of a filtergraph.
4222 \item [F\_acompressor]~\\Audio compressor.
4223 \item [F\_acontrast]~\\Simple audio dynamic range
4224   compression/expansion filter.
4225 \item [F\_acrusher]~\\Reduces audio bit resolution.
4226 \item [F\_acue]~\\Delay filtering to match a cue.
4227 \item [F\_adecorrelate]~\\Apply decorrelation to input audio stream.
4228 \item [F\_adelay]~\\Delays one or more audio channels.
4229 \item [F\_adenorm]~\\Remedy denormals by adding extremely low-level noise.
4230 \item [F\_adynamicequalizer]~\\Apply dynamic equalization to input audio stream.  
4231 \item [F\_adynamicsmooth]~\\Apply dynamic smoothing to input audio stream.
4232 \item [F\_aderivative]~\\Compute derivative of input audio.
4233 \item [F\_aecho]~\\Adds echoing to the audio.
4234 \item [F\_aemphasis]~\\Audio emphasis.
4235 \item [F\_aeval]~\\Filters audio signal according to a
4236   specific expression.
4237 \item [F\_aeexciter]~\\Enhance high frequency part of audio.
4238 \item [F\_afade]~\\Fades in/out input audio.
4239 \item [F\_aformat]~\\Convert the input audio to one of he
4240   specified formats.
4241 \item [F\_afreqshift]~\\Apply frequency shifting to input audio.
4242 \item [F\_afwtdn]~\\Reduce broadband noise from input samples using Wavelets.
4243 \item [F\_agate]~\\Audio gate.
4244 \item [F\_alatency]~\\Measure filtering latency.
4245 \item [F\_allpass]~\\Applies a two-pole all-pass filter.
4246 \item [F\_aloop]~\\Loops audio samples.
4247 \item [F\_anoisesrc]~\\Generates a noise audio signal.
4248 \item [F\_aperms]~\\Set permissions for the output audio
4249   frame.
4250 \item [F\_aphaser]~\\Adds a phasing effect to the audio.
4251 \item [F\_aphaseshift]~\\Apply phase shifting to input audio.
4252 \item [F\_apsyclip]~\\Apply Psychoacoustic clipper to input audio stream.
4253 \item [F\_arealtime]~\\Slows down filtering to match realtime.
4254 \item [F\_aresample]~\\Resamples audio data.
4255 \item [F\_asetrate]~\\Change the sample rate without altering the data.
4256 \item [F\_aspectralstats]~\\Display frequency domain statistical information about the audio channels. Statistics are calculated and stored as metadata for each audio channel and for each audio frame.
4257 \item [F\_astats]~\\Shows time domain statistics about audio frames.
4258 \item [F\_asubboost]~\\Boost subwoofer frequencies.
4259 \item [F\_asubcut]~\\Cut subwoofer frequencies.
4260 \item [F\_asupercut]~\\Cut super frequencies.
4261 \item [F\_asuperpass]~\\Apply high order Butterworth band-pass filter.
4262 \item [F\_asuperstop]~\\Apply high order Butterworth band-stop filter.
4263 \item [F\_atempo]~\\Adjusts audio tempo so that when you speed up audio, it will adjust the pitch accordingly to make audio sounds more normal, but faster without being badly distorted. Its behavior is similar to what can be seen when you watch a youtube video, click the gear icon, and select a speed greater or less than 1.
4264 \item [F\_atilt]~\\Apply spectral tilt filter to audio stream.
4265 \item [F\_atrim]~\\Pick one continuous section from the input,
4266   drop the rest.
4267 \item [F\_bandpass]~\\Applies a two-pole Butterworth band-pass
4268   filter.
4269 \item [F\_bandreject]~\\Applies a two-pole Butterworth
4270   band-reject filter.
4271 \item [F\_bass]~\\Boosts or cuts lower frequencies.
4272 \item [F\_biquad]~\\Applies a biquad IIR filter with the given
4273   coefficents.
4274 \item [F\_chorus]~\\Adds a chorus effect to the audio.
4275 \item [F\_compand]~\\Compresses or expands audio dynamic
4276   range.
4277 \item [F\_compensationdelay]~\\audio compensation delay line.
4278 \item [F\_crossfeed]~\\Apply headphone crossfeed which blends
4279   the left and right channels of a stereo audio recording. It is
4280   mainly used to reduce extreme stereo separation of low frequencies
4281   in order to produce more speaker like sound.
4282 \item [F\_crystalizer]~\\Simple Expand Audio Dynamic Range
4283   filter.
4284 \item [F\_dcshift]~\\Applies a DC shift to the audio.
4285 \item [F\_drmeter]~\\Measure audio dynamic range where setting
4286   window length in seconds is used to split audio into segments of
4287   equal length.
4288 \item [F\_dyaudnorm]~\\Dynamic Audio Normalizer. When using
4289   this plugin, be sure to \textit{attach effect} to all audio tracks
4290   by dragging the plugin to the $1^{st}$ audio track and then right
4291   mouse clicking all subsequent audio tracks which brings up an
4292   menu. Highlight the effect shown in the middle section and click OK.
4293 \item [F\_earwax]~\\Widens the stereo image. When using this
4294   plugin, be sure to \textit{attach effect} to all audio tracks by
4295   dragging the plugin to the $1^{st}$ audio track and then right mouse
4296   clicking all subsequent audio tracks which brings up an
4297   menu. Highlight the effect shown in the middle section and click OK.
4298 \item [F\_equalizer]~\\Applies two-pole peaking equalization
4299   (EQ) filter.
4300 \item [F\_extrastereo]~\\Increases difference between stereo
4301   audio channels. When using this plugin, be sure to \textit{attach
4302     effect} to all audio tracks by dragging the plugin to the $1^{st}$
4303   audio track and then right mouse clicking all subsequent audio
4304   tracks which brings up a menu. Highlight the effect shown in the
4305   middle section and click OK.
4306 \item [F\_flanger]~\\Applies a flanging effect to the audio.
4307 \item [F\_haas]~\\Apply Haas Stereo Enhancer for a more
4308   natural sounding pan effect or more clarity in the center of the
4309   mix. With this filter applied to mono signals it gives some
4310   directionality and stretches its stereo image.
4311 \item [F\_highpass]~\\Applies a high-pass filer with $3\,dB$
4312   point frequency.
4313 \item [F\_hilbert]~\\Generate a Hilbert transform FIR
4314   coefficients.
4315 \item [F\_loudnorm]~\\\textit{EBU R128} loudness
4316   normalization.
4317 \item [F\_lowpass]~\\Applies a low-pass filter with $3\,dB$
4318   point frequency.
4319 \item [F\_mcompand]~\\Multiband Compress or expand
4320   audiodynamic range. The input audio is divided into bands which is
4321   like the crossover of a loudspeaker, resulting in flat frequency
4322   response when absent compander action.
4323 \item [F\_pan]~\\Remix channels with coefficients (panning).
4324 \item [F\_silenceremove]~\\Removes silence.
4325 \item [F\_sine]~\\Generate sine wave audio signal.
4326 \item [F\_stereotools]~\\Applies various stereo tools. When
4327   using this plugin, be sure to \textit{attach effect} to all audio
4328   tracks by dragging the plugin to the $1^{st}$ audio track and then
4329   right mouse clicking all subsequent audio tracks which brings up an
4330   menu. Highlight the effect shown in the middle section and click OK.
4331 \item [F\_stereowiden]~\\Applies stereo widening effect. When
4332   using this plugin, be sure to \textit{attach effect} to all audio
4333   tracks by dragging the plugin to the $1^{st}$ audio track and then
4334   right mouse clicking all subsequent audio tracks which brings up an
4335   menu. Highlight the effect shown in the middle section and click OK.
4336 \item [F\_tiltshelf]~\\Boost or cut the lower frequencies and cut or boost higher frequencies of the audio using a two-pole shelving filter with a response similar to that of a standard hi-fi’s tone-controls. This is also known as shelving equalization (EQ).
4337 \item [F\_treble]~\\Boosts or cuts upper frequencies.
4338 \item [F\_tremolo]~\\Applies tremolo effect.
4339 \item [F\_vibrato]~\\Applies vibrato effect.
4340 \item [F\_virtualbass]~\\Apply audio Virtual Bass filter.
4341 \item [F\_volume]~\\Change input volume.
4342 \item [F\_volumedetect]~\\Detect audio volume.
4343 \end{description}
4344
4345 \subsection{FFmpeg Video Plugins}%
4346 \label{sub:ffmpeg_video_plugins}
4347 \index{ffmpeg!video plugins}
4348
4349 The following is a list of the integrated video plug-ins \protect\footnote{credit to WPfilmmaker} .
4350 \begin{description}
4351 \item [F\_addroi]~\\Mark a region of interest in a video frame.
4352 \item [F\_amplify]~\\Amplify changes between successive video
4353   frames.
4354 \item [F\_atadenoise]~\\Apply an Adaptive Temporal Averaging
4355   Denoiser.
4356 \item [F\_avgblur]~\\Apply average blur filter.
4357 \item [F\_bbox]~\\Compute bounding box for each frame.
4358 \item [F\_bench]~\\Benchmarks part of a filtergraph.
4359 \item [F\_bilateral]~\\Apply bilateral filter, spatial smoothing while preserving edges.
4360 \item [F\_bitplaneoise]~\\Measure bit plane noise.
4361 \item [F\_blackdetect]~\\Detect video intervals that are
4362   (almost) black.
4363 \item [F\_blackframe]~\\Detect frames that are (almost) black.
4364 \item [F\_blockdetect]~\\Determines blockiness of frames without altering the input frames.
4365 \item [F\_blurdetect]~\\Determines blurriness of frames without altering the input frames.
4366 \item [F\_boxblur]~\\Blurs the input video. Through the settings you are able to change the power and the radius of the boxblur applied to luma, chroma and alpha.
4367 \item [F\_bwdif]~\\Deinterlaces the input image.
4368 \item [F\_cas]~\\Apply Contrast Adaptive Sharpen filter to video.
4369 \item [F\_chromakey]~\\Turns a certain color into
4370   transparency. Operates on YUV colors.
4371 \item [F\_chromanr]~\\Reduce chrominance noise.
4372 \item [F\_ciescope]~\\Video CIE scope.
4373 \item [F\_color]~\\Provide an uniformly colored input.
4374 \item [F\_colorbalance]~\\Adjusts the color balance.
4375 \item [F\_colorchannelmixer]~\\Adjusts colors by mixing color
4376   channels.
4377 \item [F\_colorchart]~\\The colorchart source provides a colors checker chart.
4378 \item [F\_colorcontrast]~\\Adjust color contrast between RGB
4379   components.
4380 \item [F\_colorcorrect]~\\Adjust color white balance selectivity
4381   for blacks and whites.
4382 \item [F\_colorkey]~\\Turns a certain color into
4383   transparency. Operates on RGB colors.
4384 \item [F\_colorlevels]~\\Adjusts the color levels.
4385 \item [F\_colormatrix]~\\Converts color matrix.
4386 \item [F\_colorize]~\\Overlay a solid color on the video stream.
4387 \item [F\_colorspace]~\\Converts color space.
4388 \item [F\_colorspectrum]~\\Provides a color spectrum input.
4389 \item [F\_colortemperature]~\\Adjust color temperature of video.
4390 \item [F\_cover\_rect]~\\Find and cover a user specified
4391   object.
4392 \item [F\_crop]~\\Crops the input video.
4393 \item [F\_cropdetect]~\\Auto-detect crop size.
4394 \item [F\_curves]~\\Adjust components curves.
4395 \item [F\_datascope]~\\Video data analysis.
4396 \item [F\_dblur]~\\Apply Directional blur filter.
4397 \item [F\_dctdnoiz]~\\Denoise frames using $2D DCT$.
4398 \item [F\_deband]~\\Debands video.
4399 \item [F\_deblock]~\\Deblocks video.
4400 \item [F\_deflate]~\\Applies deflate effect.
4401 \item [F\_deflicker]~\\Remove temporal frame luminance
4402   variations.
4403 \item [F\_dejudder]~\\Removes judder produced by pullup.
4404 \item [F\_delogo]~\\Removes logo from input video. When using
4405   this plugin a green box will appear on the screen, once the logo is
4406   inside the box the plugin will hide it. Through the settings you can
4407   specify the position of the logo to hide (on a $X-Y axis$) and the
4408   size of the box (so you can adjust it to the size of the logo).
4409 \item [F\_deshake]~\\Stabilizes shaky video.
4410 \item [F\_despill]~\\Remove uwanted foregrond colors, caused
4411   by reflected color of green or blue screen.
4412 \item [F\_dilation]~\\Applies dilation effect.
4413 \item [F\_doubleweave]~\\Weave input video fields into double
4414   number of frames.
4415 \item [F\_drawbox]~\\Draws a colored box on the input
4416   video. Through the settings you are able to choose the position of
4417   the box on X/Y coordinates, the size of the box, the color and the
4418   thickness of the lines.
4419 \item [F\_drawgraph]~\\Draw a graph using input video
4420   metadata.
4421 \item [F\_drawgrid]~\\Draws a colored grid on the input
4422   video. Through the settings you can select the horizontal and the
4423   vertical offset, set the width and height of the grid cell, and the
4424   color and thickness of the lines. When using the Presets button on
4425   the plugin bar on the timeline, you can choose a preset of
4426   \textit{rule\_of\_thirds}. The Rule of Thirds is a $3\times3$ grid
4427   on top of an image which is commonly used in filmmaking. The concept
4428   is that you align the key elements in the image using this grid at
4429   the intersection of the lines or along and within the
4430   vertical/horizontal lines.  In general the bottom and right sides of
4431   the video will not be bordered by the grid.  So for example, if you
4432   only add the effect to the video, there will be a frame around the
4433   video with the size of the \textit{thickness}
4434   but the frame is only visible on the top and left and not on the bottom
4435   or left side.  You can get a line to show by using a larger thickness
4436   and specifying a negative value for x and y of -2, -3, or more. 
4437 \item [F\_edgedetect]~\\Detects and draws edge.
4438 \item [F\_elbg]~\\Apply posterize effect, using the ELBG
4439   algorithm.
4440 \item [F\_entropy]~\\Measure video frames entropy.
4441 \item [F\_epx]~\\Scale the input using EPX algorithm.
4442 \item [F\_eq]~\\Adjusts brightness, contrast, gamma and
4443   saturation.
4444 \item [F\_erosion]~\\Applies erosion effect.
4445 \item [F\_estdif]~\\Apply Edge Slope Tracing deinterlace.
4446 \item [F\_exposure]~\\Adjust exposure of the video stream.
4447 \item [F\_fade]~\\Fade in/out input video.
4448 \item [F\_fftdnoiz]~\\Denoise frames using $3D FFT$.
4449 \item [F\_fftfilt]~\\Apply arbitrary expressions to pixels in
4450   frequency domain.
4451 \item [F\_field]~\\Extract a field from the input video.
4452 \item [F\_fieldorder]~\\Set the field order.
4453 \item [F\_fillborders]~\\Fill borders of the input video.
4454 \item [F\_floodfill]~\\Fill area of the same color with
4455   another color.
4456 \item [F\_format]~\\Convert the input video to one of the
4457   specified pixel formats.
4458 \item [F\_framerate]~\\Upsamples or downsamples progressive
4459   source between specified frame rates.
4460 \item [F\_framestep]~\\Select one frame every N frames.
4461 \item [F\_fspp]~\\Applies Fast Simple Post-processing filter.
4462 \item [F\_gblur]~\\Apply Gaussian Blur filter.
4463 \item [F\_gradfun]~\\Debands video quickly using gradients.
4464 \item [F\_gradients]~\\Draws a transparent gradient.
4465 \item [F\_graphmonitor]~\\Show various filtergraph stats.
4466 \item [F\_grayworld]~\\A color constancy filter that applies color correction based on the grayworld assumption.
4467 \item [F\_greyedge]~\\Estimates scene illumination by grey
4468   edge assumption.
4469 \item [F\_haldclutsrc]~\\Provide an identity Hald CLUT\@.
4470 \item [F\_hflip]~\\Horizontally flips the input video.
4471 \item [F\_histeq]~\\Applies global color histogram
4472   equalization.
4473 \item [F\_histogram]~\\Computes and draws a histogram.
4474 \item [F\_hqdn3d]~\\Applies a High Quality 3D Denoiser.
4475 \item [F\_hqx]~\\Scales the input by 2, 3 or 4 using the $hq*x$ magnification algorithm.
4476 \item [F\_hsvhold]~\\Turns a certain HSV range into gray values.
4477 \item [F\_hsvkey]~\\Turns a certain HSV range into transparency.
4478 \item [F\_hue]~\\Adjust the hue and saturation of the input video.
4479 \item [F\_huesaturation]~\\Apply hue-saturation-intensity adjustments to input video stream.
4480 \item [F\_idet]~\\Interlace detect Filter.
4481 \item [F\_il]~\\Deinterleaves or interleaves fields.
4482 \item [F\_inflate]~\\Applies inflate effect.
4483 \item [F\_interlace]~\\Convert progressive video into
4484   interlaced.
4485 \item [F\_kerndeint]~\\Applies kernel deinterlacing to the
4486   input.
4487 \item [F\_kirsch]~\\Apply kirsch operator.
4488 \item [F\_latency]~\\Measure filtering latency.
4489 \item [F\_lenscorrection]~\\Rectifies the image by correcting for lens distortion.
4490 \item [F\_life]~\\Generate a life pattern.
4491 \item [F\_limiter]~\\Limit pixels components to the specified
4492   range.
4493 \item [F\_loop]~\\Loops video frames.
4494 \item [F\_lumakey]~\\Turns a cerai luma into transparency.
4495 \item [F\_lut]~\\Compute and apply a lookup table to the
4496   RGB/YUV input video.
4497 \item [F\_lut1d]~\\Adjust colors using a 1D LUT.
4498 \item [F\_lut3d]~\\Apply a 3D LUT (lookup table) to an input
4499   video. LUTs are used to map one color space to another and are
4500   frequently supplied with high-end cameras as a \texttt{.cube} file
4501   to use as input.
4502 \item [F\_lutrgb]~\\Compute and apply a lookup table to the
4503   RGB input video.
4504 \item [F\_lutyuv]~\\Combine and apply a lookup table to the
4505   YUV input video.
4506 \item [F\_mandelbrot]~\\Render a Mandelbrot fractal.
4507 \item [F\_mcdeint]~\\Applies motion compensating
4508   deinterlacing.
4509 \item [F\_median]~\\Pick median pixel from rectangle defined by radius.
4510 \item [F\_mestimate]~\\Generate motion vectors.
4511 \item [F\_monochrome]~\\Convert video to gray using custom color filter.
4512 \item [F\_mpdecimate]~\\Remove near-duplicate frames.
4513 \item [F\_mptestsrc]~\\Generate various test pattern.
4514 \item [F\_negate]~\\Negates input video.
4515 \item [F\_nlmeans]~\\Non-local means denoiser. Example usage
4516   is for recovery of VHS tapes which look bad.
4517 \item [F\_noise]~\\Adds noise to the video. Through the
4518   settings you can select the variables of the noise (strength, flag
4519   and seed).
4520 \item [F\_normalize]~\\Normalize RGB video.
4521 \item [F\_oscilloscope]~\\$2D$ video oscilloscope. Useful to
4522   measure spatial impulse, step responses, and chroma delays.
4523 \item [F\_owdenoise]~\\Denoises using wavelets.
4524 \item [F\_pad]~\\Add paddings to the input image, and place
4525   the original input at the provided $x, y$ coordinates.
4526 \item [F\_pal100bars]~\\Generate PAL $100\%$ color bars.
4527 \item [F\_pal75bars]~\\Generate PAL $75\%$ color bars.
4528 \item [F\_perms]~\\Set permissions for the output video frame.
4529 \item [F\_perspective]~\\Corrects the perspective of video.
4530 \item [F\_phase]~\\Phases shift fields.
4531 \item [F\_photosensitivity]~\\Filter out photosensitive epilepsy seizure-inducing flashes.
4532 \item [F\_pixscope]~\\Pixel data analysis for checking color and levels. It will display sample values of color channels.
4533 \item [F\_pixelize]~\\Apply pixelization to video stream.
4534 \item [F\_pp]~\\Filters video using libpostproc.
4535 \item [F\_pp7]~\\Applies Postprocessing 7 filter.
4536 \item [F\_prewitt]~\\Apply prewitt operator.
4537 \item [F\_pseudocolor]~\\Make pseudocolored video frames.
4538 \item [F\_readeia608]~\\Read \textit{EIA-608} Closed Caption
4539   codes from input video \& write to frame metadata.
4540 \item [F\_readvitc]~\\Reads vertical interval timecode and
4541   writes it to frame metadata.
4542 \item [F\_realtime]~\\Slows down filtering to match realtime.
4543 \item [F\_removegrain]~\\Removes grain.
4544 \item [F\_repeatfields]~\\Hard repeat fields based on MPEG
4545   repeat field flag.
4546 \item [F\_rgbtestsrc]~\\Generate RGB test pattern.
4547 \item [F\_roberts]~\\Apply roberts cross operator which
4548   performs a simple/quick $2D$ spatial gradient measurement on the
4549   video (usually a grayscale image). It highlights regions of high
4550   spatial frequency which most ikely correspond to edges.
4551 \item [F\_rotate]~\\Rotates the input image by an arbitrary angle expressed in radians.  If you want to rotate 
4552 by degrees, you can use the \textit{rotate} plugin instead. 
4553 \item [F\_sab]~\\Applies shape adaptive blur.
4554 \item [F\_scale]~\\Scale the input video size and/or convert the image format.
4555 \item [F\_scdet]~\\Detect video scene change.
4556 \item [F\_scharr]~\\Apply scharr operator to input video stream.
4557 \item [F\_scroll]~\\Scroll input video horizontally and/or vertically by constant speed.
4558 \item [F\_separatefields]~\\Split input video frames into
4559   fields.
4560 \item [F\_setparams]~\\Force field, or color property for the
4561   output video frame.
4562 \item [F\_setrange]~\\Force color range for the output video
4563   frame.
4564 \item [F\_shear]~\\Shear transform the input image.
4565 \item [F\_showpalette]~\\Display frame palette.
4566 \item [F\_shuffleframes]~\\Shuffles video frames.
4567 \item [F\_shufflepixels]~\\Shuffles video pixels.
4568 \item [F\_shuffleplanes]~\\Shuffles video planes.
4569 \item [F\_sierpinski]~\\Generate a Sierpinski carpet/triangle fractal, and randomly pan around.
4570 \item [F\_signalstats]~\\Separates statistics from video analysis.
4571 \index{over sharpened footage}
4572 \item [F\_siti]~\\Calculate Spatial Info (SI) and Temporal Info (TI) scores for a video, as defined in ITU-T P.910: Subjective video quality assessment methods for multimedia applications.
4573 \item [F\_smartblur]~\\Blurs the input video without impacting
4574   the outlines. Through the settings you can select the radius, the
4575   strength and the threshold of luma and chroma. This plugin can be used to correct 
4576   over sharpened footage.  For example, on a DJI 3840x2160 D-cinelike footage using
4577   these settings:
4578 \begin{itemize}
4579         \item luma radius: 3.247993
4580         \item luma strength: 0.360153
4581         \item luma threshold: -2
4582 \end{itemize}
4583   the over-sharpened edges will be smoothed. All other settings are at default values.
4584 \item [F\_smptebars]~\\Generate SMPTE color bars.
4585 \item [F\_smptehdbars]~\\Generate SMPTE HD color bars.
4586 \item [F\_sobel]~\\Applies sobel operator.
4587 \item [F\_spp]~\\Applies a simple post processing filter.
4588 \item [F\_stereo3d]~\\Converts video stereoscopic $3D$ view.
4589 \item [F\_super2xsai]~\\Scales the input by 2x using the
4590   $Super2xSal$ pixel art algorithm.
4591 \item [F\_swaprect]~\\Swaps 2 rectangular objects in video.
4592 \item [F\_swapuv]~\\Swaps U and V components.
4593 \item [F\_tblend]~\\Blend successive frames.
4594 \item [F\_testsrc]~\\Generate test pattern.
4595 \item [F\_testsrc2]~\\Generate another test pattern.
4596 \item [F\_thistogram]~\\Compute and draw a color distribution histogram for the input video across time.
4597 \item [F\_tile]~\\Tile several successive frames together.
4598 \item [F\_tinterlace]~\\Performs temporal field interlacing.
4599 \item [F\_tlut2]~\\Compute and apply a lookup table from 2
4600   successive frames.
4601 \item [F\_tmedian]~\\Pick median pixels from successive frames.
4602 \item [F\_tmidequalizer]~\\Apply Temporal Midway Equalization.
4603 \item [F\_tmix]~\\Mix successive video frames.
4604 \item [F\_transpose]~\\Transposes input video.
4605 \item [F\_unsharp]~\\Sharpen or blur the input videlo.
4606 \item [F\_untile]~\\Untile a frame into a sequence of frames.
4607 \item [F\_uspp]~\\Applies Ultra Simple/Slow Post-processing
4608   filter.
4609 \item [F\_v360]~\\Convert 360 videos between various formats.
4610 \item [F\_vaguedenoiser]~\\Applies a Wavelet based Denoiser.
4611 \item [F\_vectorscope]~\\Video vectorscope.
4612 \item [F\_vflip]~\\Flips the input video vertically.
4613 \item [F\_vfrdet]~\\Variable frame rate detect filter.
4614 \item [F\_vibrance]~\\Boost or alter saturation.
4615 \item [F\_vignette]~\\Makes or reverses a vignette
4616   effect. Through the settings you can set the circle center position
4617   on a $X-Y axis$,choose the angle, the aspect and set the dithering
4618   of the vignette.
4619 \item [F\_w3dif]~\\Applies Martin Weston three field
4620   deinterlace.
4621 \item [F\_waveform]~\\Video waveform monitor.
4622 \item [F\_weave]~\\Weaves input video fields into frames.
4623 \item [F\_xbr]~\\Scales the input using $xBR$ algorithm.
4624 \item [F\_yadif]~\\Deinterlaces the input image.
4625 \item [F\_yaepblur]~\\Yet another edge preserving blur filter.
4626 \item [F\_yuvtestsrc]~\\Generate YUV test pattern.
4627 \item [F\_zoompan]~\\Applies Zoom \& Pan effect.
4628 \end{description}
4629
4630
4631 \section[Rendered Effects]{Rendered Effects}%
4632 \label{sec:rendered_effects}
4633 \index{plugins!rendered effects}
4634
4635 Besides the \textit{Realtime} effects, as has been described in the previous sections, another type of effect is performed on a section of the track and the result stored somewhere before it is played back. The result is usually pasted into the track to replace the original data. The rendered effects are not listed in the resources window but instead are accessed through the \texttt{Audio $\rightarrow$ Render effect and Video $\rightarrow$ Render effect} menu options. Each of these menu options brings up a dialog for the rendered effect. In the Select an effect dialog is a list of all the realtime and all the rendered effects. The difference here is that the realtime effects are rendered to disk and not applied under the track. Rendered effects apply to only one type of track, either audio or video. If no tracks of the type exist, an error pops up.
4636
4637 A region of the timeline to apply the effect to must be defined before selecting \textit{Render effect}. If no in/out points and no highlighted region exist, the entire region after the insertion point is treated as the affected region. Otherwise, the region between the in/out points or the highlighted region is the affected region. The tracks to apply the rendered affect to, need to be armed, other tracks are ignored. The rendered effect processes certain track attributes when it reads its input data but not others. Transitions in the affected track are applied, but nudge and effects are not. This allows the new data to be pasted into the existing position without changing the nudge value.
4638
4639 \subsubsection*{How to use a rendered effect}%
4640 \label{ssub:how_use_rendered_effect}
4641
4642 \begin{itemize}
4643     \item Highlight an effect in the list (\textit{Select an effect}) to designate it as the one being used.
4644     \item Define a file to render the effect to in the \texttt{Select a file to render to} box. The magnifying glass allows file selection from a list.
4645     \item Select a file format which can handle the track type. The \textit{wrench} allows configuration specific to the file format.
4646     \item There is also an option for creating a new file at each label. For example, if you have a CD rip on the timeline which you want to divide into different files, the labels would become dividing points between the files if this option were selected. When the timeline is divided by labels, the effect is re-initialized at every label. Normalize operations take the peak in the current file and not in the entire timeline.
4647     \item Finally there is an \textit{insertion strategy} just like in the render dialog. It should be noted that even though the effect applies only to audio or video, the insertion strategy applies to all tracks just like a clipboard operation.
4648     \item When you click OK in the effect dialog, it calls the GUI of the effect. If the effect is also a realtime effect, a second GUI appears to prompt for acceptance or rejection of the current settings.
4649     \item After accepting the settings, the effect is processed.
4650 \end{itemize}
4651
4652 \subsection{Rendered Audio Effects}%
4653 \label{sub:renederd_audio_effets}
4654
4655 \subsubsection*{Resample}%
4656 \label{ssub:resample}
4657
4658 This multiplies the number of each output sample by a \textit{scale factor} to arrive at the number of the input sample. The output file's sample rate is set to the project sample rate but its length is changed to reflect the scaled number of samples. It also filters the resampled audio to remove aliasing.
4659
4660 If the scale factor is $2$, every $2$ input samples will be reduced to $1$ output sample and the output file will have half as many samples as the input sequence. If it is $0.5$, every $0.5$ input samples will be stretched to 1 output sample and the output file will have twice as many samples as the input sequence.
4661
4662 \subsubsection*{Normalize}%
4663 \label{ssub:normalize}
4664
4665 \subsubsection*{Time Stretch}%
4666 \label{ssub:time_stretch}
4667
4668 \subsubsection*{CD Ripper}%
4669 \label{ssub:cd_ripper}
4670
4671
4672 \subsection{Rendered Video Effects}%
4673 \label{sub:renederd_video_effets}
4674
4675 \subsubsection*{Reframe}%
4676 \label{ssub:reframe}
4677
4678 This does exactly the same thing as \textit{ReframeRT} in \textit{Stretch} mode. It multiplies the output frame number by the scale factor to arrive at the input frame number and changes the length of the sequence. Unlike \textit{ReframeRT}, this must run from the Video menu and render its output. Be aware Reframe does not write the scaled frame rate as the frame rate of the rendered file. It produces a file of scaled length and equal frame rate as the project. The new length is $\frac{1}{scale factor}$ as big as the original sequence.
4679
4680 To create a slow-motion of fast moving video:
4681
4682 \begin{itemize}
4683     \item Select the video clip you wish to reframe and put it on a video track.
4684     \item Select the area you wish to reframe.
4685     \item From the \texttt{Video} menu, select the \textit{Render Effect} option.
4686     \item From the effect list, select \textit{Reframe}.
4687     \item Enter the output format and insertion strategy for the new clip to be created.
4688     \item Press OK.
4689     \item At the popup menu, enter the \textit{scale factor} $2$ to run twice as fast, and $0.5$ to run at half speed.
4690 \end{itemize}
4691
4692 \subsubsection*{720 to 480}%
4693 \label{ssub:720_to_480}
4694
4695
4696 %%% Local Variables:
4697 %%% mode: latex
4698 %%% TeX-master: "../CinelerraGG_Manual"
4699 %%% End: