minor corrections as noted by Terje and Miroslav
[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   if [ x$(dirname "$1") = x"$dir" ]; then
87         f=./`basename "$1"`;
88   else
89         f="$1";
90   fi
91   echo "$f"
92   shift
93 done
94 \end{lstlisting}
95 To use this script, you will have to install the package on your operating system that
96 includes \textit{anytopnm} which is ususally \textit{netpbm}.
97 Example usage of this script follows:
98
99 \qquad \texttt{./imagelist.sh outfile infiles/*.jpg}
100
101 where \textit{imagelist.sh} is just the name chosen for this script which could
102 be anything but has to be executable, \textit{outfile} is the sequence list
103 that is created, \textit{infiles} is the directory containing the 
104 format\_type files such as \textit{jpg} in this example. The xxxtopnm
105 messages that show up can just be ignored such as: \texttt{jpegtopnm: WRITING PPM FILE and jpegtopnm: Error writing row.}
106 In addition, you can edit this script as needed. See also \nameref{ssub:filelist_format}.
107
108 \section{Details about .bcast5 Files}
109 \label{sec:details_.bcast5_files}
110 \index{.bcast5}
111
112 The following extensions of files in \CGG{}'s \texttt{.bcast5} directory are explained below.
113
114 % Labeling requires a parameter with the longest word of the labels.
115 \begin{labeling}{ladspa\_plugins{\dots}}
116         \item [.dat] represent saved \textit{data} for perpertual sessions and color palettes; maybe others
117         \item [.idx] original \textit{index} files that were created for loaded video to speed up seeking
118         \item [.mkr] ffmpeg specific \textit{marker} index file that is created for each video to aid seeks
119         \item [.rc] rc stands for \textit{run commands} so basically represents a script
120         \item [.toc] toc is \textit{table of contents} file for MPEG video files (a type of index)
121         \item [Cinelerra\_plugins] a list of the currently loaded plugins available in your \CGG{} session
122         \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.
123         \item [ladspa\_plugins{\dots}] list of currently loaded ladspa plugins for each version of \CGG{} being used
124         \item [layout\#...\_rc] user-defined window layout setup with the layout name as part of the file name
125         \item [.xml] used for various backups or for the current settings of plugins that you have used
126         \item [.png] thumbnails of files in Resources so they do not have to be created over and over
127 \end{labeling}
128
129 \section{Focusing the 4 main windows as a group}
130 \label{sec:focus_group}
131
132 When working with multiple programs it is often the case where a set of windows needs to be minimized
133 or maximized temporarily while working with a different program.  This can be a little awkward with
134 \CGG{} because there are 4 distinct windows that are treated individually. To improve the workflow
135 so that the 4 are minimized or maximized together as a group, you can use a routine called \textit{xdotool}.
136 This will help to automatically focus all 4 of the windows as one window while still letting the user 
137 reposition the 4 screens. The "focusing windows as a group" option makes it so that you can quickly
138 move back and forth between this program and other programs.  Here is how to do this.
139
140 \begin{description}
141         \item Install xdotool \url{https://www.semicomplete.com/projects/xdotool/}
142
143         \item Iconifying all Cinelerra windows at once:
144 \newline xdotool search --name Cinelerra windowminimize \%@
145         \item Reactivating all Cinelerra windows at once:
146 \newline xdotool search --name Cinelerra windowactivate \%@
147 \end{description}
148                                                      
149 %%% Local Variables:
150 %%% mode: latex
151 %%% TeX-master: "../CinelerraGG_Manual"
152 %%% End: