Home | My Linux Experience | Mandriva Install Guide | Linux HowTo's and Tips | Linux Links | Linux Software Installation and Problem Fixes

Rocksniffer: Dubious term of endearment for the wellsite geologist.

How I Made a Great DVD of My Home Movies Using Linux

This Page is Subject to Updates

The Short Version (See detail below)

 

Editing the Video

 

Use kino to offload your video, trim it of bad footage and create a DVD mpeg.

Use lve if you already have an mpeg or VOB. Create your edited mpeg with the command: lvedump -m -i your_lve.prj -av your_movie.mpg.

 

Adding a Sound Track

 

Use an edited tovid script to split the mpeg into a .m2v and .wav with: tovid_edit inputvideo.any output (no extension) (options needed for pal enter "tovid" for help).

Open .wav in audacity and add music score. Export to new .wav.

Create .ac3 from .wav using: ffmpeg -i audoutput.wav -ab 224 -ar 48000 audoutput.ac3.

Put it back together using: mplex -f 8 -o outputvideo.mpg audoutput.ac3 output.m2v.

 

Building Your DVD Structure.

 

Open qdvdauthor and build your main menu, add mpeg videos and music background. Music added to your movie must be in mp2 format and 48 khz. Convert mp3 to mp2 using: lame --decode myfile.mp3 - | mp2enc -r 48000 -o outfile.mp2. You can also convert .wav to .mp2 using toolame. See  toolame's website. Create your DVD structure and decide whether you want to edit the .xml for possible improved compatibility. If edited then create DVD structure using: dvdauthor -x yourmovie.xml.

 

Burning

 

Burn the DVD using k3b.

 

Here is the Detailed Version.

 

Editing the Video

 

 Off-load the video from your camera using kino. Note: Change the default capture path and capture file name to a special place. Edit the DV files trimming them of bad video. Don't make one giant video. Break them up into themes such as outdoor and indoor, action and lounging. Export to a separate directory as a DVD mpeg. Keep the DV capture files until you are finished with your work. If you do a lot of pre-planning and editing work at this stage you make the rest of the job much easier.

If you are given an mpeg, avi or a VOB (DVD) file you will have to edit them using lve. lve is like Ulead, Microsoft Movie Maker or Show Biz in the Windows world, but unlike those it will edit a VOB file. Once you have the video like you want it using lve save the project and video list in the directory with the video. Actually, you should save frequently. Close lve before you attempt to test your results as xine totem and mplayer will screw up if you don't; something about the files being in use. In a console window cd to the video directory and run the command: lvedump -m -i your_lve.prj -av your_movie.mpg. This will create a DVD mpg from your edited video.

After all this you should have either one big mpg file or a few smaller ones. With these you will create your DVD. Put each of them into another special directory or folder. In a term window cd to one of the directories and follow the below instructions to add a sound track to the video.

 

Adding a Sound Track

 

TIP: Before you run any command below do an "ls" or "ls -l" so you can have all the files in your directory at hand for cut and paste. Also, check to make sure you have read-write privileges on you videos. I use a personally edited version of the tovid script by Eric Pierce to split my video into a .mv2 and .wav files. It just makes the task easier and offers some great options in the process. http://tovid.sourceforge.net/.

I simply edited the file to preserve the .mv2 and .wav files that the tovid script creates to do its stuff. Tovid creates and uses the files as temp files and deletes them in its cleanup.

 To edit, as root, open /usr/local/bin/tovid (or wherever your tovid is installed) in a text editor and find the text below (exclusive of the bold) around line 996. Add the bold text as shown.

  if $PARALLEL == "n" ]]; then

    cp stream.wav output.wav

    rm -f stream.wav

  fi

Next, find again as around line 1146.

echo "$SEPARATOR"

rm -f "$OUT_PREFIX.$VID_SUF"

rm -f "$OUT_PREFIX.$AUD_SUF"

rm -f stream.yuv

Edit as shown

echo "$SEPARATOR"

mv "$OUT_PREFIX.$VID_SUF" output.m2v

#rm -f "$OUT_PREFIX.$AUD_SUF"

rm -f stream.yuv

 

Save as tovid_edit in same directory as tovid. Make sure it has the same privileges.

Execute the command below.

tovid_edit inputvideo.any output (no extension)

(options needed for pal enter "tovid" for help)

Extracted video and audio will be output.m2v and output.wav

Bring output.wav into audacity and check length in time. From the Audacity menu choose project import to open each of the music files you want to add or replace. Align end to end to match the .wav file length. You can edit their length and use effects to fade out/in etc; figure it out. Once you have them set up you can play back to check. If one or more songs is over/under powering compared to the others you can highlight it and choose effects, normalize and reduce/raise its volume. If replacing the audio remove the original sound track. Export as a wav.

That done, convert the wav to AC3 audio:

ffmpeg -i audoutput.wav -ab 224 -ar 48000 audoutput.ac3

Put it all together.

mplex -f 8 -o outputvideo.mpg audoutput.ac3 output.m2v

You’re done here. Do this for each of your videos. Next we will go into qdvdauthor and build DVD files for burning.

 

Building Your DVD Structure.

 

Open Qdvdauthor and go to tools and setup. Choose a project name and a path to a directory for the AUDIO_TS and VIDEO_TS directories to be stored. These files will be burned to the DVD. Also set a tmp path. I prefer to put that in my home directory, too, as it can get very big if you don't clean it up now and then. If you accept the default you will have to be root to do clean up. That done, save the project

