U kijkt naar de archieven van 2005.

Not one lonely romantic ruin but 3 fuckups:

  1. I nearly ruined a shoot where I was the sound recordist by forgetting the 9V batteries I bought the day before. I thought I was well prepaired since I had two pairs of rechargables and a new fresh Duracell pair for the Shure FP-33 field mixer. After one and half hour the first rechargable pair gave up. The next pair called in sick – no juice, I presume because of the freezing cold. It turned out that the fresh batteries were lying safely at home while we were in a snow covered field about an hour away from civilisation. We were able to continue shooting while Anthony went looking for batteries because I had my new Røde Videomic with me. It won’t sound the same but it’s possible we only need one line.
  2. I fucked up a potentially good film. The circumstances were far from ideal but anyway, I fucked up and I’m not over it yet.
  3. Scumbags are ruining the internet. Not only do they see it fit to send me 100 to 150 spam mails a day but they discovered my blog too. I have to delete about 20 comments each day since last week. That’s why you find a link for Online Poker ? in the footer of every page. Don’t worry, the link will just take you to Wikipedia. The idea is to screw up the google search results for anyone looking for Online Poker. Hit the question mark for a more detailed explanation.

I guess posts like these make me a real blogger.

A DVD Studio Pro script for playing one track out of 16 tracks at random. The script won’t play a track twice unless all tracks have been played.

So you have made a few short films you want to show around, let’s say 16 of them. You create a nice DVD in DVD Studio Pro but now you want a random button. This button should show the viewer one random movie out of your 16 masterworks, and it should remember which ones it has already played. You start looking at the manual, you start looking around the internet but all you can find are pointers to expensive tutorials and scripts for random play with 3 tracks.

This can’t be that hard, you think, but actually it is. The easy part is the random choice: DVD Studio Pro has a ran function for that. The hard part is remembering which movie has been played. DVD Studio Pro has only 8 registers to use. And you have 16 movies to show.

But every register is 16 bits long. This means that you can remember 16 tracks in one register. My script does exactly that, and it is expandable to 32 or 48 tracks if you want.

Jump to download section

Register layout

Before we continue with the script, let me explain the register layout.

register layout

I tend to give my registers names because this eases reading and writing scripts a lot. I start allocating the registers on top for temporary use and the ones at the bottom for permanent duty. In this case we have 3 temp registers (GRPM 0 to 2) which can be reused by other scripts, and one global register (Random_mask) containing the tracks played.

Random_mask is a bitmask containing the tracks we already played. 1 means “played”, 0 means unplayed. 0000 0010 0000 0100 means track 10 and 3 have been played. If you are a bit rusty with binary numbers and bitmasks, read this article by David Nagel first. I have to warn you that loading the site may cause your browser to explode, but it has to be said that David Nagel’s articles on DVD Studio Pro are among the best on the net.

The script

Here it is:

the script header the script 1 the script 2 the script 3 the script 4 the script 5 the script footer

The script is divided in 5 mayor parts. I put a Nop-separator between each part.

Part 1: input and safety check.

the script 1

Line 1 is a safety check. Random_mask will be all ones if all tracks have been played. (1111 1111 1111 1111 in binary is equal to 65535 in decimal.) We need to reset Random_mask, otherwise the script will keep on looking for a new random track that hasn’t been played. This causes an endless loop which your viewers will enterprete as a DVD that “hangs”.

Line 2 chooses a number between 1 and 16 and puts it in tmp_random_track.

Part 2: creation of the bitmask

the script 2

In this part the script creates the bitmask that represents our currently chosen tmp_random_track. The way to do this is pretty easy: start with a bitmask with 1 bit at the extreme right (line 4) and keep shifting it to the left until it’s at its place. Multiplying a number by 2 is the equivalent of a shift to the left in binary (multiplying by 10 is the same as a shift to the left in decimal).

In pseudo-code the algorithm looks a bit like this:

