Incorporated SGE html needed items and corrections + more index entries by Andrea
[goodguy/cin-manual-latex.git] / parts / Multi5s.tex
index 2ffbfa6f5fd4adfe261bf2d92e8b7d16b5bc3e92..5d9cbf35809e63abc19b10a3517a120f5508e5be 100644 (file)
@@ -14,7 +14,7 @@ Figure~\ref{fig:multicam01} shows 9 media sources in the left corner, the compos
 
 \begin{figure}[htpb]
     \centering
-    \includegraphics[width=1.0\linewidth]{images/multicam01.png}
+    \includegraphics[width=1.0\linewidth]{multicam01.png}
     \caption{Using Mixer capability in Cin for multiple cameras}
     \label{fig:multicam01}
 \end{figure}
@@ -115,9 +115,42 @@ The best way to use proxy with your multiple cameras is to follow the steps belo
     \item Choose the size and other options you want and click the checkmark OK. If you choose the option \textit{Beep when done} you will hear a short beep if all media is already proxied or a longer beep when all proxies have been created.
     \item When your editing is complete, use \textit{Settings} pulldown and proxy to \textit{original size}.
 \end{enumerate}
-
 Instead of Open Mixers, you can Insert Mixers with new tracks at the timeline insertion point.
 
+\begin{figure}[htpb]
+    \centering
+    \includegraphics[width=1.0\linewidth]{mixer-playable.png}
+    \caption{A Mixer window showing available options with the white X designating no playing}
+    \label{fig:mixer-playable}
+\end{figure}
+
+\subsubsection*{Options available in the \textit{Mixer Windows}}%
+\label{ssub:options_available_with_mixers}
+
+There are several options you will see in each Mixer window that help with using them. These
+are shown in figure~\ref{fig:mixer-playable}. To use these, RMB in the desired mixer window,
+and choose one of the options as described here.
+
+\begin{enumerate}
+    \item Fullscreen / Windowed - will bring up a fullscreen display of that window or revert to the original size.
+    \item Resize Window - allows for resizing the window to a choice of different sizes.
+    \item Tile Mixers - makes it easy to get all of the mixers nicely tiled to a standard size.
+This is also available in the Window pulldown.
+    \item Playable - enabled by default so that you will see a checkmark next to it in the 
+popup.  The benefit of making a mixer window not playable is to save cpu time. When a specific
+mixer window is unchecked, so not Playable, a white cross appears in the upper left hand corner
+of the mixer.  To switch back to playing again, RMB and choose Playable and this will turn
+playing back on. The program automatically updates the mixer image when the timeline cursor
+stops or when it is moved to a different spot even when play is disabled. You can see the
+white cross designating not playable in figure~\ref{fig:mixer-playable}. Statistics that show
+the savings are as follows on a 16 cpu laptop:
+\begin{verbatim}
+  5 Mixers all playing -- cpu usage = 1275
+  1 only playing       -- cpu usage =  405
+  2 only playing       -- cpu usage =  800
+\end{verbatim}
+\end{enumerate}
+
 \subsection{Mixer Align by Audio}%
 \label{sub:mixer_align_audio}
 
@@ -127,7 +160,7 @@ Synchronizing multiple camera videos based on audio tracks can be done with \CGG
 
 \begin{figure}[htpb]
     \centering
-    \includegraphics[width=0.9\linewidth]{images/mixer-align01.png}
+    \includegraphics[width=0.9\linewidth]{mixer-align01.png}
     \caption{Align Mixers window}
     \label{fig:mixer-align01}
 \end{figure}
@@ -140,13 +173,15 @@ Two different methods of aligning the audio for mixers are available. They are m
     \item Load your camera media with insertion strategy of \textit{resources only}
     \item Highlight in the Resources window, all of the media you want to mix.
     \item Right mouse button on one of the media and click on Open Mixers; all mixer windows come up.
-    \item Provide a small target audio pattern on the Master Track for syncing by marking with the In/Out points ([ and ]).
-    \item Make a selection on the timeline in which to look for the pattern. Left mouse click, then drag select and highlight a search time domain.
+    \item To arm the created mixer tracks and related audio tracks. They are automatically placed on the timeline disarmed. This is right for multi-cam but not for audio sync.
+    \item Provide a small target audio pattern on the Master Track for syncing by marking with the In/Out points ([ and ]). NOTE: When choosing between the audio tracks to align the one that will have to work as Master, we must rigorously use the one with the right-most synchronization peak. This is because the Master track will be started at the beginning of the timeline. If during alignment the other tracks should move further to the left than the Master, they will be truncated at 00:00:00:000, finding no more space available, and will be shortened with loss of footage for the next multi-cam
+    \item Make a selection on the timeline in which to look for the pattern. Left mouse click, then drag select and highlight a search time domain. 
     \item Use the \texttt{Window $\rightarrow$ Mixers$\dots$ $\rightarrow$  Align mixers} to bring up its dialog window.
     \item Highlight in the first listbox, the Mixer number you want to align. Click on \textit{Match}. This will take a few seconds so watch the rendering time percentage on the lower right hand side zoom panel. The buttons will be ghosted out until finished. Now note the changed values in the Audio Tracks listbox.
     \item If you are satisfied with the calculated Nudge values -- that is they are very close to $1.0$ -- in the Audio Tracks listbox and the audio track selected as the Master Track in the Master Track listbox, hit the \textit{Apply} button.
     \item If you plan on performing more alignment tasks, click on Checkpoint so you can go back to a previous step in case you make a mistake.
     \item Last, click on the OK green checkmark or to cancel click on the red X.  Or just close the gui.
