Posts Tagged ‘Audio’

(on Technorati , Del.icio.us)

Creating a DVD Slideshow in Linux

For my brother’s wedding, about a week ago, my sister wanted to do a slideshow for them. She’s done this before and she’s known for spending lots of time making very nice, emotional slideshows with carefully chosen pictures and music. Previously, she would count in her head while manually switch the slides with a traditional projector. (We have a lot of great family photos that are only on slides.) Anyway, she figured she’d use computers this time around and my assistance was “enlisted.” I kept thinking, “If only I had a Mac, I’m sure this would be easy….” But it turns out there’s a reasonable command-line program available on Linux that is just a little cumbersome (mostly because it’s command-line tool for something that really needs to be visual) – but works quite well: dvd-slideshow. I’m going to go over what I did, mention some quirks and how to work around them.

First, install dvd-slideshow (a set of command-line tools).

sudo aptitude install dvd-slideshow

You may want to get the latest version from the webpage and manually install that.

Update: While writing this, I have since discovered “slcreator” which looks like it would fill in the glaringly absent graphical component of dvd-slideshow. Though it hasn’t been updated for quite a long time…. it’s definitely worth investigating before going through the manual process yourself.

Step 1: Organize your digitized photos within a directory

Since my sister was the creative force behind this, she needed to see the photos as she was deciding on the order. Nautilus thumbnails were good enough, so I simply showed her how to rename files and made suggestions for organizing them by name (like naming a photo “12a.jpg” if you want the photo to be in between “12.jpg” and “13.jpg”). This worked in Nautilus, but in the next step, the ordering would be changed to 12a.jpg, 12.jpg, 13.jpg – which is probably a bug in dir2slideshow. (You could work around this by always using a single letter after the number.)

Step 2: Generate input file from images directory and customize

dir2slideshow -o output_directory -t seconds_per_picture -c crossfade_seconds images_directory

This will output a text file in the output_directory that contains all the images in the images_directory with specified transition and duration times. The order of the pictures should be how it is listed by name in your file browser, minus the bug I mentioned earlier. You can manually edit this file and then pass it to dvd-slideshow.

Multiple Directories:
My sister had arranged photos in multiple directories, each consisting of a theme (childhood, Halloween, travel, etc) and a specific song to go with it. So I just generated multiple input files with appropriate names, worked on individual sections, and eventually copied them all into a master input file keeping the desired order.

Adding Music and Silence:
Another bug I encountered was getting music to fade out at the correct time. In the input file, the format for adding music is this: audiofile:track:effect1:effect1_params:effect2:effect2_params . So I had my_sad_song.mp3:1:fadein:0:fadeout:5 saying I wanted it to spend 5 seconds fading out. Additionally, I wanted about 10 seconds of silence at the very end. Your are supposedly able to specify silence:duration_in_seconds but at the end of the slideshow, it wasn’t forcing the song to fade out in time to include that amount of silence – it seemed to be ignoring it at the end if there was no more photos. I got around this by creating a small file of silence, silence.wav, and using that instead of the built-in silence option.

Nice looking fonts
Another quirk I encountered was terrible looking fonts with the built-in title:duration:thought_provoking_title. I didn’t want to spend too long looking at the cause of this, so I just created some title images in the Gimp.

Step 3: Generate the Slideshow

dvd-slideshow -mp2 -nomenu -o tmp/working -f tmp/ALL.txt

The mp2 option is required to avoid an error message and has worked on all DVD players I’ve heard of, so far. The nomenu option is for creating a DVD with no menu – I just wanted it to start playing the slideshow when the disc is inserted into the player. The o option specifies the output directory and the f option specifies the input file created earlier. Once this finishes (it might take a while) you should have a DVD .vob (MPEG2) file and an xml file in the output directory.

Debugging:
I like to see how the final product will look, so I chose not to use the L (low quality) option for debugging. Instead, I created a smaller input file with specifically what I wanted to test. When I was happy with the test, I copied the changes into my master input file.

Step 4: Create the DVD Filesystem

dvd-menu -f tmp/working/ALL.xml -nomenu -mp2 -o tmp/working-dvd

This will output a folder dvd_fs in the output folder (tmp/working-dvd) containing VIDEO_TS and AUDIO_TS directories with the required files for a proper DVD.

Adding Content:
This is where you optionally add more files to the DVD. For me, I added two folders, Music containing the music used in the slideshow and Photos containing the photos used in the slideshow. A good idea would also be to add the source file and commands used to create the DVD and then you are distributing the source. 😉

Step 5: Make an ISO to burn

mkisofs -dvd-video -udf -o ~/Desktop/slideshow.iso tmp/working-dvd/dvd_fs

This creates an ISO called slideshow.iso on the desktop.

Step 6: Burn the ISO

There’s many ways to burn an ISO, but just use Nautilus: right click on the icon on your desktop and select Write to Disc…. That’s it! Test it out in your DVD player.

References

Lots more info about specific commands and useful examples can be found at the dvd-slideshow’s documentation page.

Huge Piece of Crap

At my current job, my computer is a laptop which sits in a docking station is connected to an external monitor, keyboard, and mouse. If I wanted, I could take the laptop home with me. That would be great, but I have no desire to use this PC outside of work for a few reasons:

  1. It runs Windows.
  2. The image of Windows has been specially set up to be incredibly handicapped. An example of this I find most annoying: disabling the location bar in Explorer. WTF. It doesn’t even give a correct message… it gives a misleading and completely incorrect message! If I click the location bar in Windows Explorer and type in M: and push Enter, I get a dialog saying Access to the resource M: has being disabled. Huh? That’s total BS. I can click my way there…. I can’t even select history items, places I’ve clearly been to. This is the laziest blanket administration technique I’ve ever seen.
  3. I do not even have basic administrator privileges. To install something (anything) I would have to submit a request to the IT support department and wait for them to come over from a different building to click a couple buttons. I have doubts it could be done remotely… or with any haste.

Granted, my position has nothing to do with programming, and some users probably should be protected from themselves… but seriously, Thank you, IT department, for making my modern laptop nearly useless and actually getting in the way of me getting work done. Also, Lotus Notes is a terrible terrible experience, but Windows + Lotus Notes seems to be the standard virus infecting most large organizations.

I particularly enjoyed this bit from the latest LugRadio (they’ve changed their licence):

LR: “… having re-implemented it [the Windows API], you’ve got an idea of how the thing kind of works internally maybe, do you think Microsoft did a good job designing Windows?”
Wine Guy: “Oh no. Definitely not.”
*laughs*
Alexandre Juillard: No no, it’s a huge piece of crap and we find more crap every day.
*more laughs*
LR: Congratulations on having spent 15 years reimplementing it!
AJ: (laughing) That’s the beauty of it! We try to make something nice out of a piece of crap. That’s all the challenge.

Huge Piece of Crap - 30 sec audio clip of above conversation

(Audio clips are in OGG Vorbis format. I tried using Jokosher for audio editing – looks promising, but still young and lots of bugs.)