tmp_mask = 1;
tmp_counter = tmp_random_track;
while (tmp_counter > 1) {
   tmp_mask = tmp_mask * 2;
   tmp_counter = tmp_counter - 1;
}

The actual implementation is a bit different to get the main loop (lines 7 to 9) as tight as possible. (I just couldn’t resist writing a script that goes to eleven…)

After this part, tmp_mask contains the bitmask representing our random track: e.g. 0000 0000 0000 0100 if tmp_random_track is equal to 3.

Part 3: check if the track has already been played

the script 3

This is the part where we did all this trouble for: check if we haven’t already played the track we chose. If it weren’t for this, line 2 would be sufficient on its own. Since we have the bitmask we can simply AND it with Random_mask and see if there’s our bit is on. Remember, 0 AND 0 = 0, 1 AND 0 = 0, 0 AND 1 = 0 but 1 AND 1 = 1. So, if the result of tmp_maskAND Random_mask contains a 1, it must be our bit. In other words, we have already played the track. If so, we choose another track (line 13, Goto 2 if ...).

The only trouble is that the and operation in DVD Studio Pro destroys one of both registers. That’s why I copy the mask to tmp_counter, as we need tmp_mask in the next part.

Part 4: registration of the chosen track

the script 4

Here we set the bit of the track we’re going to play in Random_mask. The operation we use is OR, since 0 OR 0 = 0, but 1 OR 0 = 1, 0 OR 1 = 1 and 1 0R 1 = 1.

Part 5: jump to the chosen track

the script 5

This code adjusts the random_track number. Before we have a tracknumber between 1 and 16, afterwards we have a track number between 49280 and 51200. Then the script jumps to this number. It looks like magic and it is a bit magic.

I learned of these numbers through David Nagel’s articles. DVD Studio Pro gives every item a number behind the scenes. Tracks are numbered starting from 49280 (0xC080) and upward. They’re spaced 128 (0×80) magic units apart. This means that 49280 (0xC080) is the first track in your outline, 49408 (0xC100) is the next one and so on. You can jump straight to a track once you know its number with Jump Indirect.

Menu are numbered from 32 (0×20), spaced 32 units (0×20) apart (32, 64, 96, … or 0×20, 0×40, 0×60, …) and buttons are numbered from 0 to … within the menu . Add the number of a button to the menu it’s in and you can jump straight to it (f.i. Jump Indirect(35) jumps to the fourth button in Menu 1).

Download and adjust.

You can download the script from here. Unzip it. Load it into DVD Studio Pro by right clicking on a script and choosing “Load script”. Sadly, you may have to adjust the script. My ancient 2.0 version keeps forgetting the registers. Make sure the script looks absolutely the same as above.

Less than 16 tracks?

part 1 explained

You need to adjust 2 lines if you have less than 16 tracks to choose from. Obviously, you need to change the 16 in line 2 to the actual number of tracks. But you also need to adjust the limit (65535 in line 1) for your actual number of tracks. Failure to do so may cause endless loops, hanging DVDs and general infertility. Here’s the table to guide you:

# tracks limit (2#tracks-1)
1 1
2 3
3 7
4 15
5 31
6 63
7 127
8 255
9 511
10 1023
11 2047
12 4095
13 8191
14 16383
15 32767
16 65535

More than 16 tracks?

If you have more than 16 tracks you will need a second Random_mask. Use the first one for tracks 1-16 and the second one for 17 and higher. You will need to alter the safety check in part 1 and basically duplicate all of part 2, 3 and 4 for Random_mask_2.

Running time

The runtime complexity of this script is O(n2). That means that the script may take a long time to find the last unplayed track if the number of tracks is large (>> 16).

If you ever wondered how to make a button in DVD Studio Pro to play a random track, get my script here.

Yes, the write up took a lot longer than the script itself. And yes, it is possible that DVD Studio Pro 4 has something like that builtin. I wouldn’t know ’cause I don’t have version 4 and I can’t find the manual online.

It took a while, but my movie pages are finally online. Let me know if they work for you. I’ll be editing the movie posts to point to the right pages.

By the way, I realised that the smaller sized mp4′s are the perfect size for the new iPod “video”. You should be able to download them and put them straight onto your iPod. See, there’s a reason to be standards compliant :-)

On an unrelated note, I noticed last week that the backups on my old linux file, mail and printserver were failing. To give you an idea how old this machine is: it’s a Pentium II 350 MHz with 128 MB RAM running RedHat 7.3. The machine runs rdiff-backup (recommended!) on a RAID 5 array. The backups had failed somewhere in the last month, causing rdiff-backup to revert the backup-area to the previous known good backup state. Trouble is, among the things being backed up is my home directory with my mailbox in Maildir format. In my mailbox there’s a spam folder containing about 14000 spam mails at the moment – I get about 100 spam mails a day. Reverting these 14000 mails caused my ancient 0.11 version of rdiff-backup to rapidly consume all available memory. I guess there was some recursive code in it. I couldn’t just delete all spam and be done with it, because the problem was in the already backed up files. I could delete all backed-up files and start all over but there were a few things there whose recent history I wanted to keep. So I set on the task to update rdiff-backup to it’s latest 1.0.1 version.

I wasn’t very happy doing this since I know that this is such an old version of RedHat Linux that updating stuff can be a chore. My fear became reality: compiling the new 1.0.1 version failed because it needed a new version of librsync. But, as it turns out, Dag Wieers still maintains an archive with updated RedHat 7.3 rpms. apt-get update and apt-get upgrade took care of librsync. rdiff-backup 1.0.1 compiled without even a warning. Running the new rdiff-backup cleanly reverted the backup area and my automated backups started working again. All in all the proces took about an hour and a half, thanks to Dag and the rdiff-backup team caring about old machinery. Thank you guys!

This was the second time in the last three years I had to work on this small server. Last year a harddisk failed. Took me a while to find a 40 GB drive for the RAID 5 array :-) Remember, this machine can just about run Windows 98. Linux can be good for the lazy sysadmin.

In case you’re wondering about the 14000 spam mails I’m keeping: I’m building a spam corpus for Spam Assassin or some other bayesian spam filter. I hope this will work better than my provider’s spam filter and Apple Mail’s spam filter combined. I just haven’t found the time to implement it. Reminds me about something: time to install rdiff-backup on my MacOSX machine.

In the past month I’ve been working an article that starts like this:

In the last year, a lot of cheap (or not so cheap) HD video cameras came onto the market. These cameras are targeted towards consumers or professional users at the bottom of the scale (“prosumers”). This page tries to give a comprehensive overview of the different cameras and their characteristics.

It’s not finished yet, but Mike Curtis has beaten me on speed anyway. So, if you’re interested in a shiny new “cheap” HD camera, go read his article for an overview of the market in the next couple of months.

A couple of remarks: the Panasonic HVX-200 looks like the camera to beat, but it isn’t out yet, nobody knows the exact tech specs and only a few have seen footage shot with it. The same goes for the Canon XL-H1 although that one will be on the market sooner. Please remember that Mike Curtis’ overview is written from the perspective of indy film makers. If you’re looking for run-and-gun, ENG or documentary camera, the Sony Z1 or the more expensive Canon XL-H1 will be hard to beat. The JVC HD-100 needs attention to get good images out of it (manual focus and iris) and has lousy low light performance. Battery perfomance is awfull, it won’t record 720p60 or 720p50 and there’s also the split screen issue. Panasonic P2-media is expensive and holds only 8 minutes at highest quality. You will have to fiddle with hard disk recorders and/or laptops if you shoot hours of footage a day with a Panasonic HVX-200.

