Palantir

a multichannel interactive streaming solution

Frequently asked questions

Why does the video stream look jerky in Mozilla/Netscape?

The video stream from the server should always be embedded in a HTML page (see How can I embed the video stream in my web page?). Pointing the browser directly at it (that is, entering the server's address in the location bar) is very likely to give poor results.

Why does the captured picture look corrupted?

First, try some other video capture application (e.g. xawtv) to make sure that your device is properly working and the correct driver is loaded.
If your video standard is NTSC or SECAM, check that the proper video norm is selected: you need to add

  VideoNorm NTSC
or
  VideoNorm SECAM
to the global section of your configuration file.
Note that the VideoNorm directive was implemented in version 2.4.1 of the server; all previous versions forced the video norm to PAL. If you are running a pre-2.4.1 server, please upgrade (or fix the code in video.c by hand).
Then check that the right video device and channel are selected (-d/-c command line options or VideoDevice/Channel configuration directives).
If you are capturing from the TV tuner, check that it's properly tuned to an existing station (TunerFreq configuration directive).

What should I know about the pwc driver?

When it was maintained by Nemosoft, this driver used to have a closed-source companion driver called pwcx, which enabled support for compressed capture modes. Being distributed in binary-only form due to license issues, it was not included in the Linux kernel source tree, and not all distributions included it in compiled form either.
Luc Saillard, the current maintainer, claims to have reverse-engineered the decompression routines in pwcx, producing a fully open source driver which can support full-size (640x480) capture. Whether and in what form this driver will make its way into future kernel source trees is still under discussion. In the meantime, you can download it from the maintainer's website.

Why does the captured picture look so small?

Are you using the pwc driver? If so, you probably need to insert an additional module called pwcx or upgrade the driver. See here for a discussion of the issues with this driver.

The server dies with "Fatal error: SWIN: No such file or directory". What can I do?

Your camera is most likely using the pwc driver.
In this case, the "No such file or directory" error text is a bit misleading. The correct interpretation is that a capture mode (combination of resolution and frame rate) which requires compression was requested, but the driver does not know how to support it.
See here for a more complete discussion of these issues.

The recommended fix is to upgrade pwc to the latest version.
If you don't feel like upgrading the driver, you can try to lower the capture resolution (use the proper command-line or configuration file option) or the frame rate (which, unfortunately, at the moment requires editing one of the source files; see video.c around line 209).

The server dies with "Cannot open video device /dev/video0: Cannot allocate memory". What can I do?

If you are using the pwc driver, upgrade it.

How can I embed the video stream in my web page?

  <img src="http://SERVER:PORT/" alt="[Live stream]">
where SERVER and PORT are the host name and port of your Palantir server (the default port number is 3000; it can be changed through the -p command line option or the TCPPort configuration directive).

How can I embed the Java client in my web page?

For the applet to work, it must be downloaded from the same server running Palantir. This means that you will have to run a web server in addition to Palantir on that machine.
Also, note that you will have to upload all the *.class files, not only pclient.class. This is the HTML code snippet for embedding the applet:

  <applet codebase="http://SERVER/PATH_TO_JAVA_CLASSES"
     code="pclient.class"
     width="430"
     height="340">
  <param name="port" value="PORT">
  </applet>
You need to supply the
  <param name="port" value="PORT">
line only if your Palantir server is not running on the default port (3000).

Can I use the Java applet as a stand-alone client?

Sure. You need to embed it in a HTML wrapper and load the wrapper in the Java appletviewer.
The Palantir distributions (both source and binary) include a sample wrapper, clients/java/index.html. Edit this file to specify the server and port to connect to, e.g.

  <param name="server" value="palantir.santinoli.com">
  <param name="port" value="14334">
then launch the appletviewer:
  appletviewer index.html

How can I control my QuickCam Sphere/Orbit webcam?

First, make sure the version of the pwc driver in use is at least 8.12. If this is not the case, please upgrade it (you can download the source from the current maintainer's site or find a precompiled package from your favourite distro's repository).
Then, you need to tell the server about the two devices (pan and tilt servos) on the camera, by adding appropriate definitions to your palantir.conf file:

Device {
   Carrier Internal 5
   Direction readwrite
   Name "Pan"
   Hint "Camera pan"
   Range -7000 7000
   Notifier client
   Visual Slider_X
   }

Device {
   Carrier Internal 6
   Direction readwrite
   Name "Tilt"
   Hint "Camera tilt"
   Range -3000 2500
   Notifier client
   Visual Slider_Y
   }
5 and 6 are the addresses of the pan and tilt devices, respectively.
Defining the associated controls as Slider_X and Slider_Y rather than plain Slider causes them to be displayed along the video frame and not on a separated window.

Please refer to the palantir.conf manual page for further details.

How can I grab single frames for archival purposes?

The simpest way is to run curl, either locally (on the server) or on a remote client:

  curl 'http://SERVER:PORT/?mode=single' -s -o snap.jpg
The above line saves a snapshot to the file snap.jpg. (The "-s" option makes curl run in "silent mode", i.e. prevents it from displaying the download progress meter or error messages).
As a more elaborate example, the following shell script takes a snapshot approximately every 5 seconds. Frames are stored as 0.jpg, 1.jpg, 2.jpg etc.
 #!/bin/bash
 # Palantir timed capture script (suitable for FFmpeg)
 n=0
 while true ; do
    curl 'http://SERVER:PORT/?mode=single' -s -o $n.jpg
    n=$(($n+1))
    sleep 5
 done
Alternatively, you can name frames according to the time (HHMMSS) they were captured:
 #!/bin/bash
 while true ; do
    curl 'http://SERVER:PORT/?mode=single' -s -o `date +%H%M%S`.jpg
    sleep 5
 done
With FFmpeg it is trivial to make a MPEG file out of the captured frames. Assuming they were named 0.jpg, 1.jpg etc., the following line creates a movie in which snapshots are played back at a rate of 10 per second:
 ffmpeg -r 10 -i %d.jpg movie.mpg
MPlayer/MEncoder (which rely on the FFmpeg libraries) can be used, too. However, they expect the sequential frame names to be zero-padded, as in 0000.jpg, 0001.jpg, etc.; in order to produce the correct filenames, the above shell script has to be slightly modified:
 #!/bin/bash
 # Palantir timed capture script (suitable for MPlayer/MEncoder)
 n=0
 while true ; do
    curl 'http://SERVER:PORT/?mode=single' -s -o `printf %04d $n`.jpg
    n=$(($n+1))
    sleep 5
 done
The following line creates an MPEG4 movie in which snapshots are played back at a rate of 10 per second:
 mencoder "mf://????.jpg" -mf fps=10 -o movie.mpg -ovc lavc

The following line combines the captured frames into an animated GIF named output.gif. Note that the intended playback speed (in this example, 5 frames per second) has to be specified both as a -mf fps=... and as a gif89a:... parameter:

 mplayer "mf://????.jpg" -mf fps=5 -vo gif89a:5:output.gif

Can I limit the output frame rate?

Unfortunately, at the moment the transmitted frame rate cannot be directly limited.
It is however possible to throttle the outgoing bandwidth originating from Palantir's video port with tools like traffic shapers.
This feature could be added in some next version if there's enough interest.

Why do I get weird errors when compiling the server from source? I'm using Mandrake 9.x/SuSE 9.x.

This is probably a side effect of some recent distributions' support for both video4linux and video4linux2. Until a more elegant solution is found, you might try to disable the videodev2.h file inclusion by amending the file /usr/include/linux/videodev.h. For example, on Mandrake turn the

 #if 1
at line 7 into
 #if 0
and on SuSE, comment or delete lines 7 and 8:
 #define HAVE_V4L2 1
 #include <linux/videodev2.h>
This is unlikely to have side effects on the compilation of other programs (unless - of course - they require the video4linux2 interface).
For safety, you can undo the modifications to videodev.h after compiling Palantir.

Why do I get the error "gsm.h: No such file or directory" when compiling the server from source?

Your source code is obsolete. Starting with Palantir 2.5.1, the source code for the GSM library is included with the Palantir source, and problems related to incomplete installations of the GSM library should be gone forever.


Copyright 2016 Fastpath Research