1DVGRAB(1)                   General Commands Manual                  DVGRAB(1)
2
3
4

NAME

6       dvgrab  —  Capture  DV or MPEG-2 Transport Stream (HDV) video and audio
7       data from FireWire
8
9

SYNOPSIS

11       dvgrab [options] [base] [-]
12
13

DESCRIPTION

15       dvgrab is a program that captures DV or HDV (MPEG2-TS) video and  audio
16       data  from  digital  camcorders  via FireWire (IEEE 1394).  The data is
17       stored in one or several files and can  later  be  processed  by  video
18       editing  software.  dvgrab can remote control the camcorder but it does
19       not show the video's content on screen.
20
21       dvgrab also supports UVC (USB Video Class) compliant DV  devices  using
22       Linux  kernel  module  uvcvideo,  which is a V4L2 driver. In this mode,
23       there is no AV/C VTR control and therefore interactive mode  is  almost
24       useless.  interactive feature is
25
26       The  base  argument  is  used  to construct the filename to store video
27       data: base-num.ext.  num is a running number starting from 001, and ext
28       is  the  file name extension specifying the file format used, e.g. avi.
29       A different naming scheme is used whenever the  -timestamp,  -timecode,
30       or -timesys is given (see below).  If base is a full filename including
31       extension, then dvgrab attempts to determine  the  output  file  format
32       from  the  extension,  but it still inserts num.  The default value for
33       base is "dvgrab-".
34
35       If you specify a trailing '-' then the format is forced to  raw  DV  or
36       HDV and sent to stdout. dvgrab will also output raw DV or HDV to stdout
37       while capturing to a file if stdout is piped or redirected.
38
39       You can use dvgrab's powerful file writing capabilities with other pro‐
40       grams that produce raw DV or HDV. Using the -stdin option and if dvgrab
41       detects that it is on the receiving end of a pipe  and  it  is  not  in
42       interactive mode, then it will try to read raw DV or HDV on stdin.
43
44

OPTIONS

46       Options longer than a single character can be specified with either one
47       or two leading hyphens. Also, you can use a space  character  or  equal
48       sign to separate the option name and its argument value.
49
50
51       -a[num], -autosplit[=num]
52                 Try  to  detect whenever a new recording starts, and store it
53                 into a separate file. This can be combined with  the  -frames
54                 and  -size  options,  and a split occurs whenever a specified
55                 event arises.  Autosplit is off by default.
56
57                 num is optional. Without it, dvgrab determines when to  split
58                 using  a  flag  in the stream or a discontinuity in the time‐
59                 code, where timecode discontinuity is anything  backwards  or
60                 greater  than  one  second.  If you set the optional argument
61                 num you can set the time sensitivity in  seconds  and  ignore
62                 the  stream's  new-recording  flag.  This  basically lets you
63                 split on larger time increments such as minutes or hours. For
64                 example,  -autosplit=3600 splits the recording whenever there
65                 is a gap in the recording that is an hour or longer.
66
67
68       -buffers num
69                 The number of frames to use for buffering device I/O  delays.
70                 Defaults to 100.
71
72
73       -card num Tells  dvgrab  to  receive  data  from FireWire card num. The
74                 default behaviour is to automatically select the  first  card
75                 containing the first discovered camera If used in conjunction
76                 with -noavc, then no bus probing is performed If used in con‐
77                 junction  with  -guid  hex,  then  only  the specified bus is
78                 probed for node with guid hex.
79
80
81       -channel num
82                 Isochronous channel to receive data  from.  Defaults  to  63,
83                 which is pretty much standard among DV camcorders these days.
84                 If you specify anything different, no attempt is made at this
85                 time  to  tell the device which channel to use. You must have
86                 some manual way to tell the transmitting device which channel
87                 to use.
88
89
90       -cmincutsize num
91                 This  option  is used to start the collection if a cut occurs
92                 num megabytes (actually, mebibytes) prior to the end  of  the
93                 collection.  This  option  reduces  small files being created
94                 when using the  -csize  option.  When  a  new  collection  is
95                 started  in this manner, the amount of free space in the pre‐
96                 vious collection is stored, and while the following clips fit
97                 within  the  previous collection, the new collection starting
98                 point is reset.
99
100
101       -csize num
102                 This option tells dvgrab to split the files when the  collec‐
103                 tion  of  files  exceeds  num . This option is used to create
104                 collections of files that fit perfectly  into  num  megabytes
105                 (actually,  mebibytes)  (i.e.  for  archiving onto DVD). When
106                 this occurs, a new collection is started (See also the -cmin‐
107                 cutsize option)
108
109
110       -debug type
111                 Display   HDV   debug   info,   type   is  one  or  more  of:
112                 all,pat,pmt,pids,pid=N,pes,packet,video,sonya1
113
114
115       -d, -duration time
116                 Set the maximum capture duration across all file splits for a
117                 single  capture  session  (multiple  sessions are possible in
118                 interactive mode).  The time  value  is  expressed  in  SMIL2
119                 MediaClipping Time format.  See http://w3.org/AudioVideo/ for
120                 the specification.
121
122                 Briefly, the formats are:
123
124                 XXX[.Y]h, XXX[.Y]min, XXX[.Y][s], XXXms,
125
126                 [[HH:]MM:]SS[.ms], or smpte=[[[HH:]MM:]SS:]FF.
127
128
129       -every n  This option tells dvgrab  to  write  every  n'th  frame  only
130                 (default all frames).
131
132
133       -f, -format dv1 | dv2 | avi | raw | dif | qt | mov | jpeg | jpg | mpeg2
134       | hdv
135                 Specifies the format of the output file(s). File  format  can
136                 also  be  determined  if you include an extension on the base
137                 name. The following extensions  are  recognizable:  avi,  dv,
138                 dif, mov, jpg, jpeg, and m2t (HDV).
139
140
141                 dv1  and  dv2 both are AVI files with slightly different for‐
142                 mats.  dv2 stores a separate audio track in addition  to  the
143                 DV  video track, which is more compatible with other applica‐
144                 tions.  dv1 only stores a single, integrated DV  track  since
145                 the  DV  format natively interleaves audio with video. There‐
146                 fore, while dv1 produces smaller  output,  some  applications
147                 won't  grok it and require dv2 instead.  dvgrab is capable of
148                 creating extremely large AVI files—well over 2 or  4  GB—how‐
149                 ever,  compatibility with other tools starts to decrease over
150                 the 1 GB size.
151
152
153                 raw stores the data unmodified and have  the  .dv  extension.
154                 These  files  are read by a number of GNU/Linux tools as well
155                 as Apple Quicktime.
156
157
158                 dif is a variation of raw DV that names  files  with  a  .dif
159                 extension  so  they can be more immediately loaded into Main‐
160                 Concept MainActor5.
161
162
163                 qt is Quicktime, but requires that dvgrab  be  compiled  with
164                 libquicktime.
165
166
167                 jpg  or  jpeg is for a sequence of JPEG image files if dvgrab
168                 was compiled with libdv and jpeglib. This option can only  be
169                 used with a DV input, not HDV (MPEG2-TS).
170
171
172                 mpeg2 or hdv is for a MPEG-2 transport stream when using, for
173                 example, a HDV camcorder or digital TV settop box.
174
175
176                 Defaults to raw
177
178
179       -F, -frames num
180                 This option tells dvgrab to store at most num frames per file
181                 before splitting to a new file, where num = 0 means ulimited.
182                 The corresponding time depends on the video system used.  PAL
183                 shows 25, NTSC about 30 frames per second.
184
185
186       -guid hex If  you  have  more than one DV device, then select one using
187                 the node's GUID specified in hex (hexadecimal)  format.  This
188                 is  the  format as displayed in /proc/bus/ieee1394/devices or
189                 the new kernel 2.6 /sys filesystem. When you specify a  GUID,
190                 dvgrab  will establish (or overlay) a peer-to-peer connection
191                 with the device instead of listening to the  device's  broad‐
192                 cast.   If  you supply a hex value of 1, then dvgrab attempts
193                 to discover the device as well as setup a  peer-to-peer  con‐
194                 nection. This is especially handy with MPEG2-TS settop boxes,
195                 which typically require a connection management procedure  to
196                 start transmitting.
197
198
199       -h, -help Show summary of options.
200
201
202       -I, -input file
203                 Read from file instead of FireWire. You can use '-' for stdin
204                 instead of using -stdin.
205
206
207       -i, -interactive
208                 Make dvgrab interactive where single keypresses on stdin con‐
209                 trol  the  camera  VTR  or start and stop capture. Otherwise,
210                 dvgrab runs in session mode, where it immediately starts cap‐
211                 ture and stops as directed or interrupted (ctrl-c).
212
213
214       -jpeg-deinterlace
215                 If using -format jpeg, deinterlace the output by doubling the
216                 lines of the upper field. This is a cheap form of deinterlace
217                 that results in an effective 50% loss in resolution.
218
219
220       -jpeg-height num
221                 If  using -format jpeg, scale the output of the height to num
222                 (1 - 2048).
223
224
225       -jpeg-overwrite name
226                 Write to same image file for each frame, instead of  creating
227                 a sequence of image files.
228
229
230       -jpeg-quality num
231                 If  using  -format  jpeg,  set  the JPEG quality level from 0
232                 (worst) to 100 (best).
233
234
235       -jpeg-temp name 10
236                 Use a temporary file to create the jpeg, rename the  file  to
237                 the target file name when done. Useful when using dvgrab with
238                 -jpeg-overwrite for generating a webcam image.
239
240
241       -jpeg-width num
242                 If using -format jpeg, scale the output of the width  to  num
243                 (1 - 2048).
244
245
246                 The  JPEG  scaling  width and height must be both either less
247                 than or greater than the normal frame size. For example,  the
248                 scaled  size of 700 wide by 525 high yields a nice 4:3 aspect
249                 image with square pixels, but it is illegal for NTSC  because
250                 700  is less than the normal width of 720 while the height is
251                 greater than the normal height of 480.
252
253
254                 Since DV uses non-square pixels, it is nice  to  be  able  to
255                 scale  to an image based upon a 4:3 aspect ratio using square
256                 pixels. For NTSC, example sizes  are  800x600,  640x480,  and
257                 320x240.  For PAL, example square pixel sizes are 384x270 and
258                 768x540.
259
260
261       -jvc-p25  Remove repeat_first_field flag and set frames per  second  to
262                 25 to correct a stream recorded in JVC's HDV P25 mode.
263
264
265       -lockstep Align  capture  to  a  multiple of -frames based on timecode.
266                 This is useful for redundancy, when more than one machine  is
267                 capturing  from  the  same  FireWire  device, and you want to
268                 ensure each file contains the same  footage.  To  ensure  the
269                 files  from each machine have the same name use the -timecode
270                 option and the same base name.
271
272
273       -lockstep_maxdrops num
274                 If num frames are dropped consecutively, then close the  file
275                 and  resume  capture on the next lockstop interval. If num is
276                 -1, then permit an unlimited number of consecutively  dropped
277                 frames; this is the default.
278
279
280       -lockstep_totaldrops num
281                 If num frames are dropped in the current file, then close the
282                 file and resume capture on the next lockstep interval. If num
283                 is  -1,  then  permit  an  unlimited  number of total dropped
284                 frames; this is the default.
285
286
287       -noavc    Disable use of AV/C VTR control. This is useful  if  you  are
288                 capturing live video from a camera because in camera mode, an
289                 AV/C play command tells the camera to start  recording,  per‐
290                 haps  over  material  on  the  current tape.  This applies to
291                 either interactive more or non-interactive because non-inter‐
292                 active  stills  sends a play and stop to the VTR upon capture
293                 start and stop.
294
295
296       -nostop   Disables sending the  AV/C  VTR  stop  command  when  exiting
297                 dvgrab.
298
299
300       -opendml  If  using  -format dv2, create an OpenDML-compliant type 2 DV
301                 AVI. This is required to support dv2 files >1GB.  dv1  always
302                 supports files >1GB.
303
304
305       -r, -recordonly
306                 When  the  camcorder  is  in  record mode, this option causes
307                 dvgrab to only capture when the camcorder  is  recording  and
308                 not paused. Normally, when in record mode, dvgrab always cap‐
309                 tures to let you use the camcorder purely as a  camera  where
310                 the computer operator is in control. This option makes dvgrab
311                 act like the VCR where the camera operator controls when cap‐
312                 ture  takes  place.   This  is  very handy when used with the
313                 -autosplit option to automatically create a new file for each
314                 shot.   This  option requires AV/C and will not work with the
315                 -noavc option.
316
317
318       -rewind   Rewind the tape completely to the beginning prior to starting
319                 capture.  Naturally, this requires AV/C; however, perhaps not
320                 so obvious is that this does not apply to interactive mode.
321
322
323       -showstatus
324                 Normally, the capture status information is  displayed  after
325                 finished  writing to each file. This option makes it show the
326                 capture status during capture, updated for each frame.
327
328
329       -s, -size num
330                 This option tells dvgrab  to  store  at  most  num  megabytes
331                 (actually, mebibytes) per file, where num = 0 means unlimited
332                 file size for large files. The default size limit is 1024 MB.
333
334
335       -srt      Generate subtitle files containing  the  recording  date  and
336                 time  in  SRT format. For each video file that is created two
337                 additional files with the extension .srt0 and .srt1 are  cre‐
338                 ated.  They  contain the recording date and time as subtitles
339                 in the SRT format. The .srt0 file contains the subtitles with
340                 timing  based  on the running time from the start of the cur‐
341                 rent file.  Use this file if you transcode to a  format  like
342                 AVI.  The .srt1 file contains the subtitles with timing based
343                 on the time code as delivered by  the  camera.   The  mplayer
344                 program understands this type of subtitles.
345
346
347       -stdin    Read the DV stream from a pipe on stdin instead of FireWire.
348
349
350       -timecode Put  the  timecode  of  the first frame of each file into the
351                 file name.
352
353
354       -t, -timestamp
355                 Put information on date and time of recording into file name.
356
357
358       -timesys  Put system rather than recording  date  and  time  into  file
359                 name.   This  is  useful when using converter devices that do
360                 not change the recording date time in the DV stream.
361
362
363       -V, -v4l2 Capture from a USB Video Class (UVC) device that supports DV.
364                 This  uses  the uvcvideo kernel module via V4L2.  The default
365                 device file is /dev/video. Use the -input  option  to  set  a
366                 different device file.
367
368
369       -v, -version
370                 Show version of program.
371
372
373       -24p      For  Quicktime DV, set the frame rate as 24 fps in the Quick‐
374                 time file.  This only works as expected when  the  video  has
375                 been shot in 24p mode.
376
377
378       -24pa     For  Quicktime,  DV, in addition to setting the frame rate to
379                 24 in the Quicktime file, also reverse the  2:3:3:2  pulldown
380                 process by removing the interlaced "C" frame. This only works
381                 as expected when the video has  been  shot  in  24p  Advanced
382                 mode. See http://www.adamwilt.com/24p/
383
384

EXAMPLES

386       dvgrab foo-
387                 Captures  video  data  from  the  default FireWire source and
388                 stores it to files foo-001.avi, foo-002.avi, etc.
389
390
391       dvgrab -frames 25 foo-
392                 Assuming a PAL video source, this command  records  one  sec‐
393                 ond's worth of video data per file.
394
395
396       dvgrab -autosplit -frames 750 -timestamp foo-
397                 Records  video data from the default FireWire source, cuts it
398                 into chunks of 30  seconds  (assuming  PAL)  or  when  a  new
399                 recording  starts  and names the resulting files according to
400                 date and time info in the videostream.
401
402
403       dvgrab -autosplit -size 1998 -csize 4400 -cmincutsize 10  foo-
404                 Records video data from the default FireWire source, cuts  it
405                 into  chunks  when a new recording starts or when the current
406                 file exceeds 1998 megabytes  (actually,  mebibytes),  or  the
407                 current  collection  of files exceeds 4400 megabytes. It also
408                 reduces the size of the smallest file made due to  a  collec‐
409                 tion size cut to 10 megabytes.
410
411
412                 This  option is perfect for backing up DV to DVD's as 2 Gb is
413                 around the maximum file size that (the current) linux  imple‐
414                 mentation of the ISO9660 filesystem can handle!
415
416
417                 Warning:  It  is  possible  to  make ISO9660 filesystems with
418                 files greater than 2 Gb, but the current linux IS09660 driver
419                 can't  read  them!  Newer linux kernels may be able to handle
420                 ISO9660 filesystems with filesizes greater than 2 Gb.
421
422
423       dvgrab -format hdv -autosplit
424                 Capture from a HDV camcorder.
425
426
427       dvgrab -format mpeg2 -guid 1
428                 Record from a digital TV settop box.
429
430
431       dvgrab -jpeg-over -jpeg-w=320 -jpeg-h=240 -d smpte=1 webcam.jpeg
432                 Capture a single frame, save it as a  JPEG  named  webcam.jpg
433                 and  exit.   This  example also demonstrates option handling.
434                 You only need to specify enough of  a  long  option  name  to
435                 uniquely identify it. You can use space or equal sign to sep‐
436                 arate option name and argument. The file format  is  inferred
437                 from  the  filename extension. Also, since -jpeg-overwrite is
438                 used, the filename will  be  exactly  "webcam.jpeg"  and  not
439                 include any numbers.
440
441
442       dvgrab -V Capture over USB from a UVC compliant DV device.
443
444
445       dvgrab -v4l -input /dev/video1
446                 Capture  over USB from a UVC compliant DV device using device
447                 file /dev/video1.
448
449
450       dvgrab -format=hdv -autosplit=28800 -srt foo-
451                 Capture from a HDV camcorder, splitting whenever there  is  a
452                 gap  in  the  recording  that lasts longer than 8 hours. This
453                 will likely generate a separate file for each day (useful for
454                 holiday videos). It will also generate subtitle files. Assum‐
455                 ing that the files foo-001.m2t and foo-002.m2t are generated,
456                 the   corresponding  subtitle  files  will  be  foo-001.srt0,
457                 foo-001.srt1 and foo-002.srt0, foo-002.srt1.  You can use the
458                 subtitle  files  to  show  the  recording date and time while
459                 viewing the video.
460
461

AUTHOR

463       Dan Dennedy <dan@dennedy.org> and Daniel Kobras kobras@debian.org>
464
465       See http://www.kinodv.org/ for more information and support.
466
467
468
469
470                                                                     DVGRAB(1)
Impressum