Especially for European users, I’d like to note this:

  • The Sony Z1, JVC HD-100 and Canon XL-H1 are multiformat cameras, PAL and NTSC compatible. All others have a specific PAL or NTSC version.
  • The Sony FX1e doesn’t have a fake 24 p (CF 24) solution in Europe (although you wouldn’t want to use it if it existed).
  • The Canon XL-H1 will need a factory modification (meaning €€) before it will record 1080i50.
  • According to this post the Panasonic HVX-200 won’t be having a 24p feature in PAL countries.
  • The JVC HD-100 comes in two versions in Europe, a HD-100 without firewire input and a HD-101 with.
  • The state of HD in Europe is immature. HD television sets are rare and it’s not decided yet whether the HD broadcast standard will be 1080i50 or 720p50. The EBU leans towards 720p50 but the only European HD station is 1080i50. One of the biggest selling points for a Sony FX1 or Z1 is that it’s a damn good 16:9 DV cam. You can always edit in DV with it, even if you shoot in HD.

Update 2005-10-18:

According to this page, the Canon XL-H1 will be delivered as a 50 Hz camera in Europe (1080i50 and a pseudo progressive 25p solution called 25F) with the option to add 60i, 30f and 24f recording.

In case you’re wondering what’s happening, I’m working on the “business” end of my site. The goal was to embed my movies into simple presentable pages. I succeeded but in the process I learned once again why I don’t want to do this web development thing for a living.

Here is the goal: to embed mp4 movies in my pages while keeping them XHTML compliant. I don’t want to force people into one and only one plugin, I don’t want the plugin to load whenever you load the page and the page should be compatible with as much browsers as possible but at the same time stay very simple. I don’t want a special case for each and every browser.

The plan of attack was: create a large image on every page, and replace this image with the movie whenever it’s clicked. Straight and simple DHTML.