+    \item To disarm the mixer tracks and related audio tracks for the next multi-cam operations.
 \end{enumerate}
 
 \paragraph{Reset} is used to start over with the current session data, not an undo.  This means you can use the match repeatedly to refine alignments.  All of the Audio Tracks listbox values will be reset.
@@ -163,7 +198,7 @@ Two different methods of aligning the audio for mixers are available. They are m
 
 \begin{figure}[htpb]
     \centering
-    \includegraphics[width=0.9\linewidth]{images/mixer-align02.png}
+    \includegraphics[width=0.9\linewidth]{mixer-align02.png}
     \caption{Aligned mixer window after "Match". Note the Nudge amounts above.}
     \label{fig:mixer-align02}
 \end{figure}
@@ -173,7 +208,7 @@ More detailed information follows about how this all works and the information i
 \begin{enumerate}
     \item \textit{Mixers} lists the mixers that are active by highlighting them all initially. You can decide that you do
     not want 1 or more mixers to be used in the correlation calculation by un-highlighting the one(s) that should not be used. In some cases you have to have at least 2 in order to align audio.
-    \item \textit{Master Track} lists each of the audio tracks currently loaded for all of the mixers. You can decide to highlight a different audio track to be used as the master for correlation, but only 1 can be used.
+    \item \textit{Master Track} lists each of the audio tracks currently loaded for all of the mixers. You can decide to highlight a different audio track to be used as the master for correlation, but only 1 can be used. Remember to use the track with the right-most synchronization peak as the Master.
     \item \textit{Audio Tracks} lists each of the mixer audio tracks.  Again, you can highlight a different set of which
     mixer audio tracks that you want to use for the waveform correlation.  Any audio tracks that are not
     highlighted, that is \textit{turned off}, will not be considered in the correlation calculation.
@@ -181,7 +216,7 @@ More detailed information follows about how this all works and the information i
 
 \begin{figure}[htpb]
     \centering
-    \includegraphics[width=0.9\linewidth]{images/mixer-align03.png}
+    \includegraphics[width=1.0\linewidth]{mixer-align03.png}
     \caption{Match setup for aligning by audio.  Note that [ ] are set over a sample waveform highlighted selection that includes that.}
     \label{fig:mixer-align03}
 \end{figure}
@@ -197,7 +232,7 @@ The Mixer with the master track generally does not move, everything else will be
 
 \begin{figure}[htpb]
     \centering
-    \includegraphics[width=0.9\linewidth]{images/mixer-align04.png}
+    \includegraphics[width=1.0\linewidth]{mixer-align04.png}
     \caption{An audio Match is complete. Note the waveform is aligned.}
     \label{fig:mixer-align04}
 \end{figure}
@@ -224,14 +259,6 @@ The Mixer with the master track generally does not move, everything else will be
 \subsection{Recover Mixer Windows}%
 \label{sub:recover_mixer_windows}
 
-\begin{wrapfigure}[16]{O}{1em + 0.3\textwidth} 
-    \vspace{-1ex}
-    \centering
-    \includegraphics[width=0.3\textwidth]{images/mixer-patchbay01.png}
-    \caption{Mixer  patchbay}
-    \label{fig:mixer-patchbay01}
-\end{wrapfigure} 
-
 It is a hazard that you might accidentally \textit{undo} (\texttt{z}) too far and lose your mixer windows.  Here are the steps to recover.  It is recommended that you make a backup of your project before performing the recovery steps just in case there are other problems.
 
 In the patchbay box to the left of the main timeline, there is a right pointing arrow on the right side.  This is called the \textit{Expander} (figure~\ref{fig:mixer-patchbay01}).  When you click on each expander, another line appears below that expander arrow and the timeline track height is slightly increased.  If you Shift-click on a single expander, the patchbay will expand for all of the tracks.
@@ -240,6 +267,13 @@ In the patchbay box to the left of the main timeline, there is a right pointing
     \item Expand all of the patchbay lines, either one by one, or Shift-click on one to do them all. This is so you can see the \textit{mixer} right pointing arrow on the second expanded line.    
 \end{enumerate}
 
