Musings of a dad with too much time on his hands and not enough to do. Wait. Reverse that.

Tag: parenting (Page 1 of 14)

Python help with slideshows

As in years past, I continue to work on my annual family video as a year-end project. As is my tradition, I always end my videos with a sort-of “outro” segment where I play a slideshow of family photos from the past year over some upbeat song.

The software I use, Cyberlink PowerDirector, has a nifty Slideshow Creator tool that makes it easy for you to drop your photos and music into one of several slick, pre-created templates for a cool slideshow. While this tool produces a neat product in a short amount of time, I’ve encountered a few problems with it:

  • Slide order is not guaranteed. I often want particular photos to start the slideshow and particular ones to end it but no matter how I name my images alphabetically, the Slideshow Creator never seems to order my slides how I want them.
  • I always have a challenge matching the number of images I want in my project to the length of the background music I want playing in the montage. Often, I have too many images for the length of song I’ve chosen and Slideshow Creator will repeat my song until it’s cycled through all my photos. I usually play a game of building my project with a certain amount of images and then trying to guess how many I need to delete to avoid Slideshow Creator repeating my song.

This year, I finally explored a second option: Theme Designer. It seems like Slideshow Creator is a layer of abstraction over Theme Designer, but PowerDirector allows you to bypass the Creator tool and work directly with the Designer. There’s less automation, but more control; however, my problems still remain: can I order my slides as I see fit and just how many photos can I use to cover the length of my chosen music?

The tutorial video is helpful and shows you that you have full control over the order of your images, but I still have the question about how many images I can include to fill the length of my chosen music. Here’s how I solved that problem.

Step 1: Measure the length of each template you want to use

PowerDirector Theme Designer

In this example, I’ll focus on the Picture Frames theme. This theme has five templates:

  1. An Opening template that holds two images
  2. A Middle 1 template that holds three images
  3. A Middle 2 template that holds four images
  4. A Middle 3 template that holds five images
  5. and a Closing template that holds four images

What is the runtime for these templates? You can check the runtime in the preview on the right by dragging the timer all the way to the end of the segment–for the Opening template, the preview says it runs for seven seconds–but I’ve not found this preview to be completely honest.

I’ve found I’ve had to add each template to a new project, add images to all the templates, then drag the timer to the end of each template before I was confident in the true length of each sequence. In the case of the Picture Frames theme, I’ve found the runtimes of each template to be (rounding down to the nearest second):

  • The Opening template runs for seven seconds
  • The Middle 1 template runs for six seconds
  • The Middle 2 template runs for ten seconds
  • The Middle 3 template runs for 16 seconds
  • and the Closing template runs for eight seconds

Step 2: Figure out your song length

You can easily figure out the length of the song for your slideshow by right-clicking on the file, clicking the Details tab, and finding the Length property.

Tom Petty’s Free Fallin’ is runs for 255 seconds

Step 3: Let Python tell you the templates you need and the number of images to use

So, I know that my slideshow should run for 255 seconds. I know I want to use the Opening template only once at the beginning of the slideshow and the Closing template only once at the end. That’s 15 seconds out of 255: so I have 240 seconds to fill with some amount of the Middle templates. How many? Here’s some simple code I wrote to figure that out:

song_len_seconds = 255  # free fallin
opening_template = (7, 2)  # nbr of seconds long, nbr of pictures in template (Picture Frames)
middle_template1 = (6, 3)
middle_template2 = (10, 4)
middle_template3 = (16, 5)
closing_template = (8, 4)

remaining_time = song_len_seconds - opening_template[0] - closing_template[0]

print('After subtracting the runtime of the opening and closing templates, remaining secs to fill with middle templates: {0}'. \
      format(remaining_time))
print('Number of middle template combos to add to project: {0}'. \
      format(remaining_time / (middle_template1[0] + middle_template2[0] + middle_template3[0])))

middle_factor = int(remaining_time / (middle_template1[0] + middle_template2[0] + middle_template3[0]))

print('Total seconds consumed by adding {0} middle template combos: {1}'. \
      format(middle_factor, middle_factor*middle_template1[0] + middle_factor*middle_template2[0] + middle_factor*middle_template3[0]))

print('Remaining seconds to fill: {0}'. \
      format(remaining_time - (middle_factor*middle_template1[0] + middle_factor*middle_template2[0] + middle_factor*middle_template3[0])))

total_pics = opening_template[1] + closing_template[1] + \
    middle_factor*(middle_template1[1] + middle_template2[1] + middle_template3[1])

print('Number of pictures I\'ll need: {0}'.format(total_pics))

For simplicity, I just opted to use all three Middle templates in the same order: Middle 1, Middle 2, then Middle 3. By my calculations, after subtracting the Opening and Closing template runtimes, I will need to include seven Middle 1/Middle 2/Middle 3 combinations. Even after including seven of those combinations, I still have 16 additional seconds to fill–I didn’t write any code to recommend how to fill that time. I could fill it with one more Middle 3 template; of course, I’d want to make sure to place it in my project so that I don’t have two Middle 3 templates back-to-back.

My code also lets me know that an Opening, Closing, and seven Middle 1/Middle 2/Middle 3 combinations requires 90 images–which is nice for planning purposes.

Anyway, using some simple code like this will help me develop future slideshows more quickly and consistently.

Vacation item checklist

The Internet is full of great checklists of items to pack for your upcoming family vacation. In addition to these, here are a few items I would add to make your next vacation as pleasant as possible.

