Sony Handycam

From YobiWiki
Jump to navigation Jump to search

Handycam DCR-DVD105E

This records directly on 8cm DVD-R, DVD-RW or DVD+RW.
So to get the movies under linux, just rip the DVD!

Tests with a finalized DVD-RW

Ripping

dvdbackup -i /dev/dvd -I
dvdbackup -i /dev/dvd -M -o . [-n title]

Re-multiplexing

# For each VTS_0${i}_1.VOB
tcextract -i VTS_0${i}_1.VOB -t vob -x mpeg2 > movie.m2v
tcextract -i VTS_0${i}_1.VOB -t vob -x ac3 -a 0 > movie.ac3
spuunmux VTS_0${i}_1.VOB
mplex -f 8 -o "movie${i}-%d.mpg" movie.m2v movie.ac3
spumux -m dvd sub.xml < movie${i}-1.mpg > movie${i}sub.mpg
rm -f sub* movie${i}-1.mpg

Now the movie${i}sub.mpg are ready for authoring

Tests with a VR-mode DVD-RW

Ripping (actually mounting)

Those special VR-mode DVD are formatted in UDF
For some info on UDF under Linux, cf http://www.lea-linux.org/cached/index/Hardware-hard_plus-packet-writing.html

apt-get install udftools
zless /usr/share/doc/udftools/README.Debian.gz

Edit /etc/default/udftools

DEVICES="/dev/scd0"

Normally at next reboot the module will be loaded and /dev/pktcdvd/0 created, otherwise:

modprobe pktcdvd

Now we can mount the DVD, "ro" as we don't plan to change it
The content appears to be /cdrom/DVD_RTAV/
Note that if you want to play with UDF, you can:
Format a CD:

cdrwtool -d /dev/cdrom -q

Mount it rw:

mount /dev/pktcdvd/0 /mnt/udf -o noatime,sync

And don't forget to umount it! Especially when writing to it!!

Re-multiplexing

cf http://www.avtechpulse.com/opensource/dvd.html
You need to install some tools

apt-get install mjpegtools
mplayer -dumpvideo /cdrom/DVD_RTAV/VR_MOVIE.VRO
mv stream.dump video
mplayer -dumpaudio /cdrom/DVD_RTAV/VR_MOVIE.VRO
mv stream.dump audio
spuunmux /cdrom/DVD_RTAV/VR_MOVIE.VRO
mplex -f 8 audio video -o movie%d.mpg
spumux -m dvd sub.xml < movie1.mpg > movie1sub.mpg
rm -f sub* movie1.mpg

Now the movie1sub.mpg is ready for authoring

Authoring

Very basic authoring

mkdir dvd
dvdauthor -o ./dvd movie*sub.mpg
dvdauthor -o ./dvd -T

This is ok only for mpg without subtitles (so not processed by spumux)

With decent menu

More complex menu can be created, cf e.g. this page
Or use dvdwizard for a quite good startup without much effort:

# apt-get install dvdwizard
$ mkdir ~/.dvdwizard
$ gunzip -c /usr/share/doc/dvdwizard/examples/dvdwizard.conf.sample.gz > ~/.dvdwizard/dvdwizard.conf
dvdwizard -T "<DVD title>" -M fr -t "Part 1" -A fr -s hh -WS nopanscan <mpg files> 
                                 -t "Part 2" -A fr -s hh -WS nopanscan <mpg files>...
-M fr: for main menu in french (you can change the messages in the conf file)
-A fr: to tag the audio track as french
-s hh: for the timestamps subtitles, I added the following to dvdwizard.conf:
HH=Timestamps
-b picture: you can force the background picture to sth else than the default sample
By default a chapter is created for every 5 mins chunk

You can also try qdvdauthor but with more power comes more stuff to learn ;-)

Testing

Before burning we can try with xine on a directory structure (with AUDIO_TS, VIDEO_TS etc):

xine dvd:$(pwd)/dvd

Or on an iso

xine dvd:$(pwd)/dvd.iso

Burning

mkisofs -dvd-video -o dvd.iso ./dvd
growisofs -dvd-compat -speed=1 -Z /dev/dvd=dvd.iso

Or simply

growisofs -Z /dev/dvd -dvd-video ./dvd

Apparently this should also be possible with

mkisofs -dvd-video -o dvd.iso ./dvd
dvdrecord speed=1 -dao dev=0,0,0 dvd.iso

but dvdrecord supports only DVD-R(W) media.

See also CD & DVD Burning

Other tools

Ripping programs

  • acidrip - ripping and encoding DVD tool using mplayer and mencoder
    • I get an error as lsdvd segfaults
  • drip - GNOME application for encoding a DivX from a DVD
    • Not updated since 04/2004
  • dvdbackup - tool to rip DVD's from the command line
dvdbackup -i /dev/dvd -I
dvdbackup -i /dev/dvd -M -o . [-n title]

  • dvdrip - perl front end for transcode
    • I get an error as lsdvd segfaults
  • k9copy - copy DVD like dvdshrink
  • lxdvdrip - tool to make a copy from a Video DVD
  • ripmake - an automatic command line ripping makefile generator for transcode

Re-multiplexing script

#!/bin/bash

n=1
if [ "$1" == "-n" ]; then
    shift
    n=$1
    shift
fi

