minor corrections as noted by Terje and Miroslav
[goodguy/cin-manual-latex.git] / parts / DVD.tex
index bcca896b307125527fc10adc19241be263ad66d6..7625f6c88acd9ef10e14382894b0ecbd78fe05cd 100644 (file)
@@ -1,5 +1,7 @@
 \chapter{DVD and Bluray Creation}%
 \label{cha:dvd_bluray_creation}
+\index{DVD}
+\index{BluRay}
 
 This section describes how to create a blu-ray DVD, or \textcolor{red}{BD} referring to a \textcolor{red}{B}lu-ray \textcolor{red}{D}VD, and a regular DVD, or \textcolor{red}{SD} referring to a \textcolor{red}{S}tandard \textcolor{red}{D}VD.  The DVDs (plural usage of DVD means either BD or SD) created are unencrypted, unlike commercially available movie DVDs.  This \CGG{} version conceivably can create different variations of DVD/Blu-ray media but for the casual user the most standard usages are readily usable and will be described here. 
 
@@ -12,7 +14,7 @@ run the \CGG{} startup from a terminal window, instead of the icon, in order to
 
 A warning here -- writing blu-ray BDs and  regular SDs can take a large amount of clock time.  Keep in mind that a blu-ray can contain 25 hours of viewing, so would take multiple hours to just write one.
 
-The max disk space needed is a little over $100GB$ for $50GB$ Double Layer (DL) media or $50GB$ for a single layer BD blu-ray.  A standard SD of $4.7GB$ needs about $10GB$ disk space. You probably can get by with much less if the render for blu-ray is less than 25 hours of media.  You will need twice as much disk space as the media holds to ensure you have sufficient space for working and copying.
+The amount of data you have to render determines the amount of disk space you will need for working.  The max disk space needed for a completely full media disc is a little over $100GB$ for $50GB$ Double Layer (DL) media or $50GB$ for a single layer BD blu-ray.  A standard SD of $4.7GB$ needs about $10GB$ disk space. You will need much less if the render for blu-ray is less than 25 hours of media.  Generally you will need twice as much disk space as will be written on the media to ensure you have sufficient space for working and copying.
 
 The most important thing you need to know about in order to get started is \textit{Format} and \textit{Scale}  in the \textit{Create dvd or bd} window.  Format settings shown in the \texttt{Set Format} window are set accordingly to an algorithm.  Basically, it will take whatever you say in the asset format.  It matches that against the known Presets available so that is what will be shown.  If the asset format doesn't match any of the Presets default formats, then that will be shown as the \textit{User Defined} format.  In addition when you load media, the format is initially set to \textit{same as source} so matches the source input and if that matches a known preset, then that is what is shown.  The PAL versus NTSC only comes into play when there is no known correct matching format when you attempt to create a DVD Render batch job.  It is applied when you click OK. For example, if you load up a YouTube video, it will not match any known format and will choose PAL or NTSC based on time zone.
 
@@ -25,7 +27,7 @@ Figure~\ref{fig:preset01} shows pulldown \textit{Presets} in \textit{Set Format}
     \label{fig:preset01}
 \end{figure}
 
-A quick set of basic steps to create DVDs is immediately below and usually just using the defaults will get you something.  However there is a serious issue with interaction between the Operating System and bdwrite when creating a BD/blu-ray that requires automount to be turned off.  Refer to the details and more specific explanations below the following steps for how to do this.
+A quick set of basic steps to create DVDs is immediately below and usually just using the defaults will get you something.  However there is a serious issue with interaction between the Operating System and bdwrite when creating a BD/blu-ray that requires automount to be turned off.  For more details on using automount see: ~\ref{sec:bluray_workaround_mount_umount}.
 
 \begin{enumerate}
     \item If not logged in as root, you will get an error message in order to avoid doing a lot of work and then failing out because root is required for automount and to write on DVD hardware.
@@ -40,7 +42,9 @@ A quick set of basic steps to create DVDs is immediately below and usually just
     \item Load your media, format if needed, note device name to substitute for \textit{<bd>} or \textit{<dvd>}
     \begin{itemize}
         \item If rewritable blu-ray, use \\
-        \texttt{dd if=./bd.udfs of=/dev/<bd> bs=2048000}
+        \texttt{dd if=./bd.udfs of=/dev/<bd> bs=2048000} \\
+       Note: unwritten media must be quickly formatted one time using: \\
+        \texttt{dvd+rw-format /dev/bd}
         \item If write-once blu-ray, use \\
         \texttt{growisofs -dvd-compat -Z /dev/<bd>=./bd.udfs}
         \item If any DVD media,    use \\
@@ -58,13 +62,13 @@ For blu-ray, the filesystem generation is slightly harder.  First, it creates an
 
 NOTE of IMPORTANCE: there is a serious situation with the interaction between the Operating System (OS) and bdwrite when creating blu-ray, that requires automount to be turned off.  The blu-ray automatic script unmounts the blu-ray/UDF filesystem but the system has not finalized the directories so the OS creates a new loop file device and the data is loaded and cached for use by the new loop but it is stale.  Consequences is that not all of the data is written where it should be.  The solution is for the OS not to mount this second mount so we have to make sure it doesn't.  There are 2 methods to fix this.  The first and easiest is by using the following command to disable automount:
 
-\begin{lstlisting}[language=bash,numbers=none]
+\begin{lstlisting}[style=sh]
 gsettings set org.gnome.desktop.media-handling automount false
 \end{lstlisting}
 
 This can be reversed when you have completed the blu-ray generation via:
 
-\begin{lstlisting}[language=bash,numbers=none]
+\begin{lstlisting}[style=sh]
 gsettings set org.gnome.desktop.media-handling automount true
 \end{lstlisting}
 
@@ -84,7 +88,7 @@ Immediately below are the detailed steps with explanations for creating SD or BD
 \begin{itemize}
     \item Format frame rates choices are $29.97$ or $25$ for SD, based on the user's timezone, with NTSC 29.97/US or PAL 25 /EU.  For BD, the media input will be analyzed to automatically pick the default format or if unknown, the user's timezone will be used to default to $1920/29.97i$ for US or $1920/25i$ for EU.  Be sure to set the rendering parameters in the \texttt{settings $\rightarrow$ format} menu.
     \item Choose audio stereo or 5.1, again depending on your media.
-    \item Target Geometry will be $720\times480$ (US) or $720\time576$ (EU) for SD.
+    \item Target Geometry will be $720\times480$ (US) or $720\times576$ (EU) for SD.
 \end{itemize}
 
 \textit{Step 2}: From the main window, select  \texttt{file $\rightarrow$ BD Render}   or    select  \texttt{file $\rightarrow$ DVD Render} (figure~\ref{fig:bluray_dvd}).  Then:
@@ -165,13 +169,13 @@ Horizontal and Vertical are duplicates or restatement of same functionality as C
     \item Click OK check button.
 \end{itemize}
 
-The default bitrate is the largest value possible.  The actual \textit{target} bitrate is calculated based on a formula from the blu-ray/DVD code.  It divides the media size (in bits)  by the video time (in seconds) to find the bitrate that will \textit{just fit} on the target media.  This could create a weird bitrate if the media is large, and the video time is small, so the default/target bitrate is limited to $10Mb/s$.Batch jobs are then built and appended to the job list.  Once these batch jobs are built, if you make any changes, you have to start over.  You will see listed the batch jobs that are created to perform the rendering/tasks -- 2 jobs for blu-ray, one for audio/video processing and one for the scripts.  There will be 3 batch jobs created for DVD when not using ffmpeg to include one each for audio and video and then one more for the scripts.  When you click on \texttt{start}, it fires off those jobs and you will see the rendering main window progress bar in the bottom corner reflecting the fact that it is currently processing.  Be aware that the \CGG{} program will be totally shutdown AFTER the batch jobs finish.  Screenshot below shows BD blu-ray creation with 2 batch jobs queued up and ready to go.
+The default bitrate is the largest value possible.  The actual \textit{target} bitrate is calculated based on a formula from the blu-ray/DVD code.  It divides the media size (in bits)  by the video time (in seconds) to find the bitrate that will \textit{just fit} on the target media.  This could create a weird bitrate if the media is large, and the video time is small, so the default/target bitrate is limited to $10Mb/s$.Batch jobs are then built and appended to the job list.  Once these batch jobs are built, if you make any changes, you have to start over.  You will see listed the batch jobs that are created to perform the rendering/tasks -- 2 jobs for blu-ray, one for audio/video processing and one for the scripts.  There will be 3 batch jobs created for DVD when not using ffmpeg to include one each for audio and video and then one more for the scripts.  When you click on \texttt{start}, it fires off those jobs and you will see the rendering main window progress bar in the bottom corner reflecting the fact that it is currently processing.  Be aware that the \CGG{} program will be totally shutdown AFTER the batch jobs finish.
 
-Figure~\ref{fig:dvd-batch01} for DVD and Figure~\ref{fig:dvd-batch02} for BD shows a creation render ready to be started.  Note that because it is not ffmpeg, the processing of video is done separately from audio.  If you need to modify the video tracks, which you can see is ghosted out, you need to highlight the first batch job listed.  Be sure to highlight the first batch job before pressing Start so it runs all of the jobs and be sure the X for job enabled is set.
+Figure~\ref{fig:dvd-batch01} for DVD and Figure~\ref{fig:dvd-batch02} for BD show creation renders with batch jobs queued up and ready to be started.  Note that because it is not ffmpeg, the processing of video is done separately from audio.  If you need to modify the video tracks, which you can see is ghosted out, you need to highlight the first batch job listed.  Be sure to highlight the first batch job before pressing Start so it runs all of the jobs and be sure the X for job enabled is set.
 
 \begin{figure}[htpb]
     \centering
-    \includegraphics[width=0.9\linewidth]{dvd-batch01.png}
+    \includegraphics[width=1.0\linewidth]{dvd-batch01.png}
     \caption{Batch render for DVD creation}
     \label{fig:dvd-batch01}
 \end{figure}
@@ -179,7 +183,7 @@ Figure~\ref{fig:dvd-batch01} for DVD and Figure~\ref{fig:dvd-batch02} for BD sho
 % \vspace{-4ex}
 \begin{figure}[htpb]
     \centering
-    \includegraphics[width=0.8\linewidth]{dvd-batch02.png}
+    \includegraphics[width=1.0\linewidth]{dvd-batch02.png}
     \caption{Batch render for BD creation}
     \label{fig:dvd-batch02}
 \end{figure}
@@ -188,13 +192,13 @@ When you click on \textit{start}, it fires off those jobs and you will see the r
 
 This will produce a new directory in your target path which contains a filesystem image file.
 For example: \\
-\texttt{/TargetDirectory/bd\_20150820-093747} \\
+\texttt{/<target directory>/bd\_(or dvd\_)<date-time>/} \\
 Directory and file names should not be changed at this time because the scripts and programs rely on the given names in order to proceed.  You can change them later for your own purposes.
 
 If bluray to test the filesystem you just created, use the command line interface; loopback mount the filesystem image which was generated in the target directory.  For example if blu-ray:
 
-\begin{lstlisting}[language=bash,numbers=none]
-cd /TargetDirectory/bd_20150820-093747/
+\begin{lstlisting}[style=sh]
+cd /<target directory>/bd_(or dvd_)<date-time>/
 mount -o loop,ro ./bd.udfs ./udfs
 #check the media using a compatible media rendering tool like ffplay
 umount ./udfs...
@@ -204,44 +208,46 @@ To burn blu-ray media you will need to run from the command line interface.  In
 
 \subsubsection*{Blu-ray Media}
 \label{ssub:bluray_media}
+\index{BluRay}
 
 For rewritable blu-ray (recommended) (BD-RE):
 
-Note: unwritten (virgin) media must be formatted first using:
+Note: new or previously unwritten media must be formatted first using:
 
-\begin{lstlisting}[language=bash,numbers=none]
+\begin{lstlisting}[style=sh]
 dvd+rw-format /dev/bd   #only done once and does not take very long
 \end{lstlisting}
 
 To write or rewrite rewritable blu-ray media:
 
-\begin{lstlisting}[language=bash,numbers=none]
-cd /TargetDirectory/bd_20150820-093747/
+\begin{lstlisting}[style=sh]
+cd /<target directory>/bd_(or dvd_)<date-time>/
 dd if=./bd.udfs of=/dev/bd bs=2048000    #the growisofs command below also works
 \end{lstlisting}
 
 To write blu-ray write-once media: (BD-R)  (no pre-formatting needed):
 
-\begin{lstlisting}[language=bash,numbers=none]
-cd /TargetDirectory/bd_20150820-093747/
+\begin{lstlisting}[style=sh]
+cd /<target directory>/bd_(or dvd_)<date-time>/
 growisofs -dvd-compat -Z /dev/bd=./bd.udfs
 \end{lstlisting}
 
 \subsubsection*{DVD Media}
 \label{ssub:dvd_media}
+\index{DVD}
 
 For rewritable DVD (DVD+RW):
 
-Note: unwritten (virgin) media must be formatted first using:
+Note: unwritten media must be formatted first using:
 
-\begin{lstlisting}[language=bash,numbers=none]
+\begin{lstlisting}[style=sh]
 dvd+rw-format /dev/dvd   #only done once and does not take very long
 \end{lstlisting}
 
 To write a DVD, load blank media and run the following from the command line (requires dvdauthor):
 
-\begin{lstlisting}[language=bash,numbers=none]
-cd /TargetDirector/dvd_20160404-175416
+\begin{lstlisting}[style=sh]
+cd /<target directory>/bd_(or dvd_)<date-time>/
 growisofs -dvd-compat -Z /dev/dvd -dvd-video ./iso
 \end{lstlisting}
 
@@ -270,8 +276,9 @@ Below are examples of what the batch jobs generate and you will see on the termi
 
 \subsubsection*{SD Example: Partial Output during \CGG{} run}
 \label{ssub:sd_example_partial_output}
+\index{DVD!partial output messages run}
 
-\begin{lstlisting}[language=bash,numbers=none]
+\begin{lstlisting}[style=sh]
 ...
 FFMPEG::open_decoder: some stream times estimated
 Render::render_single: Session finished.
@@ -312,8 +319,9 @@ growisofs -dvd-compat -Z /dev/dvd -dvd-video /tmp/dvd_20160407-113530/iso
 
 \subsubsection*{BD Example: Partial Output during \CGG{} run}
 \label{ssub:bd_example_partial_output}
+\index{BluRay!partial output messages run}
 
-\begin{lstlisting}[language=bash,numbers=none]
+\begin{lstlisting}[style=sh]
 ...
 FFMPEG::open_decoder: some stream times estimated
 Render::render_single: Session finished.
@@ -348,8 +356,9 @@ for RW: dd if=/tmp/bd_20161224-162059/bd.udfs of=/dev/bd bs=2048000
 
 \subsubsection*{SD Example – Partial Output during writing disc media}
 \label{ssub:sd_example_partial_output_writing}
+\index{DVD!partial output messages writing}
 
-\begin{lstlisting}[language=bash,numbers=none]
+\begin{lstlisting}[style=sh]
 growisofs -dvd-compat -Z /dev/sr0 -dvd-video /tmp/dvd_20161224-160756/iso
 WARNING: /dev/sr0 already carries isofs!
 About to execute 'mkisofs -dvd-video /tmp/dvd_20161224-160756/iso | builtin_dd of=/dev/sr0 obs=32k seek=0'
@@ -369,8 +378,9 @@ builtin_dd: 6624*2KB out @ average 0.7x1352KBps
 
 \subsubsection*{BD Example – Partial Output during writing disc media}
 \label{ssub:bd_example_partial_output_writing}
+\index{BluRay!partial output messages writing}
 
-\begin{lstlisting}[language=bash,numbers=none]
+\begin{lstlisting}[style=sh]
 growisofs -dvd-compat -Z /dev/sr0=/tmp/bd_20161224-155658/bd.udfs
 Executing 'builtin_dd if=/tmp/bd_20161224-155658/bd.udfs of=/dev/sr0 obs=32k seek=0'
 /dev/sr0: "Current Write Speed" is 2.0x4390KBps.
@@ -387,6 +397,8 @@ builtin_dd: 11984*2KB out @ average 0.2x4390KBps
 
 \section{Debugging DVDs Creation}%
 \label{sec:debugging_dvd_creation}
+\index{DVD!debugging}
+\index{BluRay!debugging}
 
 This section contains helpful hints, how to initially check the results, and some information on determining what might have gone wrong and how to address it.
 
@@ -418,7 +430,7 @@ Note that there will be no files in the actual AUDIO\_TS directory.
     \item There is also a file in the same directory, called bd.jobs.  It was the information that was used in creating the batch jobs and may be helpful in determining what parameters were actually used if there are any resulting problems.  With enough background knowledge, you can make changes and rerun.
     \item For blu-ray check to make sure you do not have any spurious loopback disks mounted that may interfere with the correct generation.  Use the df command to check this and then the umount command to unmount these.  Also, check to make sure you have used the gsettings command to disable automount.
     \item For blu-ray loopback mount the \texttt{<target>/bd.udfs} image, and see if it has the BDMV filesystem written to it, and in particular a subdirectory named STREAM.  Look at the results in \texttt{./udfs} and check for  the stream file which should exist in \texttt{./udfs/BDMV/STREAM/00000.m2ts} and should have the same size as \texttt{./bd.m2ts}.
-    \begin{lstlisting}[language=bash,numbers=none]
+    \begin{lstlisting}[style=sh]
     mount -o loop <target>/bd.udfs <target>/udfs
     ls -lR <target>/udfs
     du -sc <target>/udfs
@@ -428,13 +440,15 @@ Note that there will be no files in the actual AUDIO\_TS directory.
 
 \subsubsection*{Checklist for Troubleshooting}
 \label{ssub:checklist_troubleshooting}
+\index{DVD!troubleshooting}
+\index{BluRay!troubleshooting}
 
 \begin{itemize}
     \item Are you logged in as root?  This is required in order to loopback mount files for bluray and to write media on \texttt{/dev/hardware}.  See section \hyperref[sec:bluray_workaround_mount_umount]{13.7} for a workaround for normal user mode.
     \item Did you startup \CGG{} from a terminal window so you can see informative messages?
     \item Is udftools installed for BD and dvdauthor installed for SD?
     \item Do you have loopback not enabled for bluray?  At least temporarily, disable automount via:
-    \begin{lstlisting}[language=bash,numbers=none]
+    \begin{lstlisting}[style=sh]
     gsettings set org.gnome.desktop.media-handling automount false
     \end{lstlisting}
     \item Did you have sufficient disk space for working/writing files?  In the \textit{Create} window, the \textit{disk space} will be displayed in green if sufficient, but in red if less than what fits on the disc media.
@@ -447,59 +461,17 @@ Note that there will be no files in the actual AUDIO\_TS directory.
     \item Did you correctly interpret the frame rate if using interlaced format to be $\frac{1}{2}$ due to interlacing?
 \end{itemize}
 
-\section{Subtitles}%
-\label{sec:subtitles}
+\section{DVD-Subtitles}%
+\label{sec:dvd_subtitles}
+\index{DVD!subtitles}
 
-DVD (not blu-ray... yet) subtitles are added by using the main window pulldown   \texttt{File $\rightarrow$ Subtitle}   which brings up a window allowing you to type the filename of a previously generated text file containing the desired words/lines, the script.  After entering the filename, click \texttt{Load} to read in your script.  By creating a script file ahead of time, it lets you easily add dialog that was already written out and carefully edited for spelling and proper grammar.
-
-The format of the script/text input file has specific requirements as listed below:
-
-\begin{itemize}
-    \item Lines can be any length but they will be broken up to fit according to some criteria below.
-    \begin{itemize}
-        \item Running text used as script lines will be broken into multiple lines.
-        \item The target line length is 60 characters.
-        \item Punctuation may be flagged to create an early break.
-        \item Single carriage return ends an individual script line.
-        \item Double carriage return indicates the end of a entry and helps to keep track of where you are.
-    \end{itemize}
-    \item The "\textit{=}" sign in column 1 indicates a comment seen in the script text to assist you in location.
-    \item An "\textit{*}" at the beginning of the line is a comment and not a script line.
-    \item \textit{Whitespace} at either the beginning of a script line or the end will be removed.
-\end{itemize}
-
-Figure~\ref{fig:subtitle01} shows the Subtitle window you will see.
-
-\begin{figure}[htpb]
-    \centering
-    \includegraphics[width=0.8\linewidth]{subtitle01.png}
-    \caption{Subtitle window}
-    \label{fig:subtitle01}
-\end{figure}
-
-To put the subtitles onto your media, first add a subtitle track via the pulldown  \texttt{Track $\rightarrow$ Add Subttl}. In the Subtitle window, note that there are 2 major textboxes.  There is the \textit{Script Text} textbox showing the current entry of text from your input file and there is the \textit{Line Text} textbox showing the currently active text.  In your subtitle track, select a timeline region (in/out or drag select with hairline cursor/highlight) to indicate the region where you want the active Line Text to be pasted.  Then click the \texttt{Paste} button in the Subtitle window to paste the line onto the subtitle track.  Silence will be added to the subtitle track in the places in the media where there are gaps.
-
-Editing in the Line Text box can be used to change the active script line. By double clicking the timeline over the subtitle track, you can reselect the active script line.  The subtitle text will be reloaded into the Line Text box and can be edited and re-pasted as the new active subtitle text.  You can also highlight multiple lines in the Script Text box and paste them (using the usual window paste methodology) into the Line Text box.  After pasting to the timeline, the Line Text box will be updated with the next script line.  In addition, if you triple click a line in the \textit{Script Text} box, it will automatically become the current line in the \textit{Line Text} box.
-
-When you are finished, before clicking \textit{Save}, you must supply a legitimate filename in the \textit{Path} box; your current directory will be used if only a filename but no directory path is supplied.  The filename used will automatically have a "--" after it followed by the \textit{track label} and then \textit{udvd} extension added; any extension in the filename will be removed..  If you click OK before saving, the subtitle script position is saved with the session.  This is convenient for continuing where you left off.
-
-\noindent To reposition the script, use the slider or tumbler buttons:
-
-\textit{Slider} bar to move through the text entries quickly.
-
-\textit{Prev} or \textit{Next} buttons to go to the previous or next script line.
-
-\noindent Figure~\ref{fig:subtitle02} shows what the pasted subtitle script looks like in a portion of the main window.
-
-\begin{figure}[htpb]
-    \centering
-    \includegraphics[width=0.9\linewidth]{subtitle02.png}
-    \caption{Subtitles on timeline}
-    \label{fig:subtitle02}
-\end{figure}
+\CGG{} supports the .udvd format of DVDs, so you can create subtitles on the timeline and then save them as .udvd files.
+For how the subtitle tool works see: \nameref{sec:subtitles}
+The subtitle format for Blu-Ray is PGS with a .sup extension which CinGG does not support. It is an image format (also 3D) so it can be created, converted and extracted only via specific OCR. You can use external programs like ffmpeg; SubTitle Editor; MKVToolNix; etc.
 
 \section{Dvd Interlaced Chroma}%
 \label{sec:dvd_interlaced_chroma}
+\index{DVD!yuv420p interlace mode}
 
 \CGG{} uses 4:4:4 colorspace to edit, so it is necessary to convert interlaced 4:2:0 video to 4:4:4.
 But you can run into problems, referred to as the \textit{chroma bug}, which you see in DVD media displayed on higher resolution monitors -- streaks or spiky horizontal lines are visible in the chroma channel, especially on diagonal edges. The Chroma Bug is specific to MPEG and 4:2:0 encoding.
@@ -528,7 +500,7 @@ This program can be used to scan captured broadcast data streams and convert the
 
 usage:
 
-\begin{lstlisting}[language=bash,numbers=none]
+\begin{lstlisting}[style=sh]
 ./zmpeg3cc2txt  [-c cc_service ]  [-s start:length, ...]  [ -t track ]  [-v verbose ] [-w wdw mask ]  [-x file.xml ]  [-o file.udvd ]  file.ts
 \end{lstlisting}
 
@@ -555,7 +527,7 @@ usage:
 To use this program, the input file must be a transport stream (broadcast video) which contains closed captioning services.  The service id defaults to one, and the default video track is zero.  Either \texttt{-o} or \texttt{-x} must be specified to indicate the output file format desired.  If the output file name is a '-' then stdout is selected as the output file. 
 For example:
 
-\begin{lstlisting}[language=bash,numbers=none]
+\begin{lstlisting}[style=sh]
 zmpeg3cc2txt -o - /dvb_data/channel5.ts
 \end{lstlisting}
 
@@ -565,12 +537,13 @@ For some time, DVD manufacturers have been employing  a variety of measures to m
 
 \section{HDV on a Blu-ray Disc Without Re-encoding}%
 \label{sec:hdv_bd_without_reencoding}
+\index{BluRay!HDV without re-encoding}
 
 An MTS file is a video file saved in the high-definition (HD) MPEG Transport Stream video format, commonly called \textit{AVCHD}.  It contains HD video compatible with Blu-ray disc format and is based on the MPEG-2 transport stream.   MTS files are often used by Sony, Panasonic, Canon and other HD camcorders.  Legal input for Video -- MPEG1VIDEO, MPEG2VIDEO, H264; Audio -- MP1, MP2, AC3, AC3PLUS, DTS, TRUHD. 
 
 For creating a blu-ray disc, if you have HDV MPEG-2 media that is in blu-ray format, you can save the original quality of your work, rather than rendering it to another format.  Follow the steps below directly instead of going through \CGG{}.  It has been tested on 10 different MTS files.
 