+\begin{figure}[htpb]
+       \centering
+       \includegraphics[width=0.35\linewidth]{mixer-patchbay01.png}
+       \caption{Mixer  patchbay}
+       \label{fig:mixer-patchbay01}
+\end{figure}
+
 \begin{enumerate}[resume]
        \item Use the Window pulldown and choose \textit{Mixer Viewer} to bring up a new mixer window.  Now you will be making an association between the mixer viewer and the track’s video.
     \item Click on the new mixer window to make sure it is highlighted with a white border. This designates it as the \textit{in use} mixer viewer.
@@ -254,6 +288,126 @@ Repeat steps 2 through 7 for each of the mixer viewers you need going down the p
 
 Sometimes the association does not stick initially.  If not, highlight the mixer viewer with the problem, change the mixer arrows to point up, and reassociate.
 
+\section{Align Timecodes}%
+\label{sec:align_timecodes}
+
+Align Timecodes is especially useful in the case where you create video with multiple cameras capable of recording a timecode in the metadata of each file.  Let’s say we have recorded three videos at the same time at a concert with each camera set up at unique positions and at different angles.   All of the cameras start recording at various times but were synchronized with the same master clock so that the recordings are timestamped with that synchronized time.  For example, the 3 cameras have embedded metadata as follows:
+
+\begin{center}
+       \begin{tabular}{l r}
+       camera 1 & 00:00:00:01 \\
+       camera 2 & 00:00:10:07 \\
+       camera 3 & 00:00:17:22 \\
+       \end{tabular}
+\end{center}
+
+\begin{figure}[ht]
+       \centering
+       \includegraphics[width=1.0\linewidth]{timecode-01.png}
+       \caption{Before sync}
+       \label{fig:timecode-01}
+\end{figure}
+
+Timecode synchronization is performed by the program when you choose the option \textit{Align Timecodes} and works in 2 steps. The first automatic step is to locate the earliest timecode and the second step is to align the edits on the armed tracks using that time on the timeline. 
+
+When you load in the three files to different tracks, they'll be placed on a timeline that starts from $00:00:00:00$ as usual. But, by middle mouse clicking (MMB) on any of the video tracks, you can view the timecode embedded at that point in that file.
+
+To make it easy to align the videos onto the timeline manually, set the \textit{origin point}, that is the leftmost time index, of the timebar to the timecode of the earliest video.  For the 3 aforementioned cameras this would be camera 1 with a timeecode of $00:00:00:01$.  By using the \textit{clapboard} button on the main timeline, you can set $00:00:00:01$ as the start timecode. Then positioning the camera 1 video at the start of the timeline will line its frames up with the times on the timebar.
+
+\begin{figure}[ht]
+       \centering
+       \includegraphics[width=1.0\linewidth]{timecode-02.png}
+       \caption{Clapperboard button}
+       \label{fig:timecode-02}
+\end{figure}
+
+Similarly, using the middle mouse button to view the other 2 camera’s timecodes, you can position them  so their timecodes line up and now all three tracks will be in sync.  You can do this manually or simply do it automatically with the option under: \texttt{Tracks  $\rightarrow$  Align Timecodes}.
+
+\begin{figure}[ht]
+       \centering
+       \includegraphics[width=1.0\linewidth]{timecode-03.png}
+       \caption{After sync}
+       \label{fig:timecode-03}
+\end{figure}
+
+Timecode synchronization in \CGG{} is based on the inclusion of an actual \textit{timecode} saved in
+the media as can be seen using the \texttt{ffprobe} or \texttt{mediainfo} command line. Examples are shown here:
+
+\begin{lstlisting}[style=sh]
+# ffprobe tut1.mov
+               Metadata:
+               handler_name:   VideoHandler
+               timecode:               00:00:20:01
+
+# mediainfo mtb.mp4
+               Time code of first frame:       11:05:49:41
+               Time code, striped:             Yes
+               Title:                          GoPro AVC
+\end{lstlisting}
+
+Many newer cameras and media in a MOV container have valid timecodes often with SMPTE
+compliant start Timecode in Quicktime format, whereas others do not. Most low end cameras do not.
+When no timecode is present, various clock time values may be used to synchronize instead.
+
+There are various types of timecodes and they are written in metadata in various ways. Because it is not clear which timecode in the file is the one to use or there is none, the precedence as described next is followed. The contexts, packets, streams, and data refer to the corresponding ffmpeg data or metadata objects:
+
+\begin{enumerate}
+       \item if the format context has a timecode use: \texttt{fmt\_ctx $\rightarrow$ timecode - 0}
+       \item if the layer/channel has a timecode use: \texttt{st $\rightarrow$ timecode - (start\_time -nudge)}
+       \item find the first program stream with video stream, and if the video stream has a timecode use:
+       \texttt{st $\rightarrow$ timecode - (start\_time-nudge)}
+       \item find timecode in any stream use: \texttt{st $\rightarrow$ timecode}
+       \item read 100 packets, save \texttt{ofs=pkt.pts*st $\rightarrow$ time\_base - st $\rightarrow$ nudge}:
+       \begin{itemize}
+               \item decode frame for video stream of the first program
+               \item if \texttt{frame $\rightarrow$ timecode} has a timecode use:\texttt{ frame $\rightarrow$ timecode - ofs}
+               \item if side\_data has gop (group of pictures) timecode use: \texttt{gop $\rightarrow$ timecode - ofs}
+               \item if side\_data has smpte timecode use: \texttt{smpte $\rightarrow$ timecode - ofs}
+       \end{itemize}
+       \item if the \texttt{filename/url} scans \texttt{*date\_time.ext} use: \texttt{date\_time} (yr, month, day, hr, min, sec, nanosecond)
+       \item if stat (display file status) works on the \texttt{filename/url} use: \texttt{mtime} (modification time)
+       \item finally, if none of the above are usable, then return \texttt{failure}
+\end{enumerate}
+
+Operation of Align Timecodes includes the following options to help in your setup and review:
+
+\begin{itemize}
+       \item \textit{Align Timecodes} under the \textit{Tracks} pulldown
+       \item \textit{Clapperboard} icon on the main timeline to set a timecode.
+       \item Timecode option added to timebar choices (in timecode $hh:mm:ss:ff$) with use of the session frame
+       rate as a time standard.
+       \item Time Code Start in the Resources window on the bottom of \textit{Info} for the media if the timecode for that
+       asset has been scanned and is known. You can scan the asset’s Timecode by using the middle mouse
+       button on its track which then displays the timecode for that on the timebar.
+\end{itemize}
+
+\begin{figure}[ht]
+       \centering
+       \includegraphics[width=1.0\linewidth]{timecode-04.png}
+       \caption{Timecode via MMB on track and via Resources windows/Info}
+       \label{fig:timecode-04}
+\end{figure}
+
+\paragraph*{Notes}
+
+\begin{itemize}
+       \item \textit{Align Timecodes} is a good first step to quickly sync media up either perfectly or roughly.
+       \item Currently this is not known to function for syncing audio recorded on a separate audio device,
+       because no test material was provided to ensure that this works.
+       \item Disarmed tracks will not be affected by using \textit{Align Timecodes}.
+       \item No edits or sections will get cut off on the left or elsewhere, unless the moved edits overlap.
+       \item You can add a timecode to video using an \texttt{ffmpeg} command if you want to align a particular video
+       which has no timecode to ones that do. For example:
+\end{itemize}
+
+\begin{lstlisting}[style=sh]
+ffmpeg -i originalfile.mp4 -metadata timecode="14:36:08:29" -c copy newfile.mp4
+
+# where "-i" is followed by the input filename
+# where "-metadata timecode" is followed by the timecode key
+# where "-c copy" just copies the video/audio to the following output filename
+\end{lstlisting}
+
 \section{Multi-Pane Support}%
 \label{sec:multipane_support}
 
@@ -263,8 +417,8 @@ Multi-Pane, or split screen, allows you to look at the first part of a movie at
 
 \begin{figure}[htpb]
     \centering
-    \includegraphics[width=1.0\linewidth]{images/multi-pane01.png}
-    \caption{Shown are 4 panes that have split the main track canvas for some editing scenarios}
+    \includegraphics[width=1.0\linewidth]{multi-pane01.png}
+    \caption{Shown are 4 panes that have split in X and Y the main track canvas}
     \label{fig:multi-pane01}
 \end{figure}
 
@@ -282,7 +436,7 @@ Figure~\ref{fig:multi-screen01} shows partial window of \textit{*Playback A} sel
 
 \begin{figure}[htpb]
     \centering
-    \includegraphics[width=0.9\linewidth]{images/multi-screen01.png}
+    \includegraphics[width=0.75\linewidth]{multi-screen01.png}
     \caption{Multi-screen Playback example useful for watching \CGG{} run on the \textit{big screen}}
     \label{fig:multi-screen01}
 \end{figure}
@@ -300,7 +454,7 @@ You can create as many Viewer windows as you want in \CGG{}.  These are handy fo
 
 \begin{figure}[htpb]
     \centering
-    \includegraphics[width=0.9\linewidth]{images/multi-view01.png}
+    \includegraphics[width=1.0\linewidth]{multi-view01.png}
     \caption{Shown here are 3 Viewer windows and the \textit{View in new window} popup}
     \label{fig:multi-view01}
 \end{figure}