Terje's corrections for Preserving Camcorder Media
[goodguy/cin-manual-latex.git] / parts / Preserving.tex
1 \chapter{Overview}%\r
2 \label{cha:camcorders}\r
3 \r
4 This document describes the methods used to achieve a "backup type" or intermediate codec\r
5 for non-edited source video camcorder formats, compatible with and viewable on Bluray hardware players. After you have\r
6 moved your camcorder media onto a computer disk, you can with some extra effort, transfer them for safekeeping and\r
7 longer term storage on simple viewable Blu-ray video discs. \r
8 \r
9 Transferring camcorder media to digital files on a computer, and next to optical Blu-ray video media is especially\r
10 important for legacy tape-based camcorders, because tape will degrade over time. You can do this using a combination of\r
11 free tools on Linux, generic and independent of any NLE. \r
12 \r
13 In this case we use and keep interlaced video as on the source or digitized video (PAL 50i, 25 fps) for both DV and HDV\r
14 formats.  As confirmed by the ffmpeg output below, DV uses 25 Mbps data rate (DV25), is Standard Definition (SD),\r
15 resolution 720{\texttimes}576, 8 bits color depth 4:2:0, display aspect ratio (DAR) 4:3 while HDV is High Definition HD video,\r
16 resolution 1440{\texttimes}1080, DAR 16:9, 8 bits color depth 4:2:0. \r
17 \r
18 We utilize or keep relative low MPEG-2 video compression at the same bit-rate 25 Mbps as the original video recorded\r
19 onto the source tapes. That is about 13 GB per hour video and audio in total, and about 3 hours playtime with 40 GB\r
20 BD-video size (of max 46.5 GB) on each 50 GB BD-R DL Blu-ray disc. Audio is transcoded to uncompressed LPCM compatible\r
21 with BD-video. \r
22 \r
23 In this how-to we combine \textbf{ffmpeg}, \textbf{tsMuxeR} and \textbf{xorriso} to create the MTS-video stream, to\r
24 create the Blu-ray ISO image, and to burn the image to Blu-ray video disc. The benefit of using tsMuxer here, is its\r
25 support of UDF version 2.50 as required by the Blu-ray video standard. Listed next are the possible camcorder video formats on Blu-ray video discs.\r
26 \r
27 \begin{itemize}\r
28 \item \textbf{DV} (1995) transfer to SD-blu-ray video (re-encoding video to mpeg2, re-encoding DV LPCM audio to Blu-ray LPCM) \r
29 \item \textbf{HDV} (2004) transfer to blu-ray video (copying mpeg2 video, re-encoding MP2 audio to Blu-ray LPCM or AC3) \r
30 \item \textbf{AVCHD} (2006-current) transfer to Blu-ray video (copying H.264 video and AC3 audio)\r
31 \end{itemize}\r
32 \r
33 An alternative method as described in the CinGG manual, is to use \textit{mkudffs} and \textit{bdwrite} packaged with CinGG, to create the udfs image and burn it to Blu-ray disc using \textit{growisofs} or \textit{dd}. \\\r
34 {\small \url{https://cinelerra-gg.org/download/CinelerraGG\_Manual/Creating\_Blu\_ray\_Without\_Re.html}}\r
35 \r
36 There are other methods described on the internet and there are alternatives to the software programs used here that work as well. \r
37 \r
38 \chapter{Video recording formats}%\r
39 \label{cha:recording}\r
40 \r
41 A description of the most common video recording formats for consumer and prosumer equipment; camcorders, analog video\r
42 cassette recorders (VCR decks), digital video hard disc recorders, and optical disc recorders (DVD, Blu-ray).\r
43 \r
44 \section{\textbf{Analog video} (legacy) onto magnetic tape cassettes}%\r
45 \label{sec:analog}\r
46 \settocdepth{subsection}\r
47 \r
48 \subsection{\textbf{VHS (1976), VHS-C (1982), and Video8 (1984)}}%\r
49 \label{sub:vhs1976}\r
50 \r
51 %\r
52 % WARNING - the next line will change it for every list for rest of document\r
53 %\r
54 %\setlist{noitemsep}\r
55 \begin{itemize}[noitemsep]\r
56 \item Composite Audio/Video is encoded on one channel with maximum horizontal resolution 240 (250) dots (or visually\r
57 resolvable vertical picture lines) for VHS/VHS-C and 280 dots for Video8 (2.7MHz video bandwidth).\r
58 \item In comparision, horizontal resolution bandwidth for PAL broadcast: 5.0-5.5 MHz, NTSC: 4.2 MHz.\r
59 \item It is the horizontal resolution that makes the big difference in picture quality since all video formats have the\r
60 same number of vertical resolution (or visible horizontal scan lines); always 576 for PAL/SECAM and 486 for NTSC.\r
61 \item RCA (phono) connectors: yellow for composite video, red and white for left and right audio signals.\r
62 \item 21-pin SCART Euro connector with optional RCA adapter.\r
63 \item Magnetic tape media in full size VHS (1/2") cassettes, VHS-C (1/4") compact and 8\ mm cassettes.\r
64 \item Cassette adapters to playback compact VHS-C cassettes on full size VHS decks/players.\r
65 \end{itemize}\r
66 \r
67 \subsection{SVHS (Super VHS, 1987), SVHS-C (-Compact, 1987) and Hi8 (1989)}%\r
68 \label{sub:svhs1987}\r
69 \r
70 \begin{itemize}[noitemsep]\r
71 \item S-Video (separate video, Y/C) encodes video \href{https://en.wikipedia.org/wiki/Luma\_(video)}{luma}\r
72 (brightness/contrast/black\&white) and\r
73 \href{https://en.wikipedia.org/wiki/Chrominance}{chrom}\href{https://en.wikipedia.org/wiki/Chrominance}{a} (color) on\r
74 two separate channels, achieving higher image quality and amount of picture details over composite video.\r
75 \item Max visible horizontal resolution is 400 dots for SVHS/SVHS-C and 440 dots for Hi8 systems on high-end VCR\r
76 machines (4.5 MHz decks). In practice consumer/prosumer camcorder recordings quality vary from about 330-350 dots\r
77 horizontal resolution (3.5MHz), which is equivalent to analog TV set quality.\r
78 \item 4-pin mini-DIN S-video connector for Y/C video, red and white RCA line connectors for left and right audio;\r
79 optional SCART Euro adapter with 4-pin video and RCA audio connectors.\r
80 \item In comparision, analog Component video (three component YPbPr) has the highest color resolution and is encoded\r
81 over three channels with green, blue and red RCA connectors (consumer) or with BNC connectors (prosumer), additional red\r
82 and white phono line connectors for audio.\r
83 \end{itemize}\r
84 \r
85 \section{\textbf{Digital video}}%\r
86 \label{sec:digital}\r
87 \r
88 \subsection{\textbf{DV (1995), Digital8 (1999)}}%\r
89 \label{sub:dv1995}\r
90 \r
91 \begin{itemize}[noitemsep]\r
92 \item DV refers to a family of codecs and tape formats used for storing digital video, especially on MiniDV cassettes, the most popular tape format, or on Digital8 cassettes using a DV codec. \r
93 \item DV codecs are still sometimes used when dealing with legacy standard definition SD video:\r
94  \newline\hspace*{.5cm}PAL:  625i50, 720 {\texttimes} 576 frame size, 25 fps, 8 bit 4:2:0 subsampling\r
95  \newline\hspace*{.5cm}NTSC: 525i60, 720 {\texttimes} 480 frame size, 30 fps, 8-bit 4:1:1 subsampling\r
96 \item The same frame size is used for 4:3 and 16:9 frame aspect ratios, resulting in different pixel aspect ratios for\r
97 fullscreen and anamorphic widescreen video.\r
98 \item DV uses lossy, DCT algorithm intraframe video compression 5:1 on a frame-by-frame basis.\r
99 \item Audio almost exclusively is stored as 16-bit LPCM at 48 kHz sampling rate, 1.5 Mbit/s stereo.\r
100 \item Data rate is about 25 Mbit/s for video, thus DV25, and an additional 1.5 Mbit/s for PCM audio. \r
101 \item Total stream is 29 Mbps, or 3.6 MiB/s. The information output is approximately 200 MiB per minute, 12 GiB or 13 GB\r
102 per hour playtime.\r
103 \item DV camcorders and decks have IEEE 1394 (FireWire, i.LINK) ports for digital video transfer. \r
104 \item \textbf{DV50} (Digital-S or D-9 and DVCPRO50) is a 50 Mbit/s variant of DV with improved 4:2:2 chroma subsampling and 3.3:1 compression.  This in effect cuts total record time of any given storage medium in half compared to DV25. \r
105 \item DV was strongly associated with the transition from analog to digital desktop video production.\r
106 \item Digital8 equipment recorded in DV format only, but usually could playback Video8 and Hi8 tapes as well, and were\r
107 also capable to do analog to digital video conversion during playback. \r
108 \item Most (but not all) modern digital camcorders provided an analog-to-digital\r
109 "passthrough" capability. This feature fed an analog input signal (usually via S-Video,\r
110 sometimes RCA) into the camcorder and output a standard DV signal. The camcorder converts the analog signal on-the-fly\r
111 using a hardware encoder. The input device could be your old analog camcorder (playing 8\ mm or Hi8 tapes), a VHS/VHS-C\r
112 video player, to convert analog to digital output via Firewire \textbf{dv} file extension.\r
113 \end{itemize}\r
114 \r
115 \subsection{\textbf{DVD-Video} (1996)}%\r
116 \label{sub:DVD-Video}\r
117 \r
118 DVD-Video discs are intended for full-length movies and offer a range of features including the following:\r
119 \begin{itemize}[noitemsep]\r
120 \item Playing time: a nominal 133 minutes playing time for DVD-5 or each side of a DVD-10 and 240 minutes for DVD-9 using opposite track path format. In practice playing times are often reduced in favour of improved quality.\r
121 \item Video encoding: MPEG-2 (\href{mailto:MP@ML}{MP@ML}) or MPEG-1.\r
122 \item Audio Quality and Languages: Dolby Digital, DTS, MPEG-2 or Linear PCM audio for up to 5.1 channel surround sound.\r
123 \end{itemize}\r
124 \r
125 \begin{itemize}\r
126 \item To record digital video, DVD-Video uses \href{https://en.wikipedia.org/wiki/H.262/MPEG-2\_Part\_2}{H.262/MPEG-2 Part\r
127 2} compression at up to 9.8~Mbit/s, maximum of 10.08 Mbit/s can be split amongst audio and video. DVD-Video supports\r
128 video with a \href{https://en.wikipedia.org/wiki/Color\_depth}{bit depth} of 8 bits per color, encoded as\r
129 \href{https://en.wikipedia.org/wiki/YCbCr}{YCbCr} with 4:2:0\r
130 \href{https://en.wikipedia.org/wiki/Chroma\_subsampling}{chroma subsampling}. The H.262/MPEG-2 Part 2 format supports\r
131 both interlaced and progressive scan content.\r
132 \item As for lines of horizontal resolution, DVD has about 500. In analog output signal terms, typical luma frequency\r
133 response maintains 53/145 full amplitude to between 5.0 - 5.5 MHz. This is below the 6.75 MHz native frequency of the\r
134 MPEG-2 digital signal. Chroma frequency response is one-half that of luma.\r
135 \end{itemize}\r
136 \r
137 The following formats are allowed for H.262/MPEG-2 Part 2 video:\r
138 \begin{itemize}\r
139 \item At a display rate of 25 frames per second, interlaced or progressive scan (commonly used in regions with 50 Hz\r
140 image scanning frequency, compatible with analog 625-line PAL/SECAM):\r
141  \begin{adjustwidth}{.5cm}{0cm}\r
142  720 {\texttimes} 576 pixels (D-1 resolution, 4:3 fullscreen or 16:9 anamorphic widescreen aspect ratio)\r
143  \end{adjustwidth}\r
144 \item  At a display rate of 29.97 frames per second, interlaced or progressive scan (commonly used in regions with 60 Hz\r
145 image scanning frequency, compatible with analog 525-line NTSC):\r
146  \begin{adjustwidth}{.5cm}{0cm}\r
147  720 {\texttimes} 480 pixels (D-1 resolution, 4:3 or 16:9)\r
148  \end{adjustwidth}\r
149 \end{itemize}\r
150 \r
151 The official allowed formats for the audio tracks on a DVD-Video are:\r
152  \begin{itemize}\r
153  \item PCM: 48 kHz or 96 kHz sampling rate, 16 bit or 24 bit Linear PCM, 2 to 6 channels, up to 6,144 kbit/s; N. B.\r
154 16-bit 48 kHz 8 channel PCM is allowed by the DVD-Video specification but is not well supported by authoring\r
155 applications or players.\r
156  \item  AC-3: 48 kHz sampling rate, 1 to 5.1 (6) channels, up to 448 kbit/s.\r
157  \item  MP2: 48 kHz sampling rate, 1 to 7.1 channels, up to 912 kbit/s.\r
158  \item  DTS: 48 kHz or 96 kHz sampling rate; channel layouts = 2.0, 2.1, 5.0, 5.1, 6.1; bitrates for 2.0  and 2.1 =\r
159 377.25 and 503.25 kbit/s, bitrates for 5.x and 6.1 = 754.5 and 1509.75 kbit/s.\r
160 \item File system:\r
161 \begin{itemize}[noitemsep]\r
162 \item Almost all DVD-Video discs use the UDF bridge format, which is a combination of the DVD MicroUDF (a subset of UDF 1.02) and ISO 9660 file systems.\r
163 \item  The UDF bridge format provides backwards compatibility for operating systems that\r
164 support only ISO 9660. \r
165 \item Most DVD players read the UDF filesystem from a DVD-Video disc and ignore the ISO9660 filesystem.  \r
166 \end{itemize}\r
167 \end{itemize}\r
168 \r
169 \subsection{\textbf{HDV (2003)}}%\r
170 \label{sub:HDV2003}\r
171 \r
172 \begin{itemize}[noitemsep]\r
173 \item HDV was a successor format to DV with an updated video codec, and used the same MiniDV cassette format, optional\r
174 specifically for HDV recording on tape with reduced drop-out rate.\r
175 \item Some manufacturers offered on (larger) camera hard disk recording units capable of recording HDV both onto tape\r
176 and/or onto file-based media via FireWire connection. \r
177 \item HDV camcorders can typically switch between HDV/MP2 and SD-DV/PCM recording modes.\r
178 \item HDV 1080i with horizontal resolution 1440 is twice the 720 resolution of DV and DVD, and the perceived\r
179 sharpness with HDV is much higher when scaled up to full HD (TV) resolution.\r
180 \end{itemize}\r
181 \r
182 \begin{tabular}{ll}\r
183 ------------------- \\\r
184 {\textbullet}\textbf{HDV 1080i} specification (HD2): & \textbf{HDV 720p} specification (HD1): \\\r
185 {\textbullet} 1080/ 50i (PAL), 1080/ 60i (NTSC) &  720/25p, 720/50p,720/30p, and 720/60p \\\r
186 {\textbullet} 1440 {\texttimes} 1080, anamorphic pixels 4:3=1.33 & 1280 x 720, Pixel aspect ratio 1.0  \\ \r
187 {\textbullet} 16:9 Display aspect ratio & 16:9 Display aspect ratio \\\r
188 \hspace*{.5cm} - 720{\texttimes}480/ 60i  (SD-DV 4:3 og 16:9) \\\r
189 \hspace*{.5cm} - 720{\texttimes}576/ 50i  (SD-DV 4:3 og 16:9) \\\r
190 {\textbullet} MPEG-2 interframe GOP (\href{mailto:MP@H-14}{MP@H-14}) & MPEG-2 (\href{mailto:MP@H-14/HL}{MP@H-14/HL}) \\\r
191 {\textbullet} 8 bit color depth 4:2:0 subsampling & 8 bit color depth 4:2:0 subsampling \\\r
192 {\textbullet} 25 Mbps data rate after compression (20:1) & 19.4 Mbps data rate after compression \\\r
193 {\textbullet} MP2/MPEG-1 Audio Layer II & MP2/MPEG-1 Audio Layer II \\ \r
194 {\textbullet} Stereo (2-ch), 384 kbps & Stereo (2-ch), 384 kbps \\\r
195 {\textbullet} A/V out: HDMI, Component, S-video/RCA\ &  A/V out: HDMI, Component, S-video/RCA \\\r
196 {\textbullet} IEEE 1394 (MPEG-2-TS) stream interface & IEEE 1394 (MPEG-2-TS) stream interface \\\r
197 {\textbullet} M2T file extension & M2T file extension\r
198 \end{tabular}\r
199 \r
200 \subsection{\textbf{AVCHD (2006-current)}}%\r
201 \label{sub:AVCHD}\r
202 \r
203 \begin{itemize}\r
204 \item AVCHD stands for \textit{Advanced Video Coding High Definition}, in particular, \textit{MPEG-4 Part 10:\r
205 AVC/H.264}. The intent of the H.264/AVC project was to create a standard capable of providing good video quality at\r
206 substantially lower bit rates than previous standards (i.e., half or less the bit rate of MPEG-2, H.263, or MPEG-4 Part\r
207 2). \\ \r
208 \item AVCHD is a file based format for digital camcorders to record and playback 1080i and 720p HD-video onto certain\r
209 random access media. Memory cards, thumb drives, and HDDs use the FAT file system. This highly compressed video allows for\r
210 recording long videos in high definition.\\\r
211 \item AVCHD was originally a simplified version of the Blu-ray standard to enable DVD and BD-based camcorders.\r
212 Recordable optical discs use UDF or ISO9660 derived from the Blu-ray disc specification. For example, it utilizes a\r
213 legacy 8.3 file naming system while Blu-ray disc uses long filenames. \\\r
214 \item MTS file extension changes to M2TS when MTS recorded data is transferred to the computer for storing the video in\r
215 a Blu-ray disc. \\\r
216 \item Playback is possible on an AVCHD-compatible Blu-ray Disc player/recorder, DVD player/recorder, or PlayStation 3, \r
217 the 8 cm DVDs (discs recorded in AVCHD) you have recorded or DVDs (discs recorded in AVCHD) and Blu-ray Discs created\r
218 by importing videos to a PC or Blu-ray Disc player. \\\r
219 \item Today AVCHD is the most popular camcorder format for consumers and prosumers, and is also available as AVCHD\r
220 Progressive/PCM models for professional use.\\\r
221 \item AVCHD supports both \textit{AVCHD-SD Standard Definition} and \textit{AVCHD 1080i High Definition} interlaced\r
222 video, while AVCHD 1080i is available with most AVCHD camcorders. AVCHD supports 720-line progressive recording mode at\r
223 frame rates of 24 and 60 frames/s for 60 Hz models and 50 frames/s for 50 Hz models.\\\r
224 \item Also, 3D (MVC format) and 1080/60p(1080/50p) video formats were added as an extension to the AVCHD format to\r
225 create the \textit{AVCHD Ver. 2.0, 2011} (AVCHD 3D, AVCHD Progressive) format. Compatibility in AVCHD Ver. 2.0 format compliant devices is secured by being standardized as the AVCHD format.\\\r
226 \end{itemize}\r
227 --------------------------------------\r
228 \r
229 \begin{tabular}{ll}\r
230  \textbf{8\ cm DVD/Built-in/SD Memory/M-Stick: } & \textbf{Built-in media/SD Memory/Memory Stick:} \\\r
231 \r
232  {\textbullet} 1920{\texttimes}1080/ 60i, 50i, 24p &  1920{\texttimes}1080/ 60p, 50p \\ \r
233  {\textbullet} 1440{\texttimes}1080/ 60i, 50i, 24p & 1440{\texttimes}1080/ 60p, 50p \\\r
234  {\textbullet} 1280{\texttimes}720/ 60i, 50i, 24p & 1280{\texttimes}720/ 60p, 50p \\\r
235  {\textbullet} 720{\texttimes}480/ 60i  (SD 4:3 og 16:9)  \\\r
236  {\textbullet} 720{\texttimes}576/ 50i  (SD 4:3 og 16:9) \\ \r
237  {\textbullet} 16:9 Display aspect ratio & 16:9 Display aspect ratio \\\r
238  {\textbullet} MPEG-4 Part 10: AVC / H.264 & MPEG-4 Part  10: AVC / H.264 \\\r
239  {\textbullet} 8 bit color depth 4:2:0 subsampling & 8 bit color depth 4:2:0 subsampling \\\r
240  {\textbullet} {\textless}= 24 Mbps data rate & {\textless}= 28 Mbps data rate \\\r
241  {\textbullet} {\textless}= 18 Mbps data rate for DVD   \\\r
242  {\textbullet} Dolby Digital AC-3\ \ , 64-640 kbps &  Dolby Digital AC-3, 64-640 kbps \\ \r
243  \hspace*{.3cm} 2 ch stereo and 5.1  (5-ch + subw.) surround & \hspace*{.3cm} 1$\sim$ 5.1 channels \\\r
244  {\textbullet} Linear PCM,  1.5 Mbps (2 ch) & Linear PCM,  1.5 Mbps (2 ch)  \\\r
245   \hspace*{.3cm}1$\sim$ 7.1 channels & \hspace*{.3cm} 1$\sim$ 7.1 channels \\\r
246  {\textbullet} A/V out: HDMI, Component, S-video/RCA &  A/V out: HDMI, Component, S-video/RCA \\\r
247  {\textbullet} MPEG-2 Transport Stream & MPEG-2 Transport Stream \\\r
248  {\textbullet} MTS file extension\ \ (recorded) & MTS file extension (recorded) \\\r
249 \end{tabular}\r
250 \r
251 \subsection{\textbf{Blu-ray BD-Video (2006), UHD-video (2016)}}%\r
252 \label{sub:Blu-ray}\r
253 \r
254 All standard DVDs will play on existing Blu-ray players, making the switch to Blu-ray much easier than the switch\r
255 from VHS to DVD. Ultra HD Blu-ray is the latest version available, supporting 4K resolution content. Historically,\r
256 Blu-ray Disc allows video with a color (bit) depth of 8-bits per color YCbCr with 4:2:0 chroma subsampling (colors\r
257 compressed to 25\% of uncompressed), which means 256 possible values for red, green and blue; 16.7 million colors in\r
258 total. Ultra-HD Blu Ray is 10-bit 4:2:0 to reduce color banding, giving 1024 values for RGB, 1.0 billion colors in\r
259 total, or 64x more than 8-bit.\r
260 \r
261 BDMV Video encoding: \r
262 \begin{itemize}[noitemsep]\r
263 \item UDF2.5 as file system (BD-R/RE, 2005)\r
264 \item M2TS file extension\r
265 \item H.262/MPEG-2 Part 2 (\href{mailto:MP@HL}{MP@HL}, \href{mailto:MP@ML}{MP@ML})\r
266 \item H.264/MPEG-4 AVC (\href{mailto:HP@L4.1}{HP@4.1}, \href{mailto:MP@L4.1}{MP@4.1})\r
267 \item SMPTE VC-1 (\href{mailto:AP@L3}{AP@L3})\r
268 \item H.265/H.265/MPEG-H Part 2 (HEVC) (only Ultra HD Blu-ray on High-density optical disc)\r
269 \end{itemize}\r
270 \r
271 BD Video movies have a maximum data transfer rate of 54 Mbit/s, a maximum AV bitrate of 48 Mbit/s (for both audio\r
272 and video data), and a maximum video bit rate of 40 Mbit/s., BD disc capacities, each with its own data rate: \r
273 \begin{itemize}[noitemsep]\r
274 \item 25 GB (BD-R SL)\r
275 \item 50, 66 GB (BD-R DL) at 72 or 92 Mbit/s (50 GB BD-R DL 4x read speed supports UHD-video)\r
276 \item 100 GB (TL), 128 GB (QL) at 92, 123, or 144 Mbit/s (BD-R XL)\r
277 \end{itemize}\r
278 \r
279 Supported video formats (shortened):\r
280 \r
281 \begin{tabular}{ l c c}\r
282 \textbf{Format} & \textbf{Resolution and frame rate} & \textbf{Display aspect ratio }\\\r
283 \r
284 4K UHD & 3840x2160 60p, 50p & 16:9 \\\r
285          & 3840x2160 25p, 24p & 16:9 \\\r
286 \\\r
287 HD & 1920x1080 60p, 50p & 16:9 \\\r
288    & 1920x1080 25p, 24p & 16:9 \\\r
289    & 1920x1080 29.97i, 25i & 16:9 \\\r
290    & 1440x1080 29.97i, 25i & 16:9\\\r
291 \\\r
292 HD & 1440x1080 24p & 16:9\\\r
293    & 1280x720 59.94p, 50p 1 & 16:9 \\\r
294    & 1280x720 24p & 16:9 \\\r
295 \\\r
296 SD & 720x480 29.97i, 25i & 4:3 or 16:9\\\r
297 \end{tabular}\r
298 \r
299 \chapter{How to digitize and capture analog video to digital SD video format with A/D video conversion}%\r
300 \label{cha:how_to}\r
301 \r
302 \section{Methods and workflow}%\r
303 \label{sec:methods}\r
304 \r
305 There are a number of ways to get analog source recorded video digitized and captured into the computer. \r
306 \begin{itemize}\r
307 \item One way is to use the passthrough feature of an available miniDV camcorder or the digital output of a Sony Digital 8\r
308 camcorder to convert the Hi8 source to DV, which is then sent via firewire to the computer.\r
309 \item Another alternative might be a Linux supported external capture card to USB3 (often MPEG-4), or find a higher-end\r
310 internal PCIe analog video capture card to store uncompressed, 422 or DV video. \r
311 \item A third way is to use a standalone analog to digital A/D converter and capture device. This might be to DV HDD recorder\r
312 or optional to a high-end analog/SDI and a SSD 422 codec (i.e ProRes) recorder.\r
313 \end{itemize}\r
314 \hspace*{.9cm} An example workflow and setup for this third way:\r
315 \r
316 \small{Analog Hi8 \hspace*{.15cm}            S-Video  \hspace*{.8cm}           S-Video} \\\r
317        tape player ----------> TBC --------------> A/D-conv. \\\r
318 \hspace*{8cm}                                            $\backslash$ \_ DV/HDV HDD \hspace*{.5cm} Firewire \hspace*{.5cm} PC \\\r
319 \hspace*{8.3cm}                                                       \_ rec/player  ------------------------> DV/M2T \\\r
320 \hspace*{6.4cm}                                              Firewire \hspace*{.1cm}/ \\\r
321 \hspace*{3.5cm}                              HDV tape player ----------->\r
322 \r
323 \begin{itemize}\r
324 \item A fourth, interesting way as discussed on the CinGG mailing list (yet to be tested), is to combine a HDMI-USB3 capture dongle with an Analog Video to Digital HDMI miniConverter (ADC). The analog video player output (via TBC) connects to the actual input connectors (S-video/RCA or possibly Component) of the adapter.  Reference the following from/to: \\\r
325 {\small \url{https://lists.cinelerra-gg.org/pipermail/cin/2021-October/003960.html}} \\\r
326 {\small \url{https://lists.cinelerra-gg.org/pipermail/cin/2021-October/003970.html}}\r
327 \r
328 \end{itemize}\r
329 \r
330 {\small \texttt{S-Video Out -> A/D video converter -> HDMI/USB3-> HDMI/USB3 capture card}}\r
331 \r
332 \section{Equipment and setup}%\r
333 \label{sec:equipment}\r
334 \r
335 \begin{itemize}\r
336 \item The first required is a tape player device (VCR deck or camcorder) to playback the analog video tape cassette formats,\r
337 either VHS/ SVHS, VHS-C/ SVHS-C or Video8/ Hi8. Use a video head cleaning tape before use. Wind and rewind the tape\r
338 cassette before playback in Edit mode "ON" to minimize picture deterioration. \\\r
339 \item A second recommended device for all capture methods is a Time Base Corrector (TBC).  Connected to the analog output of\r
340 a VCR, a good TBC can make wonder and remove most or all of the flagging, shaky pictures, wavy lines, and other time\r
341 base problems from a videotape, to get a clearer and more steady picture. The best is a standalone, fullframe\r
342 high-resolution TBC of broadcast quality; minimum is a line-based TBC built in high-end VCR decks. \\\r
343 \item A third, optional feature before digitizing is a noise filter to reduce/soften noise and grain (snow) from bad VHS tape\r
344 recordings, or also when video that is over-processed using sharpness controls and enhancers. Noise filter adjustment\r
345 may be part of the TBC setup and preview, or fixed built in the playback VCR.  Optional a standalone Video\r
346 corrector/processor if available can be used, where also optional brightness, contrast and color saturation/correction\r
347 can be adjusted.\r
348 \end{itemize}\r
349 \r
350 \section{Example articles and references}%\r
351 \label{sec:example}\r
352 \r
353 \begin{itemize}\r
354 \item Digitizing Analog Video through a Digital Camcorder (Michael Steil, 2022) \\\r
355 {\small \url{https://www.pagetable.com/?p=1697}} \\\r
356 \item How to Get the Best Images Digitizing SD Video (TBC/ProRes, Larry Jordan, 2021) \\\r
357 {\small \url{https://larryjordan.com/articles/how-to-get-the-best-images-digitizing-sd-video/}} \\\r
358 \item Digitize analog cassettes (VHS or 8\ mm) with Linux (USB/H.264, Corinne HENIN, 2021) \\\r
359 {\small \url{https://www.arsouyes.org/en/blog/2021/2021-05-17\_Numerisation\_VHS}} \\\r
360 \item The Digitization of VHS Videotapes -- Technical Bulletin 31 -- Canada.ca (Joe Iraci, 2020) \\\r
361 {\small \url{https://www.canada.ca/en/conservation-institute/services/conservation-preservation-publications/technical-bulletins/digitization-vhs-video-tapes.html}} \\\r
362 \item Hi8 to DVD Workflow in Linux (Eric Olson, Renomath (2012) \\\r
363 {\small \url{https://renomath.org/video/linux/hi8/}} \\\r
364 \item Transfer VHS/DVD Media or Video8/Hi8 Tapes into CINELERRA-GG (chpt. 13.4 manual) \\\r
365 {\small \url{https://cinelerra-gg.org/download/CinelerraGG\_Manual/Transfer\_VHS\_DVD\_Media\_or\_V.html}}\r
366 \end{itemize}\r
367 \r
368 \chapter{\textbf{DV files converted to Blu-ray compliant MPEG-2/LPCM and authored to SD BD-Video}}%\r
369 \label{cha:dv_files}\r
370 \r
371 \textbf{Step 1}\r
372 \r
373 \begin{itemize}\r
374 \item Prepare a 40 GB continuously DV input file by joining and concatenating the actual dv clips in order. Each\r
375 digitized Hi8 video tape was automatically split and recorded as a numbered series of 2.0 GB dv files each. \\\r
376 \item Naming convention used, for example, for Tape \#1 with clips in order: \texttt{dv01, dv01-01, dv01\_02, dv01\_03},\r
377 etc. For the full example at the end of this article, the concatenated \texttt{DV41\_02+DV42+DV43\_02} contains the clips from on\r
378  \texttt{dv41\_02+all dv42} up to and including \texttt{dv43\_02}.\r
379 \end{itemize}\r
380 \r
381 \textbf{Step 2}\r
382 \r
383 \begin{itemize}\r
384 \item Encode DV to MPEG-2 video and "re-encode" uncompressed PCM to Blu-ray PCM audio and\r
385 remux to interlaced SD-BD-video.mts: \r
386 \begin{lstlisting}[style=sh]\r
387 ffmpeg -i DV41_02+DV42+DV43_02.dv -c:v mpeg2video -refs 1 -bf 2 -b:v 25M -maxrate 25M -minrate 25M -bufsize 28M -muxrate 28M -dc 10 -c:a pcm_bluray -mpegts_m2ts_mode 1 -flags +ilme+ildct SD-BD_DV41_02+DV42+DV43_02.mts\r
388 \end{lstlisting}\r
389 \end{itemize}\r
390 \r
391 \textbf{Step 3}\r
392 \r
393 \begin{itemize}\r
394 \item Run \textbf{tsMuxer} (screenshot of tsMuxer usage is displayed at the end of this article). The following\r
395 parameters are shown for tsMuxer\_SD\_M2TS: \\\r
396 \newline\hspace*{.5cm} Input file: \texttt{SD-BD\_DV41\_02+DV42+DV43\_02.mts} \r
397 \newline\hspace*{.5cm} Tracs:\hspace*{.63cm}\ MPEG-2 video stream and LPCM audio stream \r
398 \newline\hspace*{.5cm} Output:\hspace*{.37cm} \texttt{SD-BD\_DV41\_02+DV42+DV43\_02.iso}\r
399 \end{itemize}\r
400 \r
401 \textbf{Step 4}\r
402 \begin{itemize}\r
403 \item Burn the iso SD-BD-Video image with \textbf{xorriso} on a BD-R DL 50 GB disc:\r
404 \begin{lstlisting}[style=sh]\r
405 xorriso -as cdrecord -v -sao dev=/dev/sr1 SD-BD_DV41_02+DV42+DV43_02.iso\r
406 \end{lstlisting}\r
407 \end{itemize}\r
408 \r
409 \chapter{\textbf{HDV.m2t files converted and authored to HD BD-Video}}%\r
410 \label{cha:hdvm2t}\r
411 \r
412 \textbf{Step 1}\r
413 \begin{itemize}\r
414 \item Prepare the source HDV.m2t file using hdv clips as for DV above.\r
415 \end{itemize}\r
416 \r
417 \textbf{Step 2}\r
418 \begin{itemize}\r
419 \item Copying the mpeg2 video, re-encoding MP2 audio to Blu-ray LPCM. If using an ffmpeg version lower than 5.1,\r
420 substitute ac3 for pcm\_bluray and add -b:a 384 to override lower default. \r
421 \r
422 \begin{lstlisting}[style=sh]\r
423 ffmpeg -i HDV.m2t -c:v copy -c:a pcm_bluray -mpegts_m2ts_mode 1 HDV.mts \r
424 \end{lstlisting}\r
425 \end{itemize}\r
426 \r
427 \textbf{Step 3}\r
428 \begin{itemize}\r
429 \item Run \textbf{tsMuxer} (screenshot of tsMuxer usage is displayed at the end of this article). \r
430 \newline\hspace*{.5cm} Input file: \texttt{HD-BD\_HDV.mts} \r
431 \newline\hspace*{.5cm} Tracs: \hspace*{.5cm} MPEG-2 video stream and LPCM audio stream \r
432 \newline\hspace*{.5cm} Output: \hspace*{.25cm} \texttt{HD-BD\_HDV.iso}\r
433 \end{itemize}\r
434 \r
435 \textbf{Step 4}\r
436 \begin{itemize}\r
437 \item Burn the iso HD-BD-Video image with \textbf{xorriso} on a BD-R DL 50 GB disc:\r
438 \begin{lstlisting}[style=sh]\r
439  xorriso -as cdrecord -v -sao dev=/dev/sr1 HD-BD_HDV.iso\r
440 \end{lstlisting}\r
441 \end{itemize}\r
442 \r
443 \chapter{\textbf{Full example output}}%\r
444 \label{cha:full}\r
445 \r
446 \section{DV files converted to Blu-ray compliant MPEG-2 video and LPCM audio, authored to SD BD-Video and burned to a BD-R\r
447 DL}%\r
448 \label{sec:DVFILES}\r
449 \r
450 17/01-2023 \\\r
451 SD-BD\_DV41\_02+DV42+DV43\_02 \\\r
452 -----------------------------------------------\r
453 \r
454 \textbf{Step 1}\r
455 \begin{lstlisting}[style=sh]\r
456 cd /run/media/terje/Seagate_8TB_back/video/DV\r
457 \r
458 cat dv41_02.dv dv41_03.dv dv41_04.dv dv41_05.dv dv41_06.dv dv41_07.dv dv41_08.dv dv41_09.dv dv42.dv dv42_01.dv dv42_02.dv dv42_03.dv dv42_04.dv  dv42_05.dv dv42_06.dv dv42_07.dv dv42_08.dv dv42_09.dv dv43.dv dv43_01.dv dv43_02.dv > /home/terje/Videoklipp/SD-BD-DV-iso/DV41_02+DV42+DV43_02.dv\r
459 \end{lstlisting}\r
460 \r
461 --------------------------------------\r
462 \begin{lstlisting}[style=sh]\r
463 cd /home/terje/Videoklipp/SD-BD-DV-iso\r
464 \r
465 du -sh DV*\r
466 40G     DV41_02+DV42+DV43_02.dv\r
467 \end{lstlisting}\r
468 ------------------------------------------------\r
469 \r
470 \textbf{Step 2}\r
471 \begin{lstlisting}[style=sh]\r
472 cd /home_lp154/terje/Videoklipp/SD-BD-DV-iso\r
473 \r
474 ffmpeg -i DV41_02+DV42+DV43_02.dv -c:v mpeg2video -refs 1 -bf 2 -b:v 25M -maxrate 25M -minrate 25M -bufsize 28M -muxrate 28M -dc 10 -c:a pcm_bluray -mpegts_m2ts_mode 1 -flags +ilme+ildct SD-BD_DV41_02+DV42+DV43_02.mts\r
475 \r
476 ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers\r
477    built with gcc 12 (SUSE Linux)\r
478 .............................\r
479 \r
480 (NOTE: the @ sign represents the pound sign in the next 21 lines)\r
481 \r
482 Input @0, dv, from 'DV41_02+DV42+DV43_02.dv':\r
483  Metadata:\r
484    timecode        : 00:19:52:24\r
485  Duration: 03:15:53.28, start: 0.000000, bitrate: 28800 kb/s\r
486  Stream @0:0: Video: dvvideo, yuv420p, 720x576 [SAR 16:15 DAR 4:3], 25000 kb/s, 25 fps, 25 tbr, 25 tbn\r
487  Stream @0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s\r
488 Stream mapping:\r
489  Stream @0:0 -> @0:0 (dvvideo (native) -> mpeg2video (native))\r
490  Stream @0:1 -> @0:1 (pcm_s16le (native) -> pcm_bluray (native))\r
491 Press [q] to stop, [?] for help\r
492 [mpeg2video @ 0x558bb9453ac0] Warning vbv_delay will be set to 0xFFFF (=VBR) as the specified vbv buffer is too large for the given bitrate!\r
493 Output @0, mpegts, to 'SD-BD_DV41_02+DV42+DV43_02.mts':\r
494  Metadata:\r
495    timecode        : 00:19:52:24\r
496    encoder         : Lavf59.27.100\r
497  Stream @0:0: Video: mpeg2video (Main), yuv420p(bottom coded first (swapped)), 720x576 [SAR 16:15 DAR 4:3], q=2-31,25000 kb/s, 25 fps, 90k tbn\r
498    Metadata:\r
499      encoder        : Lavc59.37.100 mpeg2video\r
500    Side data:\r
501      cpb: bitrate max/min/avg: 25000000/25000000/25000000 buffer size: 28000000 vbv_delay: N/A\r
502  Stream @0:1: Audio: pcm_bluray, 48000 Hz, stereo, s16, 128 kb/s\r
503    Metadata:\r
504      encoder          : Lavc59.37.100 pcm_bluray\r
505 frame=293832 fps=373 q=2.5 Lsize=41027202kB time=03:15:53.28 bitrate=28595.8kbits/s speed=14.9x  \r
506 video:35867310kB audio:2212922kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 7.738845%\r
507 \r
508 --------------------------------------\r
509 du -sh *.mts\r
510 40G      SD-BD_DV41_02+DV42+DV43_02.mts\r
511 \end{lstlisting}\r
512 --------------------------------------\r
513 \r
514 \textbf{Step 3}\r
515 \begin{itemize}\r
516 \item Run \textbf{tsMuxer} (screenshots of tsMuxer usage are displayed at the end of this article). \r
517 \newline\hspace*{.5cm} Input file: \texttt{HD-BD\_HDV.mts} \r
518 \newline\hspace*{.5cm} Tracs: \hspace*{.5cm} MPEG-2 video stream and LPCM audio stream \r
519 \newline\hspace*{.5cm} Output: \hspace*{.2cm} \texttt{HD-BD\_HDV.iso}\r
520 \end{itemize}\r
521 \r
522 -------------------------------- \r
523 \begin{lstlisting}[style=sh]\r
524 du -sh *.iso\r
525 39G     SD-BD_DV41_02+DV42+DV43_02.iso\r
526 \end{lstlisting}\r
527 --------------------------------------\r
528 \r
529 \textbf{Step 4}\r
530 \begin{lstlisting}[style=sh,escapechar=\^]\r
531 MediaRange BD-R DL\r
532 \r
533 eject /dev/sr1\r
534 eject -t /dev/sr1\r
535 \r
536 umount /dev/sr1\r
537 umount: /dev/sr1: not mounted.\r
538 --------------------------------------\r
539  \r
540 xorriso -devices\r
541 xorriso 1.5.4 : RockRidge filesystem manipulator, libburnia project.\r
542 \r
543 Beginning to scan for devices ...\r
544 Full drive scan done\r
545 --------------------------------------\r
546 0  -dev '/dev/sr0' rwrw-- :   'HL-DT-ST' 'BD-RE BH10LS30'\r
547 1  -dev '/dev/sr1' rwrw-- :   'ASUS    ' 'BW-16D1X-U'\r
548 --------------------------------------\r
549 \r
550 Device og media info for a new BD-R DL (MediaRange):\r
551 --------------------------------------\r
552 xorrecord -dev=/dev/sr1 -atip\r
553 xorriso 1.5.4 : RockRidge filesystem manipulator, libburnia project.\r
554 \r
555 Drive current: -outdev '/dev/sr1'\r
556 Media current: BD-R sequential recording\r
557 Media status : is blank\r
558 Media summary: 0 sessions, 0 data blocks, 0 data, 46.6g free\r
559 Device type  : Removable CD-ROM\r
560 Vendor_info  : 'ASUS'\r
561 Identifikation : 'BW-16D1X-U'\r
562 Revision  : 'A105'\r
563 Driver flags  : BURNFREE\r
564 Supported modes: SAO TAO\r
565 Current: BD-R sequential recording\r
566 Profile: 0x0043 (BD-RE)\r
567 Profile: 0x0042 (BD-R random recording)\r
568 Profile: 0x0041 (BD-R sequential recording) (current)\r
569 Profile: 0x0040 (BD-ROM)\r
570 Profile: 0x002B (DVD+R/DL)\r
571 Profile: 0x001B (DVD+R)\r
572 Profile: 0x001A (DVD+RW)\r
573 Profile: 0x0016 (DVD-R/DL layer jump recording)\r
574 Profile: 0x0015 (DVD-R/DL sequential recording)\r
575 Profile: 0x0014 (DVD-RW sequential recording)\r
576 Profile: 0x0013 (DVD-RW restricted overwrite)\r
577 Profile: 0x0012 (DVD-RAM)\r
578 Profile: 0x0011 (DVD-R sequential recording)\r
579 Profile: 0x0010 (DVD-ROM)\r
580 Profile: 0x000A (CD-RW)\r
581 Profile: 0x0009 (CD-R)\r
582 Profile: 0x0008 (CD-ROM)\r
583 Profile: 0x0002 (Removable disk)\r
584 Mounted Media: 41h, BD-R sequential recording\r
585 Product Id:  CMCMAG/DI6/0\r
586 Producer:  CMC Magnetics Corporation\r
587 Manufacturer:  'CMCMAG'\r
588 Media type:  'DI6'\r
589 -------------------------------------- \r
590 \end{lstlisting}\r
591 \r
592 \underline{Burning the 40 GB SD-BD-Video iso image to a BD-R DL disc:}\r
593 \r
594 \begin{lstlisting}[style=sh]\r
595 27 min\r
596 \r
597 xorriso -as cdrecord -v -sao dev=/dev/sr1 SD-BD_DV41_02+DV42+DV43_02.iso\r
598 \r
599 xorriso 1.5.4 : RockRidge filesystem manipulator, libburnia project.\r
600 Drive current: -outdev '/dev/sr1'\r
601 Media current: BD-R sequential recording\r
602 Media status : is blank\r
603 Media summary: 0 sessions, 0 data blocks, 0 data, 46.6g free\r
604 Beginning to write data track.\r
605 ...........\r
606 xorriso : UPDATE : 39219 of 39251 MB written (fifo 71%) [buf 100%]  6.1x.\r
607 xorriso : UPDATE : 39245 of 39251 MB written (fifo 80%) [buf 100%]  6.1x.\r
608 xorriso : UPDATE : 39251 of 39251 MB written (fifo  0%) [buf 100%]  1.5x.\r
609 xorriso : UPDATE : 39251 of 39251 MB written (fifo  0%) [buf 100%]  0.0x.\r
610 xorriso : UPDATE : Closing track/session. Working since 1587 seconds\r
611 xorriso : UPDATE : Closing track/session. Working since 1588 seconds\r
612 ..........\r
613 xorriso : UPDATE : Closing track/session. Working since 1627 seconds\r
614 Writing to '/dev/sr1' completed successfully.\r
615 \r
616 xorriso : NOTE : Re-assessing -outdev '/dev/sr1'\r
617 xorriso : NOTE : Disc status unsuitable for writing\r
618 Drive current: -outdev '/dev/sr1'\r
619 Media current: BD-ROM\r
620 Media status : is written , is closed\r
621 Media summary: 1 session, 20096864 data blocks, 38.3g data,  0 free\r
622 \end{lstlisting}\r
623 \r
624 \begin{figure}[htpb]\r
625 \centering\r
626 \includegraphics[width=15.132cm,height=9.823cm]{Preserving.png}\r
627 \end{figure}\r