HomefieldOfView | SPi-V dev

Navigation

user

PTV parser

The ptvparser script is very similar to the Quicktime parser script. Instead of parsing Quicktime VR files, it digests ptv files so SPi-V can display them. The PTV file format was designed by Fulvio Senore to allow PTViewer to display higher resolution panoramas than certain Java runtimes would allow. More information about the PTV file format and a tool for creating PTV files can be found on Fulvio's PTViewer pages.

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

PTV parser script 0.2 (741 Kb)

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

Requirements and limitations

The ptvparser 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.

Encrypted PTV files are currently not supported.

The parser script can create an xml output file to disk. You can make a copy of the file and edit this copy to add SPi-V specific features to the scene, such as those offered by scriptlets.

Installation and testing

Part 1

For your convenience, a PTV file is available at
http://fieldofview.nl/spv/cathedral.ptv
This file can be parsed as follows:
http://fieldofview.nl/spv/ptvparser.php?ptv=cathedral.ptv
And finally, loading this into SPi-V gets you here:
http://fieldofview.nl/spv/show.php?file=ptvparser.php?ptv=cathedral.ptv

Start off by just uploading the ptvparser.php script and the cathedral.ptv file to your webserver. Then try something like:
[yourserver]/[yourpath]/ptvparser.php?mov=cathedral.ptv
You should get the same xml file as you got above.

Try the same with a number of ptv files on the server. Just replace the cathedral.ptv part with a relative url to a ptv 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 (ie: no encryption).

If you find files that conform to the above but don't produce a valid XML file, please post a link so it can be investigated.

After parsing a PTV file, you will see an XML file is created in the same directory as the PTV file. In the current version of the PTV parser script, this file is overwritten each time the ptv file is parsed.

Part 2

After you have confirmed the parsing process works, it's time for step two: loading the xml into SPi-V. The ptvparser script not only converts the PTV header info into a SPi-V XML file, it also serves each of the JPEG encoded tiles in the PTV file as seperate JPEG files. In order for this to work we 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 ptvarser 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=ptvparser.php?mov=cathedral.ptv
If this works, try it with a couple of the PTV files on your webserver that you confirmed result in valid XML files. You can use relative paths to the PTV file, eg:
[yourserver]/[yourpath]/show.php?file=ptvparser.php?mov=../[ptvpath]/[pano.ptv]

Instead of feeding the results of the ptvparser 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 PVT file.

History

  • 09 Jan 06 (0.2): no more mod_rewrite on Apache, caching fixes.
  • 05 Jan 06 (0.1): initial public version

Future versions / TODO

  • PTV
    • add initial view, zoom limits to created XML file
  • Server
    • support for other scripting environments (ASP, ...)