To replace an image, you need to find it (getElementById), find it’s parent (parentNode) and replace it with another element (parentNode.replaceChild(new_element, old_element). Easy enough.

To create a movie object, you need this code (official Apple Quicktime embedding code):

<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
 CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab"
 HEIGHT=yy
 WIDTH=xx>
  <PARAM NAME="src" VALUE="MyMovie.mov" />
  <EMBED SRC="MyMovie.mov"
   HEIGHT=yy WIDTH=xx
   TYPE="video/quicktime"
   PLUGINSPAGE="http://www.apple.com/quicktime/download/" />
</OBJECT>

That doesn’t really look like XHTML to me and it’s not plugin-agnostic either. But it’s a start. I knew from Flash Satay that it’s possible to massage this kind of code into something more sensible. After a few hours, I came to this result: the minimum amount of code you need to get Mozilla-derivates to load a movie into a webpage:

<object data="movie.mp4" type="video/mp4" width="384" height="304" />

Nice and clean. You need to add 16 pixels to the height for the controller bar of the plugin but other than that it’s perfect. But it doesn’t work in Safari. Safari needs a param telling it what the src of the object is, allthough it’s clearly mentioned in the data attribute. So we come to this:

<object data="movie.mp4" type="video/mp4" width="384" height="304">
  <param name="src" value="movie.mp4" />
</object>

Nice thing is, this works in Microsoft Internet Explorer for PC too. But you need to wait until the whole movie has been downloaded until the plugin appears. Of course I already knew this from the Flash Satay article. So I settled on two versions: the one directly above for everyone non MSIE and this one for MSIE:

<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
 codebase="http://www.apple.com/qtactivex/qtplugin.cab"
 width="384" height="304">
  <param name="src" value="movie.mp4" />
</object>

This clearly leaves MSIE users with no other choice but the Quicktime plugin but at least they won’t have to wait ’till the movie has finished downloading. I could try the same trick as Satay by using a quicktime reference movie which loads another one (use a qtsrc parameter on the object to point it to the final movie) but then my viewers would have to click twice before the final movie appears.

Next thing I tried was Internet Explorer for Macintosh. The horror. It needs an <embed...>-tag. Back to square one it seems. So the code for MSIE became:

<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
 codebase="http://www.apple.com/qtactivex/qtplugin.cab"
 width="384" height="304">
  <param name="src" value="movie.mp4" />
  <embed src="movie.mp4"
   height="384" width="304"
   type="video/mp4"
   pluginspace="http://www.apple.com/quicktime/download/" />
</object>

Not XHTML compliant, but somehow I think MSIE users don’t really care.

Next stop: javascript. I’ve never ever written a single javascript in my life. My first try went like this:

function load_player(movie, hsize, vsize) {
  var W3CDOM = (document.createElement && document.getElementById);
  if (!W3CDOM) return;
  var player = document.getElementById('player');
  var p = player.parentNode;
  var el = document.createElement('object');
  el.setAttribute('width', hsize);
  el.setAttribute('height', vsize + 16);
  if (navigator.appName == 'Microsoft Internet Explorer'){
    var prm = document.createElement('param');
    prm.setAttribute('name', 'src');
    prm.setAttribute('value', movie);
    el.appendChild(prm);
    var mbd = document.createElement('embed');
    mbd.setAttribute('src', 'movie');
    mbd.setAttribute('pluginspace', 'http://www.apple.com/quicktime/download');
    mbd.setAttribute('width', hsize);
    mbd.setAttribute('height', vsize + 16);
    el.appendChild(mbd);
  } else {
    el.setAttribute('data', movie);
    el.setAttribute('type', 'video/mp4');
    /* for Safari */
    var prm = document.createElement('param');
    prm.setAttribute('name', 'src');
    prm.setAttribute('value', movie);
    el.appendChild(prm);
  }
  p.replaceChild(el, player);
  el.setAttribute('id', 'player');
}

This thing was meant to be called from on onClick handler on an image with id of "player". The non-MSIE side of the function worked allright, but MSIE took exception to the attachement of the <embed> tag to the <object> (the line that says el.appendChild(mbd)). Whatever I tried, I couldn’t get rid of this. Technically MSIE is right, you cannot have an <embed> tag in an XHTML document but this wasn’t the time nor the place for being pedantic.

Kind of an awkward situation: I need the <embed> tag for MSIE Mac to function, but MSIE (PC and Mac) won’t let me write it into the document. Then it dawned upon me: I needed to inject some dirty HTML in the document and I’m using all kind of good mannered methods. Dirty results call for dirty deeds and the deed called for here has the name element.innerHTML (a Microsoft invention).

The only thing needed was something to put the dirty code into. I put a <div> around the <img> and was able to use this <div>‘s innerHTML to create the necessary object and embed‘s.

I tried to be nice and let the non-MSIE code leave the <div> alone and just replace the <img> but that resulted in a movie plugin and empty space the size of the replaced image. So for now I’m replacing the whole <div> and it seems to work OK.

As a result, the body now has the following structure:

<div id="player">
  <img src=... onClick="load_player('movie.mp4', width, height)" />
</div>

and the Javascript function looks like this:

function load_player(movie, hsize, vsize)
{
  var W3CDOM = (document.createElement && document.getElementById);
  if (!W3CDOM) return;
  /* first do the IE stuff. */
  if (navigator.appName == 'Microsoft Internet Explorer'){
    var player = document.getElementById('player');
    var str = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ';
    str += 'codebase="http://www.apple.com/qtactivex/qtplugin.cab" ';
    str += 'width="' + hsize + '" height="' + (vsize+16) + '">\n';
    str += '<param name="src" value="' + movie + '" />\n';
    str += '<embed src="';
    str += movie;
    str += '" type="video/mp4" pluginspace="http://www.apple.com/quicktime/download" ';
    str += 'width="' + hsize + '" height="' + (vsize+16) + '"></embed>\n';
    str += '</object>';
    player.innerHTML = str;
  } else {
    var player = document.getElementById('player');
    var p = player.parentNode;
    var el = document.createElement('object');
    el.setAttribute('data', movie);
    el.setAttribute('type', 'video/mp4');
    el.setAttribute('width', hsize);
    el.setAttribute('height', vsize+16);
    /* for Safari */
    var prm = document.createElement('param');
    prm.setAttribute('name', 'src');
    prm.setAttribute('value', movie);
    el.appendChild(prm);
    p.replaceChild(el, player);
    el.setAttribute('id', 'player');
  }
}

You can see an example here. Let me know if it works for you, especially if you have a strange combination of browser and movie player plugin (I’m looking at you, lonely linux user).

I heard a rumour somewhere W3C is planning to drop the <img> tag and use <object>‘s instead. Somehow I disagree.

La Pasión started as a small, single afternoon movie Roeland and I planned to make for school. We quickly realised it could be something bigger, so we reworked the scenario and filmed the next sunday, and then the next sunday and then another and another sunday. It took quite a long time because most of the time we had to wake the actors first (Hi, Jeremy and Elliot) and clean the guest/party room next. But most of the time was spend setting up shots. It’s amazing how much longer it takes when using a tripod and all manual camera settings compared to hand held shooting with a camera in full auto mode.

The reason most of my previous stuff is handheld (see for instance Degoutant) is because our teacher tells us to do so. In fact, when I showed him my tripod during one of the first lessons two years ago, he told me I wouldn’t be needing that for quite some time. It might seem contra-intuitive when every bulletin board on the web tells you to use a tripod if you want “professional looking” movies, but the truth of the matter is that it’s a lot easier and faster to use a handheld camera if you want to learn about composition, camera moves, shot continuity and rhythm. The end result might not be as good looking but you do learn how to tell a story visually. I hope you see the progress I made if you look at my first movie and this one.

By the way, there are still some handheld shots in the movie. See if you can spot them. And another by the way, this is the first movie shown here shot with my new Sony FX1. I’m quite happy with it. I feel like it will take some years untill I will have exhausted the possibilities of this camera. Next on the list is sound and light design and working with a larger crew. We deliberately chose against using lights in this movie since there were only two of us: me as the director, and Roeland as the camera operator.

Anyway, here it is.

Clip Curoon is my first videoclip. Some love it, some hate it. I guess you could call it an anti-videoclip. It’s a single shot movie, 5 minutes long. This one is take 9, the last take.

Image quality could have been a lot better. It think it was around this time (september 2004) that I started thinking about a better camera. As you can see, my Sony TRV 60 just doesn’t cut it, although it looks better on TV than on the web. I’ll have to incorporate gamma correction into my compress-to-web workflow sometime.

Anyway, here it is. Mind you, it makes no sense to look at this clip in a bright, noisy environment. So, close the curtains, put on your headphones and enjoy the movie.

By the way, the actor is Steven Vrancken. I think he does a very good job. The music is by Troissoeur.

Een tiener beleeft een nachtmerrie. — A teenager has a nightmare.

Cast

Ben Scheepers
Slaapkop - Sleepyhead
Ilse Bollaerts
Lotte De Rydt
Ragna Govaerts
Esmée Schaalje
Thannée Schaalje
Lies Scheepers
Sofie Vervoort
Sirenen - Sirens
Bart Verbrugghe
Dief - Thief

Production details

Music
“Paving” by Troissoeur
Camera & editing
Ben De Rydt
Direction
Ben De Rydt & Ilse Plessers
Conceived and recorded on June 25, 2005.

» Background info and comments.

I cut these promo-clips for Troissoeur from material shot by the camera crew at Dranouter Folk Festival, edition 2004. Although the footage was captured on DV, the visual quality is outstanding. That’s the difference a professional crew and professional cameras make. The visuals on stage are made by Ruben Bellinkx.

Two clips: Curoon and Trays. Enjoy!