Convert ISO639 codes to Decimal, DVD Studio Pro Language settings, SPRM0 values

Have you ever wanted to know what the language codes are for a DVD? They are held as a decimal number in SPRM0 and you can use this value in lots of ways.

For example, knowing the setting for the language code in a DVD player means that you can force your DVD to start up in that language. However, knowing the values your authoring app uses for language codes is also valuable.

Working in DVD Studio Pro it is easy enough to change the simulation preferences to display a different language for the project. You can then examine that value when the simulation takes place, but given the sheer number of different languages it would take someone with the patience of a saint to switch all of the preferences one at a time and then see what the values were.

If you use an application like Haxor (Mac only), you can easily convert ASCII to decimal… but only one at a time. Equally frustrating as a job, and also not converting them to the values that DVDs use.

So I talked with Alex Blanc at Ultralab and he wrote a PHP script to do the job – I supplied the text file with the language codes in ASCII characters, and we were able to export a comma separated list which went in to Excel.

Now, for whatever reason, DVD Studio Pro (and DVD Lab Pro on a PC, and probably ALL authoring apps) add 8224 to the decimal value of the letters. Why? I have no idea!

It was a simple matter to have Excel add that value to every entry and then output the necessary numbers.

OK – I’ll agree with you – not a fantastic market for this piece of knowledge, but all the same it’s another piece of the jigsaw for those wanting to fill in the gaps.

Download the resulting file (in pdf format) here.

DVD Studio Pro, Play All, DVDSP scripting

I have been thinking more about how to create a ‘play all’ scenario on a DVD Studio Pro project and reduce the number of scripts to achieve it.

For those who haven’t yet got there, you can achieve a ‘Play All’ system by using stories in your project as long as your footage is all in one track. If, like lots of folk, you have several different tracks that you want to link together in a ‘Play All’ system you have to use scripts.

My advice is first of all to not use lots of tracks, it makes a lot more sense to keep everything in one place and go from there, but if you have already got it set up, this is what you need to do.

First off, understand the principle here. When a user selects ‘play all’ from your menu you need to set up a ‘flag’ so that when a track finishes the player knows that you came from the ‘play all’ button and will go to the next track in the sequence. Easy enough… set the play all button to go to the following script:

mov GPRM0, 1
Jump Track 1

I assume you have not yet used this GPRM, but if you have (and you need to keep it for that use), just choose another free one from the 8 available.

When the track finishes playing the ‘end jump’ will normally take you back to the menu. However, we need to set it to go to a script which first looks to see if the ‘play all flag’ is set. If it is then you need to go to the next track, but if not you go to the menu button for that track. Again, this is easy enough… but could get tedious to set up if you have a lot of tracks.

Here’s where it gets interesting. Imagine a menu with four buttons in a project with three tracks. Each of the first three buttons plays the relevant track, but the fourth button is the play all button. We can use the button number to help us decide if we are in a play all situation or not. Furthermore, DVD Studio Pro has a feature called ‘GPRM based button jumps’. What this means is that you can automatically insert the button number into a script to avoid using lots of script lines and ‘if’ statements. Very handy!

So now, instead of setting a simple flag when a menu button is selected, try setting every menu button to go to this script instead:

mov GPRM0, SPRM8
div GPRM0, 1024
goto 8 If(GPRM0 = 4)
mov GPRM1, 0
Jump Track 1 If(GPRM0 = 1)
Jump Track 2 If(GPRM0 = 2)
Jump Track 3 If(GPRM0 = 3)
mov GPRM1, 1
Jump Track 1

“What the heck is it doing?” I hear you ask!

OK, in this script we are using the automatic button number tracking to tell us which button you came from. SPRM8 is the system register which keeps track of which menu button has been used, and it starts at a value of 1024 for the first button, increasing in jumps of 1024 at a time. So in line 1 we place the value of the button into a register (in this case GPRM0) and then in line 2 we divide it to get single digit integers (1, 2, 3 or 4) to relate to the actual button number on the menu.

If you came from button 4 then you would jump ahead in the script to the place where GPRM1 is set to indicate this is a ‘play all’ situation – GPRM1 is set to ‘1’ and track 1 plays. However, if you are *not* in a play all situation you will have come from any other button, so reading the button number means the track attached to that button will play (this is what lines 4-7 are doing). Just to be sure, line 4 is setting GPRM1 to have no value, and this is important later on.

Now, the end jump for each track can go to a small script which looks to see if GPRM1 has a value in it. If it does, the next track plays, if not you go back to the menu and the button that you came from. For the end jump of Track 1 this will be:

Jump Track 2 If(GPRM1 = 1)
Jump MainMenu [GPRM0]

Line 1 here will take you on to the second track only if you came from the play all button (if you did then GPRM1 would be 1). If you didn’t, then line 2 kicks into action and this is where the GPRM based button jump comes in. Remember in the big script at the top where we put the button value into GPRM0? Well, it stays in there until something changes it. Nothing has changed it because we’ve only played the track, so the value is as it was. If you came from button 1 on the menu, you now go back to that button on the menu. You *could* get it to advance one button if you want so that all the viewer has to do is press ‘play’ on their handset, but I prefer to return them to where they were. It just seems more logical, somehow.

Now, the really cool stuff happens when the viewer is watching a ‘play all’ situation and wants to have a break from it. They can press the menu button again if they want to (or the pause) and they will go back to the menu. If they are very savvy DVD watchers they will know that simply pressing the menu button a second time will return them to the place they were last at – no values get changed, everything continues as normal.

However, what if they are bored with watching Track 1 in the ‘play all’ and now want to skip ahead to play ONLY Track 2? Normally, the value in GPRM0 wouldn’t get changed, Track 2 would play and then go in to Track 3! Agh! BUT… in the script above, since every menu button points to it, the value *does* get changed if the user makes a new choice… and so the ‘Play All’ is stopped! The new choice only will play and then go back to the menu.

Phew! Lots of words to describe a very simple thing – certainly easier to do than to describe. The next bit will be to see if I can reduce this still further so that in one script we can set up a play all, remove it and automatically keep track of which track has played (which means no small end jump scripts… just one master script to control it all).

Watch this space!

Big Mouse passed away today

A very sad day.

We have been looking after two wild mice since they were babies, handed to us all pink and almost hairless, about four days old. They have been with us for two years and eight months, but today the largest of them passed away.

Big Mouse has been ill for some time, carrying large tumours on his back and neck, however despite this indignity and discomfort, he always managed to have a play. Last night he was very tired and whilst he still wanted to come out for a look around, in his own little way he asked to go back to his cage.

He curled up and went to sleep, where he quietly slipped away looking more peaceful than he has done for a long time. He leaves behind his brother (little Mouse) and two distraught ‘keepers’ (we never owned him).

May he rest in peace.

Jason Pitcock, ebay scam, Texas, eBay Fraud

I was looking through the access logs on my blog here and I happened to notice more than one search for Jason Pitcock.

Yes, this low life scum bag managed to swindle me out of a tidy sum of money a couple of years ago which my grandfather had left to me in his will, by masquerading as a legitimate ebay seller with some good Apple computer kit to shift.

Needless to say the kit never arrived and I was one of about sixty folk who fell for his scam auctions. The FBI are now chasing his backside, and I seriously hope this evil piece of bottom dwelling pond scum gets his come-uppance.

There is a whole forum dedicated to chasing this man, and whilst it is a bit of a self-help group, it serves to warn the world that dealings with Jason Pitcock, from Texas, are likely to cause you grief.

It *was* here:
http://www.nails.ch/msgboard/

But now seems to have moved to btselectronics.com which was one of the original trading names that Pitcock used.

Feel free to join the group, and feel even more free to say that you know the man, and even better, know how to deliver some justice in his direction. He has got away with over $100,000 as far as I can tell, and looks set to just get clean away with it. This can’t be right – there needs to be some natural justice in this matter… I’d be happy to hear from anyone so disposed to deliver.

Edit – 21st march 2006 – I received a link swap request from what appears to be a legitimate fraud watch website. Oddly, the URL has a redirect:

http://www.stuartinteriors.ltd.uk/dir/redir.php?url=http://www.fraudwatchernetwork.com/

Now, if this site does indeed warn folks about potential ebay scams and fraudulent activity I’m all for it! Click http://www.fraudwatchernetwork.com/news/ebay-fraud-blog.html if you wish to visit that site.

Fraud – Ebay Fraud Blog
Fraud Prevention, Information and News about Fraud Online

DVD After Edit, DVDAfterEdit

I was recently very fortunate to receive an email from Larry Applegate who is the driving force behind the DVD AfterEdit software now, having bought out Trai Forrester’s interest. Larry invited me to use the software on the projects I do and I was thrilled to be a part of this development.

Simply put, DVDAfterEdit is a ‘post-build’ editor for the mac. It takes a VIDEO_TS folder from a built DVD and gives you access to every single feature, right down to the nav pack level, and enables you to alter each piece to make the project do things the authoring application wouldn’t let you do. You can also put right any mistakes you have made, such as incorrect button navigation, re-set the region coding and so on.

However, it is FAR more powerful than that. You can essentially strip out all of the commands that your application has created and re-build them from scratch, import pieces from other projects and discs, reset the navigation for the entire disc…. and much more. Why would you do this? Well, simply put, you can streamline the way the disc plays in a player and make it far more efficient, and include features you weren’t able to include when the project was first conceived.

DVDAfterEdit comes in different versions depending on what you want to do. Arguably the best version is the ‘Mastering Edition’ which gives you complete control of writing out to DLT before sending the project to replication. The tool set is simply enormous, and you’ll get far more info from visiting the web site. Incidentally, it’s Drupal based, so should immediately feel familiar if you are a drupal fan!

http://www.dvdafteredit.com

I do wish Trai the very best. He is a passionate advocate of DVD and has done so very much for the world’s community of DVD authors. At times he can be controversial, but in nurturing this software from an idea into a reality he has brought about something extremely useful which hundreds of authors use, and which has been used on hundreds of thousands of commercially released DVDs… who knows – you might even have one in your collection!