Archive for December, 2007

Video Editing in Ubuntu

Thursday, December 6th, 2007

This post is a record of the tools I have used in Ubuntu Linux (7.04, Feisty Fawn) to capture and edit digital video, as well as transcode, author and burn it onto DVD.

Software

The main pieces of software I used were:

  • DVGrab – Utility for grabbing digital video from a DV camcorder
  • Kino – Video calture and editing tool
  • Kdenlive – Non-linear video editing tool
  • Cinelerra – Another video editing tool. Installation instructions are available here: https://help.ubuntu.com/community/CinelerraOnFeistyAMD64
  • VLC Media Player – Very powerful video player, decoder, encoder, streamer, etc.
  • Tovid – Very handy tool for transcoding any video format into DVD format. Instructions on how to install this are available here: http://tovid.wikia.com/wiki/Installing_tovid/Ubuntu
  • mplayer – Video player and transcoding tool (used by Tovid)
  • faad – Audio decoder, useful for working with Divx/XVid files
  • DVDStyler – DVD Menu creator and burning tool. I had to compile from source and I also had to get the wxsvg library – this tutorial helped: http://ubuntuforums.org/showthread.php?t=482761
  • QDVDAuthor – A slightly more advanced DVD menu editor, but a bit more difficult to get to grips with than DVDStyler

Transcode an mp4 (xvid) video into DVD format

Using tovid (adding subtitles when found):

Widescreen:

tovid -overwrite -pal -dvd -wide -quality 8 -autosubs -in "Video.mp4" -out "Video.mp4.tovid_encoded"

Normal:

tovid -overwrite -pal -dvd -quality 8 -autosubs -in "Video.mp4" -out "Video.mp4.tovid_encoded"

If the audio extraction fails, extract it separately and re-multiplex as follows:

faad -o outputfile.wav Video.mp4
nice -n 0 ffmpeg -i outputfile.wav -vn -ab 224k -ar 48000 -ac 2 -acodec ac3 -y ./Video.mp4.tovid_encoded/audio.ac3
mplex -V -f 8 -o
    ./Video.mp4.tovid_encoded.mpg
    ./Video.mp4.tovid_encoded/video.m2v
    ./Video.mp4.tovid_encoded/audio.ac3

Transcode a Matroska (mtk) file into DVD format

Do the initial extraction using tovid as per the steps shown above. When I did this the audio extraction failed, so I did it like this (I’m sure there is a easier way however):
Note – for the first step you will need to install the mkvtoolnix package from synaptic.

mkvextract tracks Video.mkv 2:audio.aac
faad -o outputfile.wav audio.aac
nice -n 0 ffmpeg -i output.wav -vn -ab 224k -ar 48000 -ac 2 -acodec ac3 -y audio.ac3
mplex -V -f 8 -o Video.mpg video.m2v audio.ac3