\chapter{Editing: real-world usage cases}% \label{cha:editing_real_world_usage} This appendix includes descriptions of various real life workflows used by \CGG{} users. There may be links to some video explanations in various languages. You can only follow these links from the online pdf version. \section{Workflow with OpenEDL and Nested Clips}% \label{sec:workflow_openedl_nested_clips} This is a real world usage case\protect\footnote{credit fary54} that provides an excellent example of how OpenEDL has been a revolution for \CGG{}. Advantages include: editing speed, clarity, ease of finding a specific item, and movement of a subject block via \textit{Nest to media}. The main concept of editing using OpenEDL in this real world case is to reduce a large quantity of videos and shots to a few big clips by using an OpenEDL session for each clip. Using the OpenEDL timeline is similar to using the normal timeline: you can add effects, cut and drag, add or delete tracks, etc. For more information on OpenEDL and Nested clips see sections \ref{sec:openedl} and \ref{sub:nested_clips}. Scenario setup consists of making one hour video using 3 different cameras: \begin{itemize} \item \textit{Footage 1:} A person uses camera 1 to shoot a general view of the subject. \begin{enumerate} \item[a)] Barcelona (e.g. a jazz group concert) \item[b)] Lisbon (e.g. Spanish concert) \end{enumerate} \item \textit{Footage 2:} Another person uses camera 2 to film a detail of a specific subject. \begin{enumerate} \item[a)] Barcelona (e.g. saxophonist or trumpet player) \item[b)] Lisbon (e.g. guitarist or double bassist) \end{enumerate} \item \textit{Footage 3:} Contains images of the journey between the subjects (action cam on the windshield of a moving car, on the helmet of a biker, on the handlebars of a bicycle, or on a boat). \end{itemize} \textit{Note:} Camera 1 and 2 are both filming the same subject so the number of hours for the footage from these two cameras easily reaches 20 hours, but the final movie can only be one hour maximum. For this case, the final movie consists of all the subjects separated by camera 3 footage. \textit{Workflow:} OpenEDL is used throughout the editing process with the timeline reserved as the workspace. Basically, every time you have to work on a clip (consisting of one or more tracks), you use OpenEDL instead of the classic method of bringing each clip to the timeline, before doing the necessary Drag and Drop or Cut and Paste operations between different tracks. When finished with each OpenEDL clip session, save it outside of the OpenEDL layer at the top level of the main timeline. See \href{https://youtu.be/0li5DdeQ6_o}{Video 1} (using French locale). \subsubsection*{Pre-sorting of the footage} \label{ssub:pre_sorting_footage} \begin{itemize} \item Load all the shots from camera 1 and create a single clip; do the same with cameras 2 and 3. \item Watch each clip and sort the images to keep (via OpenEDL); delete the blurred footage and the images you do not want to keep. \end{itemize} \begin{figure}[htpb] \centering \includegraphics[width=0.8\linewidth]{openedl-01.png} \caption{three clips modified with OpenEDL} \label{fig:openedl-01} \end{figure} \textit{Camera 1} contains shots of Barcelona and Lisbon concert made by Camera 1. \textit{Camera 2} contains shots of Barcelona and Lisbon concert made by Camera 2. \textit{Camera 3} contains the images of the journey between the first subject and the second (e.g from Barcelona to Lisbon). \subsubsection*{Extraction of the subjects} \label{ssub:extraction_subjects} Next extract each common subject from the camera 1 \& 2 footage and create a clip, for example - a place, a city, or a subject. In this case scenario, it is a concert in a specific city. You end up with as many clips as there are subjects (e.g. Barcelona \& Lisbon). See figure ~\ref{fig:openedl-02}. \begin{figure}[htpb] \centering \includegraphics[width=0.8\linewidth]{openedl-02.png} \caption{a new clip for each subject: Barcelona and Lisbon} \label{fig:openedl-02} \end{figure} Each subject selected contains 2 video tracks and 4 audio tracks. See figure ~\ref{fig:openedl-03} of a Barcelona clip. \begin{figure}[htpb] \centering \includegraphics[width=1.0\linewidth]{openedl-03.png} \caption{Barcelona clip: 2 video tracks and 4 audio tracks} \label{fig:openedl-03} \end{figure} \subsubsection*{Editing of the subjects} \label{ssub:editing_subjects} Then edit each subject via OpenEDL. From the 2 tracks 1 \& 4 (camera 1 \& 2) you create a a single track (+ 2 audio tracks) as seen in figure ~\ref{fig:openedl-04}. \begin{figure}[htpb] \centering \includegraphics[width=1.0\linewidth]{openedl-04.png} \caption{Barcelona clip: 2 video tracks to 1 video track} \label{fig:openedl-04} \end{figure} \subsubsection*{Add sound effects and video/audio effects} \label{ssub:add_sound_video_effects} Next add the sound effects (such as birds or a water fountain) and video / audio effects for each subject; again via OpenEDL. \subsubsection*{Compaction} \label{ssub:compaction} Each subject is converted to a nested clip by using the \textit{Nest to media} option, making it a group. \begin{figure}[htpb] \centering \includegraphics[width=0.8\linewidth]{openedl-05.png} \caption{two new nested clips: Barcelona and Lisbon} \label{fig:openedl-05} \end{figure} The subject converted to a nested clip is automatically moved from the Clip folder to the Media folder. See figure ~\ref{fig:openedl-05}. See \href{https://youtu.be/kQ7sGq0o44U}{Video 2} (using French locale). \subsubsection*{Final assembly} \label{ssub:final_assembly} Import each subject (Nested clip) on the main timeline. Converting using Nest to Media makes it easy to move and position each subject. You can move one subject after or before another. \begin{figure}[htpb] \centering \includegraphics[width=1.0\linewidth]{openedl-06.png} \caption{Barcelona and Lisbon nested clips on timeline} \label{fig:openedl-06} \end{figure} Insert the retained shots coming from \textit{camera 3} between the different subjects. \begin{figure}[htpb] \centering \includegraphics[width=1.0\linewidth]{openedl-07.png} \caption{camera 3 footage between Barcelona and Lisbon nested clips} \label{fig:openedl-07} \end{figure} See \href{https://youtu.be/9Hz0a-1i3I8}{Video 3} (using French locale). Add background music and comments. \begin{figure}[htpb] \centering \includegraphics[width=1.0\linewidth]{openedl-08.png} \caption{completion of the work} \label{fig:openedl-08} \end{figure} \subsubsection*{More editing} \label{ssub:more_editing} At this stage, each subject can still be edited and undergo any modification via OpenEDL (again ... and always) \subsubsection*{Render your movie} \label{ssub:render_movie} All that remains is mastering the video with a render. Ordinarily it it is very difficult to set up such a project but using tools such as OpenEDL and Nested clips makes it quite easy. These tools, in many cases, are essential and become standards for the development of important projects using \CGG{}. \paragraph{Note} Once converted to nest to media the clips disappear from the clips folder to end up in the media folder. You can always, if you wish to recover it in the clips folder do so via the \textit{EDL to clip} menu. In this case, the name of the clip can change but the reference of the clip can be found in the comment of the clip. See \href{https://youtu.be/bfYaBqVbdCo}{Video 4} (using French locale). \section{Workflow with multi-cam and external audio}% \label{sec:workflow_multicam_external_audio} More on the multi-cam can be found in section \nameref{sec:multicamera_mixer} Let's take the case of a professional magician filmed in multicam while performing\protect\footnote{credit Armandux.}. Camera 1 records the magician's face; camera 2 the whole person and camera 3 the detail of the hands. There is also an external audio recorder to record the artist's voice in mono. So we will have three video tracks with their respective embedded audio tracks, plus an external audio track of good quality. You can find the files to test the workflow that is described next at the following address: %begin{latexonly} \url{https://cinelerra-gg.org/download/testing/cinelerra-Manual-reference.zip} %end{latexonly} \begin{htmlonly} \url{https://cinelerra-gg.org/download/testing/cinelerra-forum.zip} \end{htmlonly} [Media files are licensed under a \href{https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode}{CC 4.0 BY, NC, SA license}.] Start \CGG{} to create an empty video track and two audio tracks (default). If you want you can create a new project (using the shortcut "n") with the desired settings or change the default one (\texttt{Settings $\rightarrow$ Format}). \begin{enumerate} \item Load multimedia files ("o"). \item \texttt{Settings $\rightarrow$ proxy settings}; mark \textit{use scale}, select scale 1/2, and check \textit{Auto proxy/scale loads}. \item Wait until the progress bar at bottom right of the main window finishes to create and load proxy clips in \texttt{Resources $\rightarrow$ proxy}. \item Move to the Resources and Multimedia sources window. Next select the sources, RMB click and \textit{open mixers}. This creates new tracks and loads it. Be sure that the Proxy clips are in use by checking that the word "proxy" is included on the Timeline title bar. \item \texttt{Audio $\rightarrow$ add track} (my master audio track is mono, because there are only voices and no music). Let us suppose this new track is audio 9. \item Drag your master audio track to the new audio track (audio 9). \item Open \texttt{Windows $\rightarrow$ mixers $\rightarrow$ Mixer Viewer}. \item Click in the new mixer to select it (you will see a white box drawn inside that window) and afterwards expand the master audio track (audio 9). \item Click into the expanded track (audio 9) and, while maintaining the new created mixer selected, click on the arrow on the left (\textit{Mixer}) that appears when expanding the track, and click on it to get it pointing upwards. That hooks the new mixer with the audio 9 track (in our example). Next lock this track. \item Select with the In/Out points tool ("[]") an audio fragment in audio 9 and afterwards click on "a" to select all the tracks. \item With all the tracks selected (only the three top ones that are empty are disarmed),\texttt{ Windows $\rightarrow$ mixers $\rightarrow$ align mixers}. \item Select as master track your main audio track (audio 9 in our example). It is important to note the position of this track because you want to move all the other clips to the right to get aligned with the main audio track (9). In short: the selected fragment should be more to the right than the rest of this same fragment on the other clips/tracks. Move this track to the right if you need to. The idea behind this is to allow the other tracks to move to the right in order to get them aligned. \item In the align mixer dialog select first \textit{adjust}. Wait for the program do its work. You can see the progress bar at the bottom right of the main window. \item Check the correctness of the alignment from column \textit{R}; the values of the various tracks must be close to 1. Then click on the \textit{apply} button. The tracks will move to the right and align. \item In the main timeline in the audio 9 track, click on the \textit{Play Track} button that is beside the \textit{Arm track} button to enable it (if it is not already). Then enable audio and you can hear the audio while editing. \item Position the windows mixers in a position you are comfortable with and next in the main window move the cursor to the beginning of the timeline. You can also resize the Mixers windows to your liking. \item Click on play (space bar) and stop when you want to insert the portion of the track you want in the main track. You do this by double clicking in the mixer. \item Go on starting, stopping and double clicking to insert new portions of the clips in the main track. \item When you finish, arm only the main video track and your main audio 9 track. \item Go to \texttt{tracks $\rightarrow$ delete tracks} and you will have only one video track and one audio track (in this example, the main audio track is mono). \end{enumerate} And that is it. One more useful thing to keep in mind is that you can edit the new main track and adjust the beginning or ending of every clip (Trim) without disturbing the audio and the position of the other clips. For example, if you are not happy with the cut between the three and the fourth clip. So perhaps you want to have five more frames in clip three and five less in the fourth clip. Position the cursor arrow between the two clips and when the arrows shows, click the middle button of your mouse and drag in the direction you want to enlarge that particular clip and shorten the other one (trim mode: \textit{Slip}). If you also press the shift button, in the Compositor window you see a double view of the neighboring edits on which the trim acts allowing for greater precision and usability. To render, do not forget to uncheck the P (proxy) button in the main program window. \paragraph{Note:} If our files have Jam-syncing timecodes, we can speed up the workflow (steps 4 - 15) with the simple command : \texttt{Tracks $\rightarrow$ Align Timecodes}. More info can be found in \nameref{sub:align_timecodes}. \section{Workflow with Keyframes and Plugins}% \label{sec:workflow_keyframes_plugins} One of the most powerful functions of \CGG{} is the use of keyframes, which can be managed and applied for virtually anything you can do in the timeline, for example using them with plugins. See \nameref{cha:Keyframes} for their in-depth description. Since they can be used in many ways, including very sophisticated ones, we present a workflow that can serve as an approach to the basic operation of keyframes applied to plugins\protect\footnote{credit to DeJay.}. Effects keyframing only works on the effect you are using, they are independently set for each effect you have added. \begin{enumerate} \item Put a multi-edits movie segment on the timeline, hit the \texttt{Ctrl-End} keys to get to the end and drag the effect(s) on to the whole timeline from the Resources window, then hit the \texttt{Ctrl-Home} keys to go to the beginning. \item Enable keyframes autos button (\texttt{Generate keyframes while tweeking}) or hit \texttt{"j"}, make an adjustment to the effect and a keyframe will be generated automatically. \item Move the cursor until it becomes an arrow at the junction with the next clip and left click to put the play cursor there. \item Backspace one frame to the end of the first clip (hit \texttt{"4"} or \texttt{Alt-u} or click the \texttt{left frame reverse} transport button). \item Adjust one parameter minutely and return it to its setting, one click on the mouse wheel rotation in each direction will do it, to set another keyframe which will hold the settings for the length of the clip. If you don't the settings will change as you adjust to set the next keyframe. \item Go forward to the first frame of the next clip, reset the effect to set another keyframe, make any necessary adjustments. \item Repeat as for the first clip and do that all the way down the segment. Remember to disable keyframes afterwards or you might inadvertently change settings while continuing to work. \end{enumerate} It is always best to use the File pulldown and the option \textit{Save As} after each operation e.g. Color Correction using (for instance) \texttt{Histogram}, \texttt{Saturation} and \texttt{Unsharp} plugins, then there is a point to return to if the next operation fails, or you want to make changes. The final result is to have the first clip with a given plugin setting; the next edit with other settings; and so on throughout the timeline. The advantage is that you have only used the plugin once instead of adding a plugin to each edit. It is preferable to put all the effects on the whole timeline and adjust them for each clip together, so you can see the overall result before moving on to the next clip. Effects are read from the top to the bottom of the stack and it is usually necessary to disable the effects lower down the stack while making adjustments. Using the example of Histogram, Saturation and Sharpen, disable Saturation and Sharpen while adjusting Histogram, or the Videoscope readings will be incorrect and so will the resulting settings, then enable Saturation and adjust that before moving to the next clip. Usually Sharpen is used as a \textit{track effect}, meaning you don't keyframe it for each clip, keeping it disabled until the rest is complete. \section{Create a frame for a PiP}% \label{sec:create_frame_pip} In \CGG{} it is quick and easy to create \textit{Picture-in-Picture} (PiP) using the Camera and Projector tools. You can read about how to use these at \nameref{sub:camera_and_projector}. PiPs created with Camera and Projector, however, do not have a frame. You can add it with the \textit{Sketcher} plugin that allows for drawing on the canvas of the Compositor window. Such a frame remains fixed in the position where it was created and can only be moved manually, with a movement that must be in accordance with the movement of the PiP. Unfortunately, this is very complicated and imprecise work. A convenient workaround is to use the \textit{Sketcher} plugin together with the \textit{Crop\&Position} plugin. Here is a description of how to do this. Consider an example of a main video (\texttt{bbb\_sunflower\_1080p\_30fps\_ normal.mp4}) and a still image example (\texttt{Rodents.png}). You want to insert a crop of the image surrounded by a colored frame inside the video. Later you can move the PiP with its frame by using keyframes. \begin{enumerate} \item First, create a project with 3 video tracks. From top to bottom name them: \texttt{V3\_Frame 4Picture}, \texttt{V2\_Picture}, \texttt{V1\_Video}. \item In V1\_Video put the video file. In V2\_Picture put the image (extending it to the length of the video by simply dragging the right edge) - or you can put another video instead of a still image. The V3\_Frame4Picture track is left empty. \item In V2\_Picture, if needed put the \textit{Scale} plugin, and then 2 separate \textit{Crop\&Position} plugins. The \textit{Scale} plugin may be needed to scale the image - maybe to use it with the Camera tool, however it is not needed for the creation of the frame and PiP. Depending on its use, you can put it in the first or second position in the plugin stack. The first \textit{Crop\&Position} plugin (the topmost one, which is processed first in \textit{Temporary} and whose output becomes the input to the next plugin) will be used only to make the desired crop for our image (Crop Only). The second \textit{Crop\&Position} plugin will be used to place the PiP in the desired position (Position Only). \item In V3\_Frame4Picture, select the length of the video track and apply the \textit{Sketcher} plugin. Either highlight the region in which to apply the plugin or assign \textit{In/Out Points}, because you can not add plugins to an empty track. Now add the \textit{Shared Effects} of the \textit{Crop\&Position} plugin, taking care to choose the second plugin (Position Only) which is further down the stack (for shared effects see: \nameref{sec:shared_effect_tracks}). \end{enumerate} This is what the timeline should look like: \begin{lstlisting}[numbers=none] - V3_Frame4Picture -> Sketcher -> Shared V2_Picture:Crop&Position (Position ONLY) - V2_Picture -> Rodents.png -> Crop&Position (Crop ONLY) -> Scale -> Crop&Position (Position ONLY) - V1_Video -> bbb_sunflower_1080p_30fps_normal.mp4 \end{lstlisting} as you can see in figure~\ref{fig:Frame_on_PiP}. \begin{figure}[htpb] \centering \includegraphics[width=1.0\linewidth]{Frame_on_PiP.png} \caption{Setting effects} \label{fig:Frame_on_PiP} \end{figure} All that remains is to create the frame on the image that has already been cropped to the desired size. Drawing the frame with the \textit{Sketcher} plugin is not difficult but requires precision. You can draw the 4 corner points imprecisely (\texttt{Shift + LMB}) and then arrange the created points by dragging them to exactly the right coordinates (\texttt{Ctrl+LMB}), or you can impose the coordinates on the 4 corner points by entering the exact numbers in the \texttt{X} and \texttt{Y Input} windows. You can also adjust the thickness of the frame and the color (see \nameref{sub:Sketcher}). If you want to move the PiP to another position you have to go back to \textit{Crop\&Position} (Position Only) and change the coordinates. Now you can see that the frame also moves along with the image thanks to the Shared effect present in the V3\_Frame4Picture track, which returns the same coordinates to the \textit{Sketcher} plugin. Finally, you can animate the position of the PiP as well as the thickness and color of the frame throughout the video using the keyframes (see \nameref{cha:keyframes}). \section{Using Screen Capture on slower CPUs}% \label{sec:using_screencapture} Some results with different settings when working on slower CPUs follow: \begin{itemize} \item You can enable "loopback mode" in alsamixer, set xmms (with ALSA output) to play (any alsa-enabled app should work), and then you can record both video and audio. If your motherboard has no loopback switch for its integrated audio, you can use a specialized .asoundrc file set up as an alsa loopback instead -- reference {\small \url{https://bbs.archlinux.org/viewtopic.php?id=147852}} for usage. \item If you leave recording settings to their default value of input frequency = 48000, you may get strange one-core cpu overload in kernel space. This will show up in the color orange if using the system monitor software, gkrellm (GNU Krell Monitors). So you most likley will want to set the input frequency to 44100 and then everything should work smoothly. \item Attempting to record 1440*900*24bit*30fps with cpu (AMD FX 430) set to its lowest frequency of 1.4Ghz, usually results in video being shorter than audio, so try slowing video down to different values, such as 0.68 or so via speed curve, and then just clip the few last silent frames. \item If you set the CPU up for performance and if you can rev it up to 4Ghz, then audio and video tend to be much more aligned in terms of their length. In one particular case with generally good results, the codec was mjpeg444 / s16le into a mov container on tmpfs. \item Specifically for screencapture on slow CPU, running short pre-session capture will be useful to see if you can get same length tracks with given resolution/fps/codec. And if not, either drop down recording fps or try to speed up encoder settings. \item In trying other positioning methods, apart from software timings, such as check/uncheck add/drop frames checkboxes and setting different number of audio samples ... , there seems to be no algorithm/code to intellectually duplicate frames that are too late in their encoding. And setting buffered frames in the device to absurdly high value like 50, was also not working for screencapture driver and short recordings like 20-25 seconds long. In conclusion, no amount of buffering will save you if you are chronically late. \end{itemize}