1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306
|
<html>
<head>
<title> Linux Video Stream Processing Tool - Examples</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="keywords" content="DVD, digital video, DV, encoder, divx,
DivX;-), lame, source, posix, avifile, opendivx, codec, linux, AC3,
program stream, video, audio, transcode, decoder, stream, YV12">
</head>
<body bgcolor=#CDB5CD>
<a name=top></a>
<table cellspacing="10" cellpadding="0" border="0" width="100%">
<tr>
<td align=left valign="top" width=30% bgcolor="#a0a0a0">
<table border="0" cellpadding="10" cellspacing="3" font size=+2 bgcolor="#ffffff" width=100%>
<td align="left" bgcolor="#e9e9e9"> <FONT
FACE="Lucida,Helvetica"> <font>Digital Video</font>
</tr>
<tr>
<td>
This chapter gives an introduction to Digital Video
processing with transcode. Here is a list of features:
<ul>
<li> AVI-files with Digital Video streams can be
decoded with
<ul>
<li><i>libdv</i> (default)
<li><i>ffmpeg</i> (-x ffmpeg)
</ul>
<li> concatenating clips with directory mode and option "-i <i>direname</i>"
before processing.
<li> a couple of fast or high-quality de-interlace
<a href=filter.html#video>filters</a> available to
enhance the quality.
<li> support for encoding to DV with <i>libdv</i> as raw
stream or interleaved AVI-file.
<li> pass-through mode: raw DV -> AVI-file conversion.
</ul>
Unfortunately, while most linux player happily accept the AVI-DV files
produced by <i>transcode</i>, the nonlinear DV video
editor <a href=http://www.schirmacher.de/arne/kino/><i>kino</i></a>
refuses to work with them.
<ul>
<li> <a href="dv.html#dv"> <FONT FACE="Lucida,Helvetica">
Digital Video DV</font></a>
<ul>
<li><a href="dv.html#dv_avi"> <FONT FACE="Lucida,Helvetica">
AVI files</font></a>
<li><a href="dv.html#dv_dv"> <FONT FACE="Lucida,Helvetica">
DV streams</font></a>
</ul>
<p>
<li> <a href="#pass"> <FONT FACE="Lucida,Helvetica">
pass-through mode</font></a> <p>
<li> <a href="#interlace"> <FONT FACE="Lucida,Helvetica">
de-interlacing guide</font></a> <p>
<li> <a href="#alias"> <FONT FACE="Lucida,Helvetica">
anti-aliasing guide</font></a>
</td>
</tr>
</table>
</table>
<a name=dv></a>
<table cellspacing="10" cellpadding="0" border="0" width="100%">
<tr>
<td align=left valign="top" width=30% bgcolor="#a0a0a0">
<table border="0" cellpadding="10" cellspacing="3" font size=+2 bgcolor="#ffffff" width=100%>
<td align="left" bgcolor="#e9e9e9">
<font>Digital Video (DV)
---> MPEG-4</font>
</tr>
<tr>
<td>
Here is a 3 step guide to convert a DV tape to a compressed AVI
MPEG-4 movie clip under linux using <i>transcode</i>. For a
selection of a video codec implementation supported by
transcode consult the <a href=modules.html> modules</a> info-page.
<ul>
<li> You need Arne Schirmacher's nice tool <i>dvgrab</I>
to transfer the DV tape to disk. Make sure, you use
the "--format dv2" option and maybe "--autosplit" to split
the tape into small pieces. Use AVI files, since
libdv sound seems to be broken. Optionally, use <br><br>
<FONT color=red> tcprobe -i file.avi <br><br>
</i> to find out important parameters: For example:
<p><code>
[tcprobe] RIFF data, AVI video
[avilib] V: 25.000 fps, codec=dvsd, frames=633, width=720, height=576 <br>
[avilib] A: 48000 Hz, format=0x01, bits=16, channels=2, bitrate=1536
kbps, <br>
[avilib] 633 chunks, 4861528 bytes <br>
[tcprobe] summary for test-2002.10.04_14-47-25.avi, (*) = not default, 0 = not detected<br>
import frame size: -g 720x576 [720x576] <br>
frame rate: -f 25.000 [25.000] frc=3 <br>
audio track: -a 0 [0] -e 48000,16,2 [48000,16,2] -n 0x1 [0x2000] (*)
bitrate=1536 kbps <br>
length: 633 frames, frame_time=40 msec <br>
</code><p>
Fortunately, the auto-probing feature
of <i>transcode</i> takes care of these details.
<br><br>
<li> To encode the clips, we have a number of options:
<ul>
<li> writing a shell script, that feeds transcode with each
file,
<li> using <i>avimerge</i> to create a single
input file,
<li> using the directory mode with option "-i". This
works only in connection with the import module <i>import_dv.so</i>.
</ul>
<a name=dv_avi><h3>AVI-file</h3></a>
Here,
we use a single AVI-file <i>file.avi</i> with "dvsd" codec
as an example: <p>
<table>
<tr>
<td align=left valign="top" bgcolor="#ccffcc">
transcode</td>
<td align=left valign="top" bgcolor="#ccffcc">
-i file.avi -x dv,avi</td>
</tr>
<tr><td></td>
<td align=left valign="top" bgcolor="#ccffcc">
-I 1 -C 1 -z -k </td>
</tr>
<td></td><td align=left valign="top" bgcolor="#ccffcc">
-o file-divxmp3.avi -y divx4</td></tr>
</table>
<br>
We use <i>import_avi.so</i> to extract the audio,
which works flawless. Note that the audio is found in two
places in the AVI-file. Firstly, interleaved in the DV video
frame and secondly, the PCM audio track itself.
This makes it possible to use the import module "dv" for audio
extraction as long <i>libdv</i> is broken.<br>
Note: some non-dvgrab produced AVI-files may have the audio
ripped from the DV frames. In this case, you must use "-x
dv,avi" or "-x dv,X", were X is one of (raw,mp3,ac3).
<br>
You can also reduce
the picture to a quarter size "-r 2" to get rid of
the interlace artifacts and don't need the de-interlace
option "-I 1". This option is the fastes de-interlacing
available, but is a simple interpolation.
You might also want to try
out the anti-aliasing feature with "-C 1" to process the
whole frame but this is slow.
The option "-z -k" flips the frame and make the
necessary color space changes for the encoder.
<a name=dv_dv><h3>DV stream</h3></a>
Put all AVI-files or raw DV stream into a subdirectory,
e.g., named "tape/". <p>
<table>
<tr>
<td align=left valign="top" bgcolor="#ccffcc">
transcode</td>
<td align=left valign="top" bgcolor="#ccffcc">
-i tape/ </td>
</tr>
<tr><td></td>
<td align=left valign="top" bgcolor="#ccffcc">
-I 3 -C 2 -z -k </td>
</tr>
<td></td><td align=left valign="top" bgcolor="#ccffcc">
-o tape-divxmp3.avi -y divx4</td></tr>
</table>
<br>
The necessary import module is autodetected. <i>tccat</i> extracts
the video stream of all AVI-files and concatenates them together to
make the clips appear as a single DV stream for <i>transcode</i>.
Here, the de-interlace option "-I 3",
which drops one half-frame and interpolates by zooming to full
frame size and, in principle, removes the interlace artifacts. We also try
the anti-aliasing feature with "-C 2" to process the
full frame afterwards, but this is slow.
<p>
<li> Well, that's it. Use <i>avimerge</i> to glue the
matching clips together and burn the resulting file
to CD.
</ul>
</TV>
</table>
</table>
<a name=pass></a>
<table cellspacing="10" cellpadding="0" border="0" width="100%">
<tr>
<td align=left valign="top" width=30% bgcolor="#a0a0a0">
<table border="0" cellpadding="10" cellspacing="3" font size=+2 bgcolor="#ffffff" width=100%>
<td align="left" bgcolor="#e9e9e9">
<font>pass-through mode</font>
</tr>
<tr>
<td>
The pass-through mode is able to wrap raw Digital Video
streams into AVI-files with the following command. Note, that
the interleaved raw audio data can be transcoded to a separate
audio track with the codec of your choice. However, this
does not save space since Digital Video has identical frame
size independent of the presence of audio.
<p>
<code>
transcode -i raw.dv -P 1 -o raw.avi -y raw
</code>
<p>
The opposite way is achieved by:
<p>
<code>
tcextract -i raw.avi -x raw > raw.dv
</code>
<p>
</table>
</table>
<a name=interlace></a>
<table cellspacing="10" cellpadding="0" border="0" width="100%">
<tr>
<td align=left valign="top" width=30% bgcolor="#a0a0a0">
<table border="0" cellpadding="10" cellspacing="3" font size=+2 bgcolor="#ffffff" width=100%>
<td align="left" bgcolor="#e9e9e9">
<font>de-interlacing guide</font>
</tr>
<tr>
<td>
Underway.
Tilmann Bitterberg did some testing of de-interlace filters available in
transcode. You can view and read the result
<a href=http://tibit.org/video/> here</a>.
</table>
</table>
<a name=alias></a>
<table cellspacing="10" cellpadding="0" border="0" width="100%">
<tr>
<td align=left valign="top" width=30% bgcolor="#a0a0a0">
<table border="0" cellpadding="10" cellspacing="3" font size=+2 bgcolor="#ffffff" width=100%>
<td align="left" bgcolor="#e9e9e9">
<font>anti-aliasing guide</font>
</tr>
<tr>
<td>
Underway.
</table>
</table>
<!-- hhmts start -->
Last modified: Fri Dec 6 16:25:56 Europe/Berlin 2002
<!-- hhmts end -->
</body> </html>
|