minor improvement
[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 jpeglist sequence file is next:
64 \begin{lstlisting}[numbers=none]
65 #!/bin/bash
66 out="$1"
67 dir=$(dirname "$out")
68 shift
69 geom=$(jpegtopnm "$1" | head -2 | tail -1)
70 w="$(echo $geom | cut -d " " -f1)"
71 h="$(echo $geom | cut -d " " -f2)"
72 exec > $out
73 echo "JPEGLIST"
74 echo "# First line is always JPEGLIST"
75 echo "# Frame rate:"
76 echo "29.970030"
77 echo "# Width:"
78 echo "$w"
79 echo "# Height:"
80 echo "$h"
81 echo "# List of image files follows"
82 while [ $# -gt 0 ]; do
83   if [ x$(dirname "$1") = x"$dir" ]; then
84         f=./`basename "$1"`;
85   else
86         f="$1";
87   fi
88   echo "$f"
89   shift
90 done
91 \end{lstlisting}
92 To use this script, you will have to install the package on your operating system that
93 includes \textit{jpegtopnm} which is ususally \textit{netpbm}.
94 Example usage of this script follows:
95
96 \qquad \texttt{jpeglist.sh outfile infiles*.jpg}
97
98 \section{Details about .bcast5 Files}
99 \label{sec:details_.bcast5_files}
100 \index{.bcast5}
101
102 The following extensions of files in \CGG{}'s \texttt{.bcast5} directory are explained below.
103
104 % Labeling requires a parameter with the longest word of the labels.
105 \begin{labeling}{ladspa\_plugins{\dots}}
106         \item [.dat] represent saved \textit{data} for perpertual sessions and color palettes; maybe others
107         \item [.idx] original \textit{index} files that were created for loaded video to speed up seeking
108         \item [.mkr] ffmpeg specific \textit{marker} index file that is created for each video to aid seeks
109         \item [.rc] rc stands for \textit{run commands} so basically represents a script
110         \item [.toc] toc is \textit{table of contents} file for MPEG video files (a type of index)
111         \item [Cinelerra\_plugins] a list of the currently loaded plugins available in your \CGG{} session
112         \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.
113         \item [ladspa\_plugins{\dots}] list of currently loaded ladspa plugins for each version of \CGG{} being used
114         \item [layout\#...\_rc] user-defined window layout setup with the layout name as part of the file name
115         \item [.xml] used for various backups or for the current settings of plugins that you have used
116         \item [.png] thumbnails of files in Resources so they do not have to be created over and over
117 \end{labeling}
118
119 \section{Focusing the 4 main windows as a group}
120 \label{sec:focus_group}
121
122 When working with multiple programs it is often the case where a set of windows needs to be minimized
123 or maximized temporarily while working with a different program.  This can be a little awkward with
124 \CGG{} because there are 4 distinct windows that are treated individually. To improve the workflow
125 so that the 4 are minimized or maximized together as a group, you can use a routine called \textit{xdotool}.
126 This will help to automatically focus all 4 of the windows as one window while still letting the user 
127 reposition the 4 screens. The "focusing windows as a group" option makes it so that you can quickly
128 move back and forth between this program and other programs.  Here is how to do this.
129
130 \begin{description}
131         \item Install xdotool \url{https://www.semicomplete.com/projects/xdotool/}
132
133         \item Iconifying all Cinelerra windows at once:
134 \newline xdotool search --name Cinelerra windowminimize \%@
135         \item Reactivating all Cinelerra windows at once:
136 \newline xdotool search --name Cinelerra windowactivate \%@
137 \end{description}
138                                                      
139 %%% Local Variables:
140 %%% mode: latex
141 %%% TeX-master: "../CinelerraGG_Manual"
142 %%% End: