Analogue to DVD
without a studio suite

Anne Wilson

WYLUG – 10 October 2005

From Analogue Camcorder
to DVD Disk

Why bother?

Shoebox full of Hi8 tapes

Camcorder obsolete technology

No other way of viewing content.

What do I need?

Capture Hardware

Cards based on the Zoran ZR36067 mjpeg codec chip

Buz, Miro/Pinnacle DC10, DC10+, LML33, Matrox Marvel

Kernel modules to talk to it

zr 36060	zr36067	adv7175	saa7110

zoran	12c-algo-bit	12c-core	videocodec

videodev

Video4linux (v4l) installed and running.

A TV application – optional, but very helpful

xawtv

Cables

svideo or composite from camcorder to capture card

audio from camcorder to soundcard line-in

A toolkit to handle the conversion

mjpegtools

An application to create proper DVD structure

dvdauthor

Oodles of hard disk space

At least 15GB for a single DVD

Record to Hard Drive

Start xawtv

Test that it can see camcorder output

Position tape

Command:

lavrec -f a -i P -d 2 -q 80 -s -l 60 -R l -U example.avi

i.e. format=avi, input=PAL, decimation=2, quality=80%, stereo sound, loudness=60, record from line-in, use read() system call for recording

File size limit=1.7GB. Recording automatically split into serially numbered files – example_01.avi, example_02.avi etc.

Edit

Play back in xine, totem, mplayer, but edit in glav:

glav -p S example.avi (uses software encoding)

Non-destructive editing, output saved in text file, .eli.

The file 'example.eli' would look like this:

LAV Edit List

PAL

1

/Data/Example/example1_02.avi

0 0 4882

0 4889 5057

0 5063 10390

0 10397 11024

0 11031 11778

0 11793 12291

0 12300 12422

From this edit list we can start to build the movie.

Build an mpeg2 file

The edit list is piped through a scaler and de-noiser, before creating an m2v file.

lav2yuv example.eli | yuvscaler -O DVD | yuvdenoise | mpeg2enc -f 8 -I 1 -q 7 -o example.m2v

-f 8 specified DVD output with dummy fields ready for dvdauthor to fill in. -I 1 sets interlace-adapted motion compensation. -q 7 is suitable quantization for DVD

The resulting file can be played by xine etc., but....

It is silent! We now have to create a soundtrack

We first have to create a new avi from the eli.

lav2yuv example.eli | yuvscaler -O DVD | yuv2lav -o newexample.avi

Rip the sound from that:

lav2wav newexample.avi | mp2enc -v 2 -o example.mp2

Stitch the mp2 and m2v together

mplex -f 8 example.mp2 example.m2v -o example.mpg

Burned to disk, this will play on a DVD application and some players, but there is no title screen and only hard scene changes.

Create a title screen

Use glav to identify a suitable frame, then

lavtrans -o example.jpg -f -i 7388 newexample.avi

Open in Gimp2 and overlay a title

Create 125 frames for a 5-second display

jpeg2yuv -f 25:1 -L 1 -I t -l 125 -j example.jpg | yuv2lav -o title.avi

Blend into main production

Last 25 frames of title, first 25 frames of main, and switch opacity

ypipe -v 2 “lav2yuv -v 2 -o -25 title.avi” “lav2yuv -v 2 -f 25 example.avi” | transist.flt -o 0 -O 255 -d 25 | yuv2lav -v 0 -f a -q 80 -o trans1.avi

Example script, showing how all the elements can be combined into one scene:

lav2yuv laninfa.avi 29_laNinfa1.eli 30_laNinfa2.eli trans18.avi | yuvscaler -O DVD | yuvdenoise | mpeg2enc -f 8 -I 1 -q 7 -o /Data/Rome/laninfa.m2v

lav2wav -R laninfa.avi > /Data/Rome/laninfa1.wav

lav2wav -R 29_laNinfa1.eli 30_laNinfa2.eli > /Data/Rome/laninfa2.wav

lav2wav -R trans18.avi > /Data/Rome/laninfa3.wav

cat laninfa1.wav laninfa2.wav laninfa3.wav | mp2enc -v 2 -V -o /Data/Rome/laninfa.mp2

mplex -f 8 laninfa.mp2 laninfa.m2v -o /Public/Rome/laninfa.mpg

Burn the disk

as simple as

cd /path/to/images

dvdauthor -x my-dvd.xml

where my-dvd.xml looks like this:

<dvdauthor dest="my-dvd/"> <!-- EDIT ME -->

<vmgm />

<titleset> <titles>

<pgc>

<vob file="title.mpg" /> <!-- EDIT ME -->

<vob file=”trans1.mpg” />

<vob file="main.mpg" /> <!-- EDIT ME -->

<vob file=”fade.mpg” />

</pgc>

</titles> </titleset>

</dvdauthor>

Check layout is correct by playing directory contents

xine dvd: /$PWD/my-dvd/

Make a raw disk image using mkisofs/hdd

mkisofs -dvd-video -o my-dvd.raw ./my-dvd

Burn image to disk.

Finally

Use the same methods to create a slide-show from still photos. Add a soundtrack. Convert your music clip to an mp2

lav2wav musicclip.avi | mp2enc -v 2 -V -o musicclip.mp2

Create your m2v file from the avi, and mplex as before. Simple!

Sources:

mjpegtools

Home page: http://mjpeg.sourceforge.net/

Mailing list: mjpeg-users@lists.sourceforge.net

Project page & downloads: http://sourceforge.net/projects/mjpeg/

mjpegtools how-to: Linked from Home Page

Manpages

dvdauthor

Home page: http://dvdauthor.sourceforge.net/

Mailing list: dvdauthor-users@lists.sourceforge.net

Man pages

Some of the mjpegtools e.g. yuvscaler & yuvdenoise, can be used with digital camcorder output or with analogue to DV converter cards, such as Canopus ADVC100

Link to zoran driver on mjpeg.sourceforge.net

Matrox driver from http;//marvel.sourceforge.net

Captured avi files are huge.

Intermediate stage files are less big, but many of them

May have to delete some intermediates before project complete if space inadequate.

If no TV application, monitoring has to be by camcorder/soundtrack

A selection can be saved as a scene

A number of edits can be made to cut out wobble and unwanted scenes, the use Save All to produce an edit list that will play back as a finished file

Identify a frame to use as title page or album cover

-f 8 – DVD

-f 4 = SVCD

-f 1 Standard VCD

-q 1-31

New avi – can't use cut one

Home videos often end abruptly

Fade to black or white

Create jpg 576x768 and create blend.

jpeg2yuv -

-f framerate

-L 1 – interlaced progressive

-I t = tp field first

-l 125 – loop 125 times

lav2yuv -

-o = frames to blend - -25=25 from end, +25=first 25

transis.flt – transitional file for pipe

Opacity – 0 changing to 255

yuv2lav -

-v 0 – print only error messages

-f a – filetype avi

Creates the layout of the dvd file structure in the directory ./my-dvd/

Directory must be empty

Trailing slash is important

mjpegtools

Developers and maintainers giving specific help on and off the lists: Ronald Bultje, Bernhard Praschinger, Steven Schultz

dvdauthor

Detailed help from Selva Nair and Bernhard Praschinger

Print-out of ALL man pages highly recommended

Versions – previous work all on v1.6. V.1.8 released September 2005

2005-09-29T20:02:39