-\begin{lstlisting}[language=bash,numbers=none]
+\begin{lstlisting}[style=sh]
 du -sb /yourHDVfile.MTS                # Determine the size of your file in bytes.
 blocks=((size-in-bytes/2048 + 4096))   # Convert bytes into blocks + a little more.    
 mkudffs /tmp/newfilename.udfs blocks   # Create a file with that \# of blocks + some extra.
@@ -588,7 +561,7 @@ Creating BD images to be written to media requires usage of \textit{mount} and \
 
 The line to add to \texttt{/etc/fstab} will look something like the following, assuming your username is \textit{name} and your groupid may be \textit{users} or \textit{name}.  If you do an \texttt{ls -l} in your home directory, the $3^{rd}$ and $4^{th}$ fields shown will be your uid or name and gid or groupid which you must substitute in the line below.
 
-\begin{lstlisting}[language=bash,numbers=none]
+\begin{lstlisting}[style=sh]
 /home/name/image  /home/name/bluray  udf noauto,loop,rw,user,uid=name,gid=groupid 0 0
 \end{lstlisting}
 
@@ -596,12 +569,13 @@ Also, be sure to do a \texttt{mkdir bluray} in your \texttt{/home/name} director
 
 \section{Blu-ray from Multiple \CGG{} Output}%
 \label{sec:bluray_multiple_cinelerra_output}
+\index{BluRay!multiple output}
 
 Writing prepared multiple \CGG{} output files, \texttt{bd.m2ts}, to a single bluray disc is relatively easy to do but is not done automatically.  You can render all of the desired files via the Create BD menu, save each individual \texttt{bd.m2ts} file with a unique name, construct a Menu Title that reflects the contents of each of these files, then manually use a few commands to create a udfs file to be written to BD.
 
 Usage of the final preparation taken from the bdwrite program comments:
 
-\begin{lstlisting}[language=bash,numbers=none]
+\begin{lstlisting}[style=sh]
 ./bdwrite <tgt_dir_path> <playlist-0> <sep> <playlistp1> <sep> ... <sep> <playlist-n>
 
 <sep> == -<pgm_pid> | --<pgm_pid> | ---<pgm_pid>
@@ -614,7 +588,7 @@ One title is built for each playlist; playlist-0 is used as first-play item.  Th
 
 For example:
 
-\begin{lstlisting}[language=bash,numbers=none]
+\begin{lstlisting}[style=sh]
 ./bdwrite /tmp/dir /path/menu_titles.m2ts --- /path/clip0.m2ts -- /path/clip1.m2ts -- /path/clip2.m2ts
 \end{lstlisting}
 
@@ -625,13 +599,13 @@ The basic idea is to use playlist-0 as a menu or directions to use the bluray pl
     \item Using \CGG{}, design your Title page using a few seconds of video and the \textit{Title} plugin.
     \item Use BD Create to render your short Title video.
     \item Next is the most complicated part which is to run \texttt{mkudffs} with a sufficient amount of disk space to hold all of the \texttt{bd.m2ts} files \textit{plus a little more!}  To calculate this, you can record the sizes from having run BD Create mkudffs.  This number is displayed on the terminal screen when using the command line interface each time and add them together.  Or recalculate the size of each \texttt{bd.m2ts} using the formula below and adding them all together.  This is the number of blocks used to make a bluray image space for bdwrite to use.  For many files, this could require a huge amount of space, so check first.
-    \begin{lstlisting}[language=bash,numbers=none]
+    \begin{lstlisting}[style=sh]
     Total size = File0 size in bytes / 2048 + 4094  "+"   File1 size in bytes / 2048 + 4094  "+" ...
     \end{lstlisting}
     Now create the image file via:   \texttt{mkudffs image <Total size>}  where image or udfs is the image name.
     \item Loop mount the disk image (refer to Section \hyperref[sec:bluray_workaround_mount_umount]{13.7}).
     \item Then actually write your multiple bd.m2ts type files onto the \textit{image} where \texttt{<cin\_path>} is the location of the \CGG{} binary \textit{bdwrite} file and \texttt{<path>} is your directory path.  Below is a single line that wrapped around with 4 Titles.
-    \begin{lstlisting}[language=bash,numbers=none]
+    \begin{lstlisting}[style=sh]
     <cin_path>/bin/bdwrite image /<path>menu_titles.m2ts --- /<path>/bd1.m2ts -- /<path>/bd2.m2ts -- /<path>/bd3.m2ts -- /<path>bd4.m2ts
     \end{lstlisting}
     Note that the 3 dashes after the \texttt{menu\_titles.m2ts} lets the bluray player know to \textit{pause} after playing the few seconds video which contains the index to the rest of the files.  The 2 dashes after each of the \texttt{bd.m2ts} signify \textit{stop}.  That is when you will have to use your remote to \textit{Search Titles} in order to play the next one you want to see.  In addition, if for some reason you just want to \textit{play all}, you will have to add another line to the Title menu as a choice and list all of the 4 files in a row at the end of your bdwrite line without any dashes in between.
@@ -643,7 +617,7 @@ Figure~\ref{fig:dvd-title} demonstrates  an example of setting up a Title menu o
 
 \begin{figure}[htpb]
     \centering
-    \includegraphics[width=0.8\linewidth]{dvd-title.png}
+    \includegraphics[width=0.9\linewidth]{dvd-title.png}
     \caption{Title menu for DVD/BD}
     \label{fig:dvd-title}
 \end{figure}
@@ -676,7 +650,7 @@ Example of Video Source with 4:3 Aspect Ratio, Being Transcribed to 16:9 and Cre
 
 \begin{figure}[htpb]
     \centering
-    \includegraphics[width=1.0\linewidth]{dvd03.png}
+    \includegraphics[width=0.8\linewidth]{dvd03.png}
     \caption{Set Scale Ratio to Cropped}
     \label{fig:dvd03}
 \end{figure}
@@ -703,12 +677,12 @@ Left and right sides of the bottom portion show the Source and the Destination X
 Keep in mind that the monitor you are using is NOT the intended output display device -- your digital TV is, which most likely will have different looking aspect/pixels, etc.
 
 \begin{enumerate}[start=11]
-    \item In order to \textit{crop} the bottom of the video in order to preserve all of the image on the top, modify the Src Y value on the bottom of  the left hand side in the Scale Ratio plugin.  Src Y which was $21$ has now been changed to $-18$.  You will see in the Compositor window how the bottom dark colored border is now gone so that none of the top portion which contains a person's head will be chopped off. Compare figure~\ref{fig:dvd04} to figure~\ref{fig:dvd03} and note the blue legs can be now seen to the waist.
+    \item In order to \textit{crop} the bottom of the video in order to preserve all of the image on the top, modify the Src Y value on the bottom of  the left hand side in the Scale Ratio plugin.  Src Y which was $21$ has now been changed to $-18$.  You will see in the Compositor window how the bottom dark colored border is now gone so that none of the top portion which contains the Bunny's head will be chopped off. Compare figure~\ref{fig:dvd04} to figure~\ref{fig:dvd03} and note the Bunny's head.
 \end{enumerate}
 
 \begin{figure}[htpb]
     \centering
-    \includegraphics[width=1.0\linewidth]{dvd04.png}
+    \includegraphics[width=0.8\linewidth]{dvd04.png}
     \caption{Better scale on compositor}
     \label{fig:dvd04}
 \end{figure}
@@ -720,7 +694,7 @@ Keep in mind that the monitor you are using is NOT the intended output display d
 
 \begin{figure}[htpb]
     \centering
-    \includegraphics[width=0.9\linewidth]{dvd-batch05.png}
+    \includegraphics[width=1.0\linewidth]{dvd-batch05.png}
     \caption{Error in Batch Render}
     \label{fig:dvd-batch05}
 \end{figure}
@@ -728,7 +702,7 @@ Keep in mind that the monitor you are using is NOT the intended output display d
 \begin{enumerate}[start=13]
     \item Next, make sure you have the Timeline set in the Main window at the beginning of where you want to start rendering.  Also, make sure the first line in the \textit{Batches to render} section is highlighted as you can see above by the blue highlighting.  Click on the \textit{Start} box in the Batch Render window and you will see the video playing in the Compositor window.
     \item \CGG{} program will be stopped when done rendering; you will be at the terminal prompt where you will see it has printed out some informational messages (or errors if problems), the last 2 are:
-    \begin{lstlisting}[language=bash,numbers=none]
+    \begin{lstlisting}[style=sh]
     To burn dvd, load blank media and run:
     growisofs -dvd-compat -Z /dev/dvd -dvd-video /mnt0/dvd_20161027-131723/iso
     \end{lstlisting}