Well I may have got ahead of myself, it appears that it has a problem working over the net, I should have read a bit more about some of the issues it has.
But it looks like I have found a way to make it work without having to use a web server to run the applet, so far it seems to work well, I'm in the process of making a GUI to run the server and viewer as well as a one for the remote client, I'll post again as soon as I have something worth while to try.
Edit:
well I have made a pet package for the server, it all seems to run ok, the next step is to create a client GUI, I don't have any real coding experience so would like some help with it from anyone that is interested.
I've never done anything like this before so I will try to explain the best way I can as to how it works.
When I first started with the server that I downloaded I found that it worked ok locally over the lan, but when getting a friend of mine to see if he would test it for me found that there was no image displayed in his browser, the port that the server runs on is port 8888, so asked him to try that, sure enough a static image was displayed in the browser, so seeing that it was sending to the internet I made a script to run the java applet and edited it for my web address and sent it and a copy of the applet to him, he ran it and what do you know it worked.
So there is no need to run a webserver to serve the java applet, one less thing to worry about, a applet run at the receiving end is all that's needed and it can still be viewed in a web browser as a static image which you can refresh to update and save the image to file.
I've finish the server and Gui to the best of my ability, I'll upload it for testing purposes if any one could give me some feedback on the scripting it would be appreciated, I'll post the code to see if I've made any mistakes.
This is the main GUI ..
Code: Select all
#!/bin/sh
DLG1="
<wtitle>WCS</wtitle>
<vbox>
<pixmap>
<input file>camera-web48.png</input>
</pixmap>
<text><label>WebCam Server</label></text>
<frame --------Controls-------->
<hbox>
<text><label>Start Server</label></text>
<vbox>
<button>
<input file>camera-web-start.png</input>
<action>webcam_start &</action>
</button>
</vbox>
</hbox>
<hbox>
<text><label>Stop Server</label></text>
<vbox>
<button>
<input file>camera-web-stop.png</input>
<action>webcam_stop &</action>
</button>
</vbox>
</hbox>
<hbox>
<text><label>Start Viewer</label></text>
<vbox>
<button>
<input file>viewer.png</input>
<action>/usr/share/webcam/webcam-viewer &</action>
</button>
</vbox>
</hbox>
<hbox>
<text><label>Stop Viewer</label></text>
<vbox>
<button>
<input file>viewer-stop.png</input>
<action>/usr/share/webcam/webcam-viewer-stop &</action>
</button>
</vbox>
</hbox>
</frame>
<button cancel></button>
</vbox>
"
echo "$DLG1" | gtkdialog2 --stdin
###END###
This is the script to run the viewer, it creates a pid file so that there can only be one instance of it running..
Code: Select all
#!/bin/bash -
#function only one instance
cd /usr/share/webcam
kill `cat app_pid.pid`
rm app_pid.pid
java -classpath applet.jar WebCam localhost 8888 pidfile=app_pid.pid <&- &
pid=$!
echo ${pid} > app_pid.pid
</applet.jar>
This kills the applet..
Code: Select all
#!/bin/bash -
cd /usr/share/webcam
kill `cat app_pid.pid`
rm app_pid.pid
This runs the server..
Code: Select all
#!/bin/bash -
export LD_LIBRARY_PATH=/usr/lib
export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so;
webcam-server
And this stops the server..
Code: Select all
#!/bin/bash -
#stop webcam-server
killall webcam-server
To make a working client without a gui this script needs to be edited, the other files can be copied from the server files.
the files are..
error.jpg
init.jpg
applet.jar
just place the script and the three files together in a folder.
Code: Select all
#!/bin/bash -
#client
#replace ADDRESS with servers ip
#
java -classpath applet.jar WebCam ADDRESS 8888