if [ $# -lt 2 ]; then
    echo "Usage: $0 inputs output" 
    exit 1
fi

output=${!#}
# check non-existing dir
if [ ! -d "$output" ]; then
    echo "Error output dir $output does not exist"
    exit 1
fi
# Check if output exists and contains a dvd struct
if [ -d "$output/VIDEO_TS" ]||[ -d "$output/DVD_RTAV" ]; then
    echo "Warning! Are you sure you want to output in $output??"
    echo "If yes, first clean the content of $output"
    exit 1
fi

for i in $*; do
    if [ "$i" != "$output" ]; then
        if [ -d "$i/VIDEO_TS" ]; then
            # Regular DVD
            echo "Extracting $i"
            for j in "$i"/VIDEO_TS/VTS_*_1.VOB; do
            tcextract -i "$j" -t vob -x mpeg2 > "$output"/movie.m2v
            tcextract -i "$j" -t vob -x ac3 -a 0 > "$output"/movie.ac3
            spuunmux -o "$output"/sub$n- "$j"
            mplex -f 8 -o "$output"/"movie$n-%d.mpg" "$output"/movie.m2v "$output"/movie.ac3
            rm -f "$output"/movie.m2v "$output"/movie.ac3
            spumux -m dvd "$output"/sub$n-.xml < "$output"/movie${n}-1.mpg > "$output"/movie${n}sub.mpg
            rm -f "$output"/movie${n}-1.mpg "$output"/sub$n-*
            n=$((n+1))
            done
        else if [ -d "$i/DVD_RTAV" ]; then
            # VR-mode DVD
            echo "Extracting $i"
            mplayer -dumpfile "$output"/movie.m2v -dumpvideo "$i"/DVD_RTAV/VR_MOVIE.VRO
            mplayer -dumpfile "$output"/movie.ac3 -dumpaudio "$i"/DVD_RTAV/VR_MOVIE.VRO
            spuunmux -o "$output"/sub$n- "$i"/DVD_RTAV/VR_MOVIE.VRO
            mplex -f 8 -o "$output"/"movie$n-%d.mpg" "$output"/movie.m2v "$output"/movie.ac3
            rm -f "$output"/movie.m2v "$output"/movie.ac3
            spumux -m dvd "$output"/sub$n-.xml < "$output"/movie${n}-1.mpg > "$output"/movie${n}sub.mpg
            rm -f "$output"/movie${n}-1.mpg "$output"/sub$n-*
            n=$((n+1))
        else
            echo "Error, no DVD structure in $i!"
        fi
        fi
    fi
done

Edition programs

  • devede - program to create video DVDs
  • dvd+rw-tools - DVD+-RW/R tools
  • dvd-slideshow - tools to create dvd slideshow with menus
  • dvdauthor - create DVD-Video file system
    • qdvdauthor - GUI frontend for dvdauthor and other related tools
  • dvdrtools - DVD writing program
  • dvdwizard - fully automated creation of a DVD-structure
  • dvdstyler - a crossplatform DVD Authoring System
  • gaupol - subtitle editor for text-based subtitle files
  • gopchop - Fast, lossless cuts-only editor for MPEG2 video files
  • mandvd - Video DVD creator
  • submux-dvd - subtitle multiplexer, muxes subtitles into .vob
  • cinelerra - An audio/video authoring tool

Avidemux

QT interface seems buggy (e.g. the list of video filters)
So I'm using the GTK version:

apt-get install avidemux

Very easy, can open directly the ripped videos.
To create the 640x480 videos for the Photo Frame:

  • From VOB rip 720x576 DVD interleaved 16:9
    • MPEG-4 ASP (Xvid4)
      • Two-pass Average Bitrate 800
      • Filtres:
        TDeint
        Mplayer resize -> 804x480
        Crop 82G 82D -> 640x480
    • MP3 (LAME)
      • Filtres:
        Resampling 44100
  • From VOB rip 720x576 DVD interleaved 4:3
    • MPEG-4 ASP (Xvid4)
      • Two-pass Average Bitrate 800
      • Filtres:
        TDeint
        Mplayer resize -> 640x512
        Crop 16H 16B -> 640x480
    • MP3 (LAME)
      • Filtres:
        Resampling 44100

Mplayer conversions

To play DVD-RW Video 16:9 correctly and non-interlaced: (here the 4th video)

mplayer dvd://2 -chapter 2 -vf tfields -aspect 16:9

To dump raw:

mplayer dvd://2 -dumpstream -dumpfile video.raw

To convert to MS Mpeg4v2 800 / mp3 128 (2 passes)

mencoder video.raw -o /dev/null -vf scale=720:405  -oac copy -ovc lavc -lavcopts vcodec=msmpeg4v2:vpass=1
mencoder video.raw -o video.avi -vf scale=720:405  -oac lavc -ovc lavc -lavcopts acodec=mp3:abitrate=128:vcodec=msmpeg4v2:vpass=2:vbitrate=800

For a 4:3 video, rescale with

scale=720:540

Other tests:

-ovc lavc -lavcopts vcodec=mpeg4:mbd=1:vbitrate=1800
-ovc lavc -lavcopts vcodec=mpeg4:vbitrate="1200":vhq:vpass=1
-ovc lavc -lavcopts vcodec=mpeg4:vbitrate="1200":vhq:vpass=2
-ovc xvid -xvidencopts pass=1
-ovc xvid -xvidencopts pass=2:bitrate=1200

Other codecs of lavc to try:

mpeg4       MPEG-4 (DivX 4/5)
msmpeg4     DivX 3
msmpeg4v2   MS MPEG-4v2
   Windows: ok 
   DVD-player: no
wmv2        Windows Media Video, version 2 (alias WMV8)

CD creation

Burning the avis on a CD:

genisoimage -R -J <dir> | wodim -v -eject -

I tried the codec "MS Mpeg4v2" on my DVD player but it does not recognize that codec