2009-02-02, Mon

How to batch create contact sheets from videos

Recently, I’ve had to comb through about a 70 one-hour XviD video clips looking for relevant clips for a certain occasion.

To speed up the “combing” process, I created a contact sheet for each video file, extracting one frame from every 30 seconds of video.

Tool Up

Here are the tools I used:

This whole workflow was done on the Windows platform.

Prepare the workspace

  1. Create a directory where all the work will be done. For the sake of this tutorial, we’ll use the folder d:\videos\.
  2. Copy all your video files to the folder d:\videos\.
  3. Download extract-csheet.js and place it in the d:\videos\ folder.
    This is a command-line script that runs the relevant Quicktime functions with minimal user interaction.

Test run

You should have the following files in the d:\videos\ folder.

  • extract-csheet.js
  • Your video files (video1.avi, video2.avi, video3.avi, etc.)

Open up the Command Prompt change your directory to d:\videos\

C:\Windows\>d:
D:\>cd videos

Now run the script on one of the video files by typing

D:\videos\>cscript extract-csheet.js "d:\videos\video1.avi"

If everything goes right, you should see a Quicktime Player window pop up with your video and a dialog box asking for the Export Image Sequence Settings.

Basically what this does is generate an image sequence from the video file. Format specifies the output file format of the sequence. I used JPEG. As for the Frames per second, here’s the equation:

Frames per second = 1 / (interval between frames in seconds)

A value of 1 would give you one frame per 1 second of video. A value of 0.1 would give you one frame per 10 seconds.

In my case, I wanted a frame for every 30 seconds, so I used a value of 0.03 frames per second (1/30).

When you’re done, clicking OK will start the conversion.

_Note: the script saves whatever settings you’ve entered this time round in a file c:\QuickTimeCodecInfo.xml to be used for subsequent conversions.
If you wish to change the settings, delete the c:\QuickTimeCodecInfo.xml file and run the script again._

When the conversion is done, you’ll find a series of JPEG files in d:\videos\.

video1 01.jpg
video1 02.jpg
video1 03.jpg
video1 04.jpg
.
.
.
video1 99.jpg

Batch it

Now, using Notepad, create a batch file in d:\videos\ called process.bat. In that file, put in a line to execute the script for every video file that needs a contact sheet.

cscript extract-csheet.js "d:\videos\video1.avi"
cscript extract-csheet.js "d:\videos\video2.avi"
cscript extract-csheet.js "d:\videos\video3.avi"
cscript extract-csheet.js "d:\videos\video4.avi"
.
.
.
(process.bat)

Make sure you keep the full path of the video.

Save process.bat in d:\videos\.
Run process.bat from the command line

D:\videos\>process.bat

Go grab a cup of coffee.

Create the Contact Sheet

  1. Open up IrfanView, and switch to “Thumbnail” mode File > Thumbnails.
  2. Browse to d:\videos\
  3. Select the relevent image sequences (e.g. video1 01.jpg, video1 02.jpg, video1 03.jpg)
  4. File > Create contact sheet from selected files…

And there you have it.

Isaac Su

tags: batch clip contact-sheet generate image irfanview quicktime scanning script sequence video

Comment

---

2009-01-27, Tue

View Chinese Characters on Windows Mobile 6 (WM6)

Many Windows Mobile 6 phones don’t come bundled with any way to view chinese characters in SMS’s, MP3 files and websites.

Here’s a solution that has worked on the Samsung SGH-i780 running Windows Mobile 6 (WM6).

  1. Download sunglobe.cab. This provides the fonts and other patches to enable chinese character viewing on your phone.
  2. Copy it to your phone and install it by clicking on the .cab file using File Explorer.
  3. Soft-reset your phone. The easiest way would be to power-on/power-off the phone.
  4. You should be able to read chinese characters on your phone.
Isaac Su

tags: characters chinese sgh-i780 sunglobe view windows-mobile-6 wm6

Comment [1]

---

2009-01-18, Sun

Play Xvid in QuickTime Windows

Quicktime on Windows doesn’t use Windows’ built-in codec api, so codec packages such as K-Lite Codec Pack won’t work.

What you’ll need to do is install 3ivx MPEG-4. There is a trial limitation on the encoder but the decoding should work just fine (so far).

Isaac Su

tags: 3ivx codec mpeg-4 qt quicktime video windows xvid

Comment

---

2009-01-16, Fri

Zip ties are incredibly useful for air travel

Zip ties, or more formally know as cable ties are incredibly useful when it comes to air travel.

These sturdy plastic things go right past the metal detectors, but prove to be venerable padlock alternatives/supplements when securing your baggage for check-in. (Obviously the point isn’t so much to prevent theft than it is to deter and detect any form of break in).

Other uses include mending sandals, fixing the occasional broken handle and tagging your bags.

Isaac Su

tags: alternative cable-ties handy plastic security theft travel zip-ties

Comment

---

2009-01-14, Wed

LCD Screen Burn-in

So I just bought a second-hand 20-in Dell Ultrasharp 2007FPB off ebay a few weeks ago.

I began to realize some “burn” marks along the top part of the screen, where your menu-bar and address bar would sit when Firefox is maximized, and it was a whole strip across. I wouldn’t have noticed it if I hadn’t set my desktop to a plain gray color. The marks, in my instance, looked purplish-red against the gray background.

After looking up various solutions, here’s the one that worked for me:

  1. Set your desktop background to pure white
  2. Right-click desktop, Arrange Icons By, turn off Show Desktop Icons
  3. Right-click taskbar, turn on Auto-hide the taskbar
  4. Turn off the screen saver, monitor power saver, sleep timer and hibernate timer.
  5. Leave it on overnight

Essentially, what’s happening is that the “burnt in” pixels have been in one position for a very long time, and need a little “stretch” – a full white-out.

The situation on mine has shown some improvement, but I may need to leave it for a bit longer. Check back again tomorrow.

Bonus: Leave your monitor at its lowest brightness, without turning it off completely. This helps with the life of the LCD back light.

Isaac Su

tags: burn-in fix hardware lcd monitor pixel tech

Comment

---

« Older Newer »