February 3, 2004

Digital Video and Linux:

Sampling, Editing,

and DVD Mastering

by R. Douglas Barbieri

Intended Audience

You should have:

A basic understanding of Linux shell scripting.

The ability to install software, and compile from source.

Understanding of X-Windows based applications.

A basic understand of the Linux kernel.

Topics Covered

Sampling video from firewire (IEEE1394)

Basic non-linear video editing

Video format conversion

DVD menu creation

DVD mastering

Links

Sampling Video under Linux

Linux kernel support of IEEE1394

Using dvgrab and dvcont

Sampling with kino

Kernel Support

2.4.18 or greater

Modules to build:

firewire

OHCI-1394 + video

Raw IEEE-1394 I/O support

Modules to modprobe:

raw1394

video1394

dv1394

sbp2

Using dvgrab and dvcont

dvgrab automatically starts tape via IEEE1394 interface.

Can autosplit files based on scene cuts.

DV format raw, dv1 or dv2 (dv2 recommended).

Control-C to stop.

doug@jedi:~/temp$ dvgrab --format dv2 –autosplit

Capture Started

"dvgrab-001.avi": 56.30 MB 475 frames timecode 00:00:46.08 date 2003.11.29 16:41:17

"dvgrab-002.avi": 97.31 MB 821 frames timecode 00:01:13.21 date 2003.11.29 16:41:44

Capture Stopped

Sampling video using kino

Kino can be a “viewer” for what dvgrab is sampling.

Run kino and switch to the “Capture” tab.

The A/V controls on my system are flaky, so I rely on dvcont.

However, kino can be used in lieu of dvgrab.

Editing Video

kino

cinelerra

Editing with kino

Easy to use and lightwieght.

“vi”-style keybindings!

DV in, uses mjpegtools to render output video.

Can render to Divx :-), Mpeg2 or even back to DV.

Editing with cinelerra

Powerful editor.

Allows audio and video effects and transitions.

However, a non-intuitive interface.

Sometimes won't read dv2 files which kino can.

I couldn't get it to export into DVD format.

Video format conversion

mjpegtools

ffmpeg

Video Conversion with mjpegtools

Kino integrates well with these tools.

Excellent for scripting.

Converts DV output (YUV) to MPEG (1 or 2).

Example script:

lav2wav +p input.avi

| mp2enc -V -o audio.mp2

lav2yuv +p input.avi

| mpeg2enc -n n -f 8 -s -r 16 -o video.m2v

mplex -f 8 audio.mp2

video.m2v -o complete.mpg

DVD Mastering

Mastering with dvdauthor and gimp

Burning the media with dvd+rw-tools

Viewing with gnome-vlc.

Mastering a DVD with dvdauthor (5.3)

Fully scriptable tools, but no UI interface to speak of.

DVD menu creation is primitive, requires gimp and lots of patience.

Can produce a rudimentary DVD—not very compatible with all DVD players

Works on mine (Toshiba SD-3109)

Didn't work on my father-in-law's dvd player (progressive scan).

Use gnome-vlc to test dvauthor output.

Sample script:

dvddirgen -o dvd -r

dvdauthor -o dvd video.vob -i post=vmgm1

dvdauthor -o dvd -T --menu --button X1xY1-X2xY2, vts1,1 menu.mpg

Burning the DVD Media with dvd+rw-tools

Tested with a DVD+RW style drive (HP dvd writer dvd200i).

For DVD-ROM drives, you need dvdrecord.

Can be used with both DVD+R and DVD+RW media.

Sample script:

dvd+rw-format -lead-out /dev/cdrom

growisofs -Z /dev/cdrom -dvd-video -udf <directory-name>

dvd+rw-booktype -dvd-rom-spec -media /dev/cdrom

Can view with gnome-vlc.

End of Talk

Thank You!

Links

kino and dvgrab: http://kino.schirmacher.de/

FFMpeg http://ffmpeg.sourceforge.net/

dvdauthor: http://dvdauthor.sf.net

dvd+rw-tools: http://fy.chalmers.se/~appro/linux/DVD+RW/

mjpegtools: http://mpjeg.sourceforge.net

qdvdauthor: http://qdvdauthor.sourceforge.net

cinelerra: http://heroinewarrior.com/cinelerra.php3

2004-01-28T19:29:30