Skip to main content

New webcam module

18 replies [Last post]
nsimpson
Offline
Joined: 2004-06-03

In Wonderland, 0.4 Erik Reitsma at Ericsson enhanced the Wonderland webcam application by replacing the problematic JMF library with a pure Java M-JPEG decoding library called Cambozola:

http://www.charliemouse.com:8080/code/cambozola/

This allowed him to connect the webcam viewer to any M-JPEG source, not just the models of Axis webcams supported by JMF. With this approach, he was able to stream video into Wonderland using VLC. He wrote an interesting blog article about this:

http://blogs.sun.com/wonderland/entry/video_in_wonderland_using_mjpeg

Thanks to a generous donation of code by Jan van der Meer of Ericsson Telecommunicatie NL, I've been able to port Erik's code to 0.5.

The 0.5 webcam viewer application is now available as a stable module. If you have the stable modules checked out, do an svn update to get the webcamviewer module.

By default the webcam should show live video of a (rainy) construction site at Muhlenberg College. You can find a worldwide directory of webcams at http://camelive.info. Look for webcams tagged with "Axis/Live view". Click on the image and get the IP address of the camera. The URI you enter into the webcam view should have the following format:

http://xxx.xxx.xxx.xxx/axis-cgi/mjpg/video.cgi?camera=&resolution=640x480

Unfortunately, one thing that seems to be a universal constant for people setting up webcams is to point them at static, never changing scenes! So, you'll have to hunt to find dynamic content. One webcam I like is a fish cam in Japan:

http://210.236.173.198/axis-cgi/mjpg/video.cgi?camera=&resolution=640x480

Unfortunately, they keep moving the camera, so if you see a gray, grainy image, you'll have to take a look later. It's neat when it's pointed at the tank though.

Known limitations:

1. M-JPEG is a loosely interpreted "standard". This means that not all M-JPEG sources are compatible with the M-JPEG decoder in the Cambozola library. In practice, it's most compatible with Axis webcams. It's possible that Cambozola could be enhanced to support different sources, and I'd encourage the community to explore this.

2. Although you can stream recorded movies using VLC, the webcam viewer does not support audio. So, this is not suitable as a movie player. A movie player is planned for 0.5 (the videoplayer module on wonderland-modules is not currently functional.)

3. The app is designed to adjust to fit the size of the source video stream, but this feature is currently disabled. When specifying a video URI, request 640x480 resolution. For Axis camera sources, append "&resolution=640x480" to the URI.

4. It does not support pan/tilt/zoom capable cameras. You can still use the video feed, but the app doesn't provide PTZ controls. I'm trying to assess how important this feature is. Let me know if you have a compelling use case.

5. It doesn't currently support password protected cameras.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
shawnkendall
Offline
Joined: 2003-06-10

I'm assuming this is p2p, or does the server in fact multiplex this to all WL participants?

kaon07
Offline
Joined: 2009-11-12

Today during my testing, I found that if the wonderland is deployed and run on Linux server using VMware, this webcam module can not work for those clients from windows OS. It can not load the valid camera streaming.

Details setup as such: wonder 0.5 is running on Ubuntu 9.10 using VMvare player 3 under windows XP. The network is using bridge setting.
Another windows XP machine has connected to a logitech webcam and installed VLC windows version for streaming the webcam to internet.

The webcam stream URL is proved working and accessible from other XP machines (3rd, 4th...) since browser can open the URL. However, when launch the wonder land client at those machines, the webcam module can not load the stream URL. Nothing is displayed. The same URL only works on streaming machine.

By running the wonderland server on another Linux box (Not using VMware), the same streaming URL works on all XP machines.

jimohesq
Offline
Joined: 2010-03-27

Hi, please can any one show or send me a java code that helps you view your own laptop webcam?

I would really appreciate it, thanks.

NB: I am not trying to view a webcam across a network, i just want a java app that can help me view my own webcam on my laptop.

Thanks in advance

nicoley
Offline
Joined: 2007-02-12

This forum is no longer active. Please re-post your question on the Open Wonderland forum:

http://groups.google.com/group/openwonderland

Thanks,
Nicole.

pl1
Offline
Joined: 2009-02-10

Great . I have some Windows XP Wonderland 0.5 Clients and a Jaunty Wonderland 0.5 Server.
Could you please point me to instructions for compiling, installing and using Webcamviewer module on the server ant getting the proper software to the client through JavaWS?

nicoley
Offline
Joined: 2007-02-12

Nigel will have to answer your question if you're interested in experimenting with the source code, but if you just want to install the module on your server, here's what to do:

* Find the webcamviewer.jar on the wonderland-modules site here:
https://wonderland-modules.dev.java.net/servlets/ProjectDocumentList?fol...

* Save the jar file on your computer

* Navigate to the Wonderland Launch web page and click on "Server Admin"

* Navigate to the "Manage Modules" page and scroll to the bottom of the page

* Upload the jar file using the buttons in the Install a New Module section

* Navigate to the "Manage Server" page and restart the Darkstar server

* Launch Wonderland and you should see the Webcam application is now listed in the Components dialog (Insert --> Components...)

Hope that helps,
Nicole.

derekreilly
Offline
Joined: 2007-07-18

Hi,

first off -- fantastic -- we've tried streaming M-JPEG via an app server with less-than-stellar results, so will definitely be trying this. Thanks for contributing the module.

second, I'd like to put my vote in for #4 -- PZT is critical for us. Is the API for these controls standard across cams that support them?

Derek

nsimpson
Offline
Joined: 2004-06-03