Fanny Pack

Is your shorts short on pockets? A good fanny pack can provide plenty of space for your wallet, car keys, and even a small camcorder. I’ve even been known to cram a small ebook reader in mine to pass the time while waiting in line.

Disposable plates, cups…and permanent marker

Many of my family’s vacations include renting lodging that includes a kitchen where we cook many of our meals. Often, the kitchens will include dining ware, but disposable plates, et al serve as a nice backup. Using a permanent marker to write our names on our plastic cups allows us to reuse them without mixing them up.

Zip lock bags

Many of our vacations revolve around beaches. Being able to seal cell phones, cameras and other items away from the sand is an important precaution.

While we’re talking about the beach…

  • Umbrella or tent: years ago, we bought a nice beach umbrella that we like to bring out on return trips. Bringing along your own shade in the form of an umbrella or tent can make your visit to the beach more enjoyable.
  • Something to anchor down that umbrella or tent: we have a couple of metal corkscrew contraptions that we can, by hand, “screw” into the sand to hold our umbrella allowing it to withstand some of the gustier winds. With tents, I’ve seen beach goers anchor them down with stakes or do-it-yourself sandbags.
  • Chairs: toting along a few folding chairs will make your day even more relaxing.
  • Kite or flag for flair: on a few visits, I saw a few vacationers tie either a kite or a flag–for example, the flag of their home State–to a tent pole. I especially thought the kite was a neat touch. I suppose such adornments can help your family find their way back to your setup, but it seemed more about just having some fun. Simply flying a kite on the beach might be a fun way to pass the time, too.
  • Long sleeved sun shirts: obviously bring along all the proper sunscreen ointments, aloes, et al, but I’ve also adopted the long sleeved sun shirts–the lightweight, quick drying, SPF-rated kind. Heck, I’ve even started mowing my lawn in them. Sure, next to mowing in knee high black socks it might be the mark of an “old man,” but if it saves me from having to coat half my body in sunscreen, I’ll take it.

Power strips, adapters, and cables, oh my

When you have lots of people having to share a handful of charging cables and ports to charge lots of devices, things can get tense. Make sure to bring along lots of your charging gear to keep everyone calm.

Night time entertainment

After a long day in the sun, my family tends to enjoy a “family movie night” and maybe a cool bowl of ice cream. Wherever you lodge, look into what sorts of televisions and wifi is available. Will you be able to log into your favorite subscription service? Should you bring along a laptop full of movies and run an HDMI cable to the living room TV? If you are able to log into your favorite subscription service, make sure you log out of it before you leave.

While my family often enjoys quiet nights at home, we do occasionally enjoy going out on the town, too. So, think about bringing along at least one pair of “nice” clothes for some fancy dining.

Navigation needs

I tell my kids to not be entirely dependent on GPS…you never know when it might fail you. We often take advantage of triptiks from AAA and other material to help us reach our destination and explore local attractions.

Make memories

Need a family picture for your Christmas letter? The family vacation is a perfect opportunity for that. You can go one step further by buying coordinating outfits beforehand and bringing them along with you.

So, after you’ve made it through a few of the travel checklists out there, come back here for a few more ideas to make your family vacation great!

Vacation themed songs

Every year, usually in December, I edit down all the raw video I’ve collected of family activities over the last 12 months into a “family movie” that I force let family and friends watch. This year is no exception. I’m particularly excited about the Marvel-style opening segment I built.

I break my movies into chapters by subject such as Christmas related activities, Sports, Theater & Art, Graduations (if any of the kids have graduated from a school that year), etc. Each segment is comprised of edited, relevant video, and, occasionally, a photo montage.

Most years my family goes on a family vacation, so naturally I include video and photos of our exploits. Any photo montage I include is only complete if I set it to music and as these photos are vacation-related, the music should be vacation-themed in some way. To that end, then, here is a list I’ve compiled of vacation-themed songs I look to when editing my family vacation media for the family video:

Holiday Road — Lindsey Buckingham

“Holiday Road” is the theme song of National Lampoon’s Vacation–the quintessential family vacation movie. The movie documents just about everything that can go wrong during a family vacation. I find it cathartic that, while things often go wrong during my family vacations, they never go as off-the-rails as the Griswolds’.

Vacation — The Go-Gos

A classic from the great band of the 80s and perfect for your vacation segments in your videos.

Island in the Sun — Weezer

The opening line to this song is: “when you’re on a holiday…”. I’d say that fits my criteria. This is a laid-back song that definitely evokes stress-free days on the beach or somewhere far away from your daily toils.

Come Away with Me — Norah Jones

Here’s another breezy song that exhorts you to grab your favorite people and head out to “fields where the yellow grass grows knee-high” or other such remote destinations.

Going Up the Country — Canned Heat

Here’s a little ditty from the 60s about leaving the city and going to some place you’ve never been to before.

Bang the Drum all Day — Todd Rundgren

One could argue that this really isn’t a vacation song: sure, the singer doesn’t want to work, but he doesn’t want to play, either. He just wants to bang his drum all day. Nevertheless, the song is funny and feel-good and should work well under vacation footage.

Come Go With Me — Exposé

Another 80s tune about getting away from your mundane realities.

Sailing themed songs

If your vacation happens to include some sailing adventures, here are a few options that might work for you:

Vacation — Connie Francis

I am a sucker for oldies songs that hit on the themes I need, and this certainly fits the bill.

« Older posts

© 2024 DadOverflow.com

Theme by Anders NorenUp ↑