What you are looking at is your main menu screen. You need to put something there, so, add a background. Now, add some music for your audience to listen to while they peruse your menu, but to do that you will have to convert your mp3 to a mp2 as at least my version of qdvdauthor has a bug handling mp3's. The latest version may not. Use the command below to do that.

lame --decode myfile.mp3 - | mp2enc -r 48000 -o outfile.mp2

-r 48000 needed because DVD sound is 48khz. mp2enc default is 44.1khz which makes sound too fast on DVD.

After that add your movies in the order you might want them viewed, though the viewer can view them in any order they want. I never have been able to get the slideshow to work, and this is consistent with my current version. But we will make a slide show outside of qdvdauthor soon, and add it to a movie at another time. By the way, if you need to delete a video or mp2 do so by right clicking on the file in the list where you added it and choose delete.

Right click on the background image and choose to add text or an image. It gets a little free style here as you have to draw a box in which the text or image will fit and you may not know just how big it needs to be. Once you have added a title for all your movies you can start assigning them to your videos. Right click on each one and choose to define as a button. If you ever have to edit buttons you may as well delete them all and start from scratch as they can become total screwed up.

After your buttons are defined you could create your DVD. While they have always worked flawlessly on my cheapo JVC player a relative reported to me that some menu items would not play on their player. I have had reports of incompatibilities of various sorts with some DVD players from others too. There are a whole host of reasons I have heard for these quirks including that the DVDs are more likely to work on newer cheaper players than older or expensive ones because of inexactness to the proprietary DVD structure (this software tries to mimic that), but I will let you research that yourself. The flaw I mentioned first, though, I eliminated by editing the xml file qdvdauthor creates. The dvdauthor forum told me the edit shouldn't make any difference and wasn't my problem but gave me instructions for what I wanted to do anyway. My relative told me it did fix the problem.

My edit creates one VOB file for each movie in my DVD. Without it dvdauthor creates VOBs just like the proprietary structure. If your 1st and 2nd movie add up more than 1024 meg or 1 gig they are combined into one VOB end to end and what's left over starts the next VOB. The buttons that didn't work on my relative's player where those that jumped to the middle of a VOB file. You will see no difference in the way the DVDs play.

To edit the xml file click on the xml out tab above the background picture in qdvdauthor. From the dropdown menu select dvdauthor.xml. Copy all the text there to a text editor. I use gedit. Look through the file and you will see your movies separated by:

   </pgc>

   <pgc>

Add between these two pgc entries:

  </titles>

 </titleset>

 <titleset>

  <menus/>

  <titles>

Such that you are left with:

   </pgc>

  </titles>

 </titleset>

 <titleset>

  <menus/>

  <titles>

   <pgc>

You can use copy/paste and include all the preceding spaces. I don't know what would happen if you didn't. You can also edit the first line that contains the path where the DVD structure will be saved. Once you have edited between each video entry as above (do not edit above the first or after the last video entry) save as yourmovie.xml.

Whether you edit as above or not go ahead and push the create DVD button. A new window opens showing you the commands that will be executed to build your DVD structure. If you made the edits detailed above uncheck the command that says dvdauthor. We will run that one separately. The other commands build other needed files in your temporary directory you detailed in setup. At the bottom of the window there is a check box next to which is written "Don't execute burn DVD". In my opinion it's misleading. It seems like you have to check it to not burn the DVD, but in fact you leave it unchecked to do that. Leave it unchecked. I use k3b to burn the DVD. Click the OK button and watch the yellow text on a black background roll by. If you see any red text go by you have a problem and need to go back and find out what went wrong.

All done? If so, and you did not edit the xml, and you left the dvdauthor box checked, you should have AUDIO_TS and VIDEO_TS directories under the DVD directory you specified in setup earlier. You also should have xine installed. If you don't, go get it now. If you do, run the command below.

xine dvd:/path/to/your/project/dir/VIDEO_TS/

Note: the last '/' is mandatory.

Your video should come up and all buttons work flawlessly unless I have a typo in here and sent you down the wrong path.

Now, if you did edit the dvdauthor.xml file and did uncheck the dvdauthor button as I described above then you will have to run the dvdauthor command on your edited .xml file. In a console window in the directory where the edited .xml file is located run:

dvdauthor -x yourmovie.xml This should leave you with the DVD structure in your DVD directory. Test it use xine.

 

Burning

 

When that's done put a DVD R into your writer and wait for k3b to open. I burn to an RW first to see how it looks on TV. At the main window choose file, new project, new video DVD project. Navigate to where your DVD files are and open the VIDEO_TS directory and put those files in the corresponding directory in the project window by highlighting them all and dragging them to it. The AUDIO_TS directory is always empty. Don't worry about it. Hit burn and in a few minutes you have a DVD. Another way is to build an ISO using: mkisofs -dvd-video -udf -o /distination/path/file.iso /path/to/folder/contaning/VIDEO_TS/ Then buring the ISO in k3b under Tools-DVD-Burn DVD ISO Image.

You can also burn the DVD commandline using growisofs with the command: growisofs -Z /dev/dvd1 -dvd-video /my/path/DVD// Provided your writer is linked to /dev/dvd1. All your drives whether harddrives, floppies, or CD/DVD drives are designated as hda, hdb, hdc ...... I have two DVD drives. My writer happens to be hdd which is linked to /dev/dvd1, so, thats what I use in the above growisofs command. Type ls -l /dev/*dvd* to see your listing. If you have 2 drives the first is probably your master and the second, slave.

 

Hope it all works!

 

Enter supporting content here