> second, I'd like to put my vote in for #4 -- PZT is critical for us. Is the API for these controls
> standard across cams that support them?

Unfortunately, there's no standard for PTZ controls across vendors. It should be straightforward to allow users to specify the PTZ commands in a configuration dialog. We supported Axis cameras in 0.4, so we can pre-configure the PTZ commands for Axis cameras. What brand of PTZ cameras are you using?

Can you tell me a little more about how you're using PTZ?

Nigel

derekreilly
Offline
Joined: 2007-07-18

Hi, thanks for the info -- we have a Panasonic BL-C30, it's a pan+tilt camera.

We'd like to add controls in-world for this camera and control pan+tilt programmatically from within WL, for cross-reality communication.

Derek

nsimpson
Offline
Joined: 2004-06-03

Panasonic cameras like this one have a web interface for controlling the camera, just like Axis cameras, so it seems likely that the pan and tilt functions would be controllable over a network connection. What we need to know are the HTTP requests that control panning and tilting. If we have those, then we should be able to control them from the webcam app. I'd need access to a Panasonic camera to figure this out, however.

Nigel

nsimpson
Offline
Joined: 2004-06-03

By the way, the webcam viewer works webcams other than Axis cameras with webcamXP (http://www.webcamxp.com), a webcam streaming application for Windows. I was able to hook up a Logitech Quickcam for Notebooks Pro webcam and broadcast it using webcamXP. The webcamXP application exports an MJPEG stream via the following URL:

http://xxx.xxx.xxx.xxx:8080/cam_1.cgi

When configuring webcamXP, be sure to select 640x480: right click the video preview window in webcamXP and select Video Format > 640x480.

I suspect other Windows compatible webcams would also work with webcamXP as a streaming server.

Nigel

matty_x
Offline
Joined: 2008-06-16

I'm trying to get the iSight on my Mac to stream to the webcamviewer module. Not even sure if this is possible, but thought I'd give it a crack.

I've tried a few different things. I went with QuickTime Broadcaster and tried to route the rtsp stream through VLC and transcode it into MJPEG over HTTP. Didn't have any luck.

Then I upgraded VLC to the latest binary (1.0.3 I think), which can open the iSight from File-->Open Capture Device.

Now I'm trying to get the streaming options set correctly so that I can connect to the stream using the webcamviewer and I'm not having any luck. I can only get output in 160x120, and I'm not really clear on what the options should be for setting up the stream.

Here's a quick and dirty breakdown of the settings I've been playing with:

Input: qtcapture://
Streaming method: HTTP
Destination: my.IP.address
Transcode video (yes): Codec: MJPEG; Bitrate: 16
Encapsulation format: I've tried ASF with no luck. The other options are MPEG TS, MPEG1, and OGG
Additional options: defaults

Any help is much appreciated!

nsimpson
Offline
Joined: 2004-06-03

VLC streaming parameters are tricky. Have you tried using the parameters in the following blog article about the 0.4 video player? Erik used the same decoding library as we use in the 0.5 webcam, so the parameters he used might work:

http://blogs.sun.com/wonderland/entry/video_in_wonderland_using_mjpeg

Good luck!

matty_x
Offline
Joined: 2008-06-16

> VLC streaming parameters are tricky.

You can say that again!

I did use Erik's parameters from the Wonderblog. Didn't have any luck until I stopped trying to muck about with streaming a video and just tried to go with the iSight feed. I just got it working this morning.

So here's a Mac-only solution for streaming your iSight camera on a MacBook or MacBook Pro (haven't tested on anything else) through the webcamviewer module into WL:

1. Install the webcamviewer module as per Nicole's instructions in her post below
2. Install VLC 1.0 or later (http://www.videolan.org/vlc/)
3. Open a terminal and execute the following command:

/Applications/VLC.app/Contents/MacOS/VLC qtcapture:// --no-sout-audio --sout='#transcode{vcodec=mjpg,vb=512,fps=12,width=640,height=480}:standard{access=http,mux=mpjpeg,dst=:8050/abc.mjpg}' --input-repeat=10000

4. Launch a Wonderland client and add the webcamviewer module to your world (Insert - Object - Webcam Viewer)

5. Right-click and select "Take control" from the context menu

6. Select the folder icon (2nd from left). The "Connect to webcam" dialog is presented.

7. Enter the following and then select "OK":

http://localhost:8050/abc.mjpg

[b]Note[/b]: If "localhost doesn't work, use your computer's IP address instead

8. You should be presented with a feed from your webcam in Wonderland

matty_x
Offline
Joined: 2008-06-16

P.S. - here's a YouTube video of it:

http://www.youtube.com/watch?v=0IVC57gaD8s

jslott
Offline
Joined: 2006-01-05

Way cool!!!!! Sounds like an excellent blog entry :-)

micheldenis
Offline
Joined: 2007-12-10

Fine .. great job!

A question: how will we support "mixed-reality" situations with WL 0.5, as:
- this webcam module does not support audio
- video player does not support (?) live feed but only off-line tapes

michel

nsimpson
Offline
Joined: 2004-06-03

I think there are several solutions for providing audio:

1. Run the wonderland client on a system next to the webcam
2. Run a softphone or SIP phone and call it from an in-world phone
3. Run an audio streaming server at the webcam location and add the audio capability to the webcam application :)

So, #1 would be simplest and this is how we've demonstrated mixed reality use cases in Wonderland before. Many mixed reality use cases usually require a 2-way communication, so the people in the real world with the webcam need a way to see and communicate with people in the virtual world. I suspect Joe might have some ideas about how to do #2. And for #3, that would require an audio streaming application supported by the voice bridge.

Nigel