HomefieldOfView | SPi-V dev

Navigation

user

QuicktimeVR parser

SPi-V can not play back Quicktime VR files. SPi-V is based on Shockwave, and Shockwave can not 'parse' Quicktime files. At least, not without the Quicktime Xtra (a plugin for Shockwave), but this Xtra relies on Quicktime being available on the target machine. So the Quicktime Xtra is not an option.

The Quicktime Parser script is an alternative solutions to having native support in SPi-V. The script 'digests' the quicktime file as it is stored on your webserver, and converts it to a SPi-V xml file on the fly.

The Quicktime Parser script is provided as open source, in hopes it will be improved upon by and for the SPi-V community.

Quicktime parser script 1.0.1 (795 Kb)

This page explains how to install, test and use the initial version of the script.

Requirements and limitations

The quicktime parser script has a number of requirements for your webserver:

  • Apache webserver with Mod Rewrite support or
    IIS with ISAPI_Rewrite (see below)

  • PHP 4 (PHP 5 untested)

Future versions may be ported to other server side scripting environments than PHP, suchs as ASP. When used on a webserver running IIS (the native Windows based server), the script requires a rewrite rule to work, which is described below. See bvogl's tips below to find out your server configuration.

The current script imposes a number of limitations on the Quicktime file. In time some of these limitations may be lifted.

  • Cubic only. Cylindrical may be added later
  • JPEG compressed panos only. Future support for codecs is higly unlikely.
  • Only the first node in a multinode qtvr is parsed for now.
  • The script cannot parse 'compressed headers'.

Note that the parser script should readily accept any number of tiles in any order.

Starting with version 0.9.5, the parser script caches the xml output file to disk. This means the Quicktime file is only parsed the first time it is opened, reducing the server CPU load. If a cached version of the xml file is found, all the parser script does when serving the file is seeking through the file to serve up individual tiles. This is done in a very efficient manner.

You can edit the cached file to add SPi-V specific features to the scene, such as those offered by scriptlets. Once created, the xml file will not be rewritten by the parser script unless you specifically tell it to (see below), or upload a newer version of the qtparser script or quicktime file.

Installation and testing

Part 1

First of all, have a look at this quicktime file:
http://fieldofview.nl/spv/cathedral.mov
Parsing the quicktime file gives you this XML file:
http://fieldofview.nl/spv/qtparser.php?mov=cathedral.mov
And finally, loading this into SPi-V gets you here:
http://fieldofview.nl/spv/show.php?file=qtparser.php?mov=cathedral.mov

Start off by just uploading the qtparser.php script and the cathedral.mov file to your webserver. Then try something like:
[yourserver]/[yourpath]/qtparser.php?mov=cathedral.mov
You should get the same xml file as you got above. If not, please post a link. Pay close attention to the hfov and vfov values in the panoelement nodes; they should be 90. If they are some odd floating point number, please post the type of server you are using.

Try the same with a number of quicktime files on the server. Just replace the cathedral.mov part with a relative url to a quicktimevr file on your server. See if you can get any of them not to return you an XML file, keeping in mind the limitations of the current script mentioned above.

If you find files that conform to the above but don't produce a valid XML file, please post a link and state what program(s) you used to produce the Quicktime file.

After parsing a Quicktime file, you will see an XML file is created in the same directory as the quicktime file. On consequent calls to the quicktime parser script, this XML file will be served instead of parsing the quicktime file again. If you change your quicktime file, you have to manually reset the xml cache. This can be done using the following syntax:
[yourserver]/[yourpath]/qtparser.php?mov=yourfile.mov&cache=reset
Alternatively you can just remove the XML file and it will be recreated the next time the script parses the file.

If you do not want to use the caching feature, use the following syntax when calling the script:
[yourserver]/[yourpath]/qtparser.php?mov=yourfile.mov&cache=false

Part 2

After you have confirmed the parsing process works, it's time for step two: loading the xml into SPi-V. The qtparser script not only converts the quicktime vr headers into a SPi-V XML file, it also serves each of the JPEG encoded tiles in the Quicktime file as seperate JPEG files. In order for this to work need to fool SPi-V into thinking the PHP file is a JPG file.

The parser script uses a trick to make the SPi-V engine think the php script is actually an image file. Thanks to Joost Nieuwenhuijse, this trick works without a hitch if you use Apache.

If your website is hosted on an IIS server the server needs a bit of configuration using eg ISAPI Rewrite. If you have permissions to install software on the webserver, the free version of ISAPI Rewrite will do for our needs. After installing the free version of ISAPI Rewrite, replace the httpd.ini file in the installation directory with the httpd.ini file supplied in the qtparser archive.

Upload the show.php and SPi-V.dcr to the same location as the qtparser script.

Now we're finally ready to load the xml file into SPi-V. I have provided show.php to do this easily:
[yourserver]/[yourpath]/show.php?file=qtparser.php?mov=cathedral.mov
If this works, try it with a couple of the quicktime vr files on your webserver that you confirmed result in valid XML files. You can use relative paths to the quicktime movie, eg:
[yourserver]/[yourpath]/show.php?file=qtparser.php?mov=../[quicktimepath]/[quicktime.mov]

If you want to supply the qtparser script with additional attributes while using show.php, like the cache parameter, you will need to use the following syntax:
[yourserver]/[yourpath]/show.php?file=qtparser.php?mov=cathedral.mov%26cache=false

Instead of feeding the results of the qtparser script straight into SPi-V, you could also save it to disk, and edit it to add SPi-V specific features to your quicktime files, eg through the use of xml scriptlets. You then supply the show.php script with the path to your edited SPi-V xml file, but the JPEG tiles are still read from the Quicktime file.

History

  • 13 Jan 06 (1.0.1): fixes for Pano2QTVR (Ingemar Bergmark) and preview track improvements (Thomas Rauscher)
  • 09 Jan 06 (1.0): preview tracks are now displayed
  • 09 Jan 06 (0.9.7): removed mod_rewrite hack for Apache, changed sample scene, caching fixes
  • 16 Mar 05 (0.9.5): added XML file caching
  • 24 Feb 05 (0.9.1): added information about IIS
  • 22 Feb 05 (0.9): initial public version

Future versions / TODO

  • Quicktime
    • multinode
    • cylindircal panorama support
    • maps (Cubic Navigator can do it, so should we ;-)
  • Server
    • support for other scripting environments (ASP, ...)

.htaccess issues

While installation of qtparser will be quite straightforward, it could be a little tricky to have your webserver working the way you want. Here are some tricks to get through webserver whoes:

First of all:
Look, if php is working and mod_rewrite loaded:
Create a file named "info.php" with the following line inside:
<?php phpinfo(); ?>
Upload and run it (by calling the URL). If PHP is working on your sever, you will get back some detailed information about your server.
Look at the section "Apache" - "loaded modules". This is the interesting one. Do you see "mod_rewrite" there? If not, call your provider to load the module.

The .htaccess file:
If your webhoster is someone who takes care about security, the option "AllowOverride" is disabled.
If you can access the error.log of your website you will see a line telling you that you have this problem. Also this may be the problem if your .htaccess seems to be ignored completely.
In most cases, overrides are is not necessary because they already should be correctly set by your webhoster. So you can safely delete the line Options FollowSymLinks from your .htaccess file.

Now re-try using an URL with the "qtparser.jpg"-style. It should work now. If not, contact your hoster and ask if your virtual host has set "AllowOverride"
correctly (This will not compromise the sever's security)

As soon as your server understands "qtparser.jpg" and interprets it correctly, you will be fine...

no more mod_rewrite

If your website is using Apache, mod_rewite is no longer required, thanks to a tip from Joost Nieuwenhuijse. You can skip the whole .htaccess file (it is no longer in the archive)

qtparser.jpg is gone (instead the parser script now uses qtparser.php/tile.jpg)

qtparser addition for lazy people ;-)

I have written a small PHP-script that will scan an existing HTML-page and replace the quicktime object with the tags for SPi-V.
You can download it here:
http://bernie.x-net.at/qtparser/convert2.zip

Unzip the file and put it in the directory where qtparser is installed.

Usage:
Re-write your URL by inserting this code:
.../convert2.php?file=...

Example:
If your Quicktime panorama is called by the URL
http://bernie.x-net.at/fotos/panoramas/gard-low.html
use
http://bernie.x-net.at/fotos/panoramas/convert2.php?file=gard-low.html
to call a SPi-V version of your panorama.

Parameters:
Besides the required parameter "?file=" you can add the parameter "&pos=" if your QTVR is not the first quicktime-plugin in the panorama (e.g. if you have sound added etc.)
The complete URL syntax would look like this:
http://...../convert2.php?file=...&pos=...