Credit Andrea with Windows.tex changes based on reading updates in CV manual
[goodguy/cin-manual-latex.git] / parts / AuxilaryPrograms.tex
1 \chapter{Auxiliary Programs}%
2 \label{cha:auxiliary_programs}
3
4 \section{Using Ydiff to check results}
5 \label{sec:ydiff_check_results}
6 \index{Ydiff}
7
8 Delivered with Infinity \CGG{} and in the \CGG{} path, there is a file \texttt{ydiff.C} This program compares the output from 2 files to see the differences . Do: \texttt{cd cin\_path} and key in \texttt{make ydiff}.
9
10 % The following does not work like this.
11 % {                                      % uses braces to localize caption alignment changes.
12 % \begin{figure}[h]
13 %        \captionsetup{justification=raggedright,singlelinecheck=false}
14 %        \includegraphics[width=0.4\linewidth]{ydiff_same.png}
15 %        \caption{Exact match}
16 %        \vspace{-9cm}
17 %        \hspace{0.4\linewidth}
18 %        \captionsetup{justification=raggedleft,singlelinecheck=false}
19 %        \includegraphics[width=0.4\linewidth]{ydiff_change.png}
20 %        \caption{"giraffe" artifacts on 2 files spaced differently}
21 % \end{figure}
22 % }
23
24 % We pack two pictures of unequal height next to each other and
25 % align them flush at
26 % a) the first line of the caption.
27 % b) or tricks with strut, it's flush at the top.
28 \begin{figure}[h]
29   \begin{minipage}[t]{0.49\textwidth}
30     \strut\\[-1em]
31     \includegraphics[width=\linewidth]{ydiff_same.png}
32     \caption{Exact match}
33   \end{minipage}
34   \hfill
35   \begin{minipage}[t]{0.49\textwidth}
36     \strut\\[-1em]
37     \includegraphics[width=\linewidth]{ydiff_change.png}
38     \caption{"Giraffe" artifacts on 2 files spaced differently}
39   \end{minipage}
40 \end{figure}
41
42 You can now use this to check the quality differences of various
43 outputs. For example, in this same directory key in:
44 % The indentation of an environment matches the type area.
45 \begin{list}{}{}
46 \item \texttt{./ydiff /tmp/yourfile.mp4 /tmp/yourfile.mp4}
47 \end{list}
48 %\hspace{2em}\texttt{./ydiff /tmp/yourfile.mp4 /tmp/yourfile.mp4}
49
50 Since you are comparing a file to itself, you will see a clean looking white window in the left-hand corner and columns 2,3,4 will be all zeros. Run this same command with a 3rd spacing parameter of {}-1 as shown below, and you will see artifacts of comparing 2 files starting in a different position.
51 \begin{list}{}{}
52 \item \texttt{./ydiff /tmp/yourfile.mp4 /tmp/yourfile.mp4 -1}
53 \end{list}
54 % \hspace{2em}\texttt{./ydiff /tmp/yourfile.mp4 /tmp/yourfile.mp4 -1}
55
56 Now render yourfile using different quality levels and run ydiff to compare the 2 results. You will see only noise difference which accounts for the quality level. Columns 2,3,4 might no longer be exactly zero but will represent only noise differences. The ydiff output is debug data with lines that show frame size in bytes, sum of error, and sum of absolute value of error. The frames size is sort of useless, the sum of error shows frame gray point drift and the abs error is the total linear color error between the images. At the very end is the total gray point drift and total absolute error on the last line.
57
58
59 \section{Image Sequence Creation}
60 \label{sec:image_sequence_creation}
61 \index{image sequence}
62
63 Example script to create a jpeg list sequence file is next.  It can be modified to
64 create a list for \textit{exr}, \textit{gif}, \textit{ppm}, \textit{png}, \textit{tga}, or \textit{tiff}
65 sequences instead by changing JPEGLIST
66 to be EXRLIST, GIFLIST, PPMLIST, PNGLIST, TGALIST, or TIFFLIST.
67 \begin{lstlisting}[numbers=none]
68 #!/bin/bash
69 out="$1"
70 dir=$(dirname "$out")
71 shift
72 geom=$(anytopnm "$1" | head -2 | tail -1)
73 w="$(echo $geom | cut -d " " -f1)"
74 h="$(echo $geom | cut -d " " -f2)"
75 exec > $out
76 echo "JPEGLIST"
77 echo "# First line is always format_typeLIST"
78 echo "# Frame rate:"
79 echo "29.970030"
80 echo "# Width:"
81 echo "$w"
82 echo "# Height:"
83 echo "$h"
84 echo "# List of image files follows"
85 while [ $# -gt 0 ]; do
86   f=./`basename "$1"`
87   echo "$f"
88   shift
89 done
90 \end{lstlisting}
91 To use this script, you will have to install the package on your operating system that
92 includes \textit{anytopnm} which is ususally \textit{netpbm}.
93 Example usage of this script follows:
94
95 \qquad \texttt{./imagelist.sh outfile infiles*.jpg}
96
97 where \textit{imagelist.sh} is just the name chosen for this script which could
98 be anything but has to be executable, \textit{outfile} is the sequence list
99 that is created, \textit{infiles*.jpg} are the 
100 format\_type files such as \textit{jpg} in this example. The xxxtopnm
101 messages that show up can just be ignored such as: \texttt{jpegtopnm: WRITING PPM FILE and jpegtopnm: Error writing row.}
102 You may have to edit this script to suit your needs or to include specific directory locations. See also \nameref{ssub:filelist_format}.
103
104 \section{Details about .bcast5 Files}
105 \label{sec:details_.bcast5_files}
106 \index{.bcast5}
107
108 The following extensions of files in \CGG{}'s \texttt{.bcast5} directory are explained below.
109
110 % Labeling requires a parameter with the longest word of the labels.
111 \begin{labeling}{ladspa\_plugins{\dots}}
112         \item [.dat] represent saved \textit{data} for perpertual sessions and color palettes; maybe others
113         \item [.idx] original \textit{index} files that were created for loaded video to speed up seeking
114         \item [.mkr] ffmpeg specific \textit{marker} index file that is created for each video to aid seeks
115         \item [.rc] rc stands for \textit{run commands} so basically represents a script
116         \item [.toc] toc is \textit{table of contents} file for MPEG video files (a type of index)
117         \item [Cinelerra\_plugins] a list of the currently loaded plugins available in your \CGG{} session
118         \item [Cinelerra{}\_rc] the user's preferences and settings are saved in this file to be used on startup.  This file can be carefully edited to change startup values for certain parameters, but if you inadvertently set up something incorrectly, you may end up crashing the program.
119         \item [ContextManual.pl] the user's configurable version of the Perl script which drives the Context Help feature 
120         \item [ladspa\_plugins{\dots}] list of currently loaded ladspa plugins for each version of \CGG{} being used
121         \item [layout\#...\_rc] user-defined window layout setup with the layout name as part of the file name
122         \item [.xml] used for various backups or for the current settings of plugins that you have used
123         \item [.png] thumbnails of files in Resources so they do not have to be created over and over
124 \end{labeling}
125
126 \section{Focusing the 4 main windows as a group}
127 \label{sec:focus_group}
128
129 When working with multiple programs it is often the case where a set of windows needs to be minimized
130 or maximized temporarily while working with a different program.  This can be a little awkward with
131 \CGG{} because there are 4 distinct windows that are treated individually. To improve the workflow
132 so that the 4 are minimized or maximized together as a group, you can use a routine called \textit{xdotool}.
133 This will help to automatically focus all 4 of the windows as one window while still letting the user 
134 reposition the 4 screens. The "focusing windows as a group" option makes it so that you can quickly
135 move back and forth between this program and other programs.  Here is how to do this.
136
137 \begin{description}
138         \item Install xdotool \url{https://www.semicomplete.com/projects/xdotool/}
139
140         \item Iconifying all Cinelerra windows at once:
141 \newline xdotool search --name Cinelerra windowminimize \%@
142         \item Reactivating all Cinelerra windows at once:
143 \newline xdotool search --name Cinelerra windowactivate \%@
144 \end{description}
145                                                      
146 %%% Local Variables:
147 %%% mode: latex
148 %%% TeX-master: "../CinelerraGG_Manual"
149 %%% End: