com.xuggle.mediatool.demos
Class DisplayWebcamVideo

Package class diagram package DisplayWebcamVideo
java.lang.Object
  extended by com.xuggle.mediatool.demos.DisplayWebcamVideo

public class DisplayWebcamVideo
extends Object

Using IMediaReader, takes a FFMPEG device driver name (ex: "video4linux2"), and a device name (ex: /dev/video0), and displays video from that device. For example, a web camera.

For example, to play the default camera on these operating systems:


Constructor Summary
DisplayWebcamVideo(String driverName, String deviceName)
          Construct a DisplayWebcamVideo which reads and plays a video from an attached webcam.
 
Method Summary
static void main(String[] args)
          Takes a FFMPEG webcam driver name, and a device name, opens the webcam, and displays its video in a Swing window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisplayWebcamVideo

public DisplayWebcamVideo(String driverName,
                          String deviceName)
Construct a DisplayWebcamVideo which reads and plays a video from an attached webcam.

Parameters:
driverName - the name of the webcan drive
deviceName - the name of the webcan device
Method Detail

main

public static void main(String[] args)
Takes a FFMPEG webcam driver name, and a device name, opens the webcam, and displays its video in a Swing window.

Examples of device formats are:

OS Driver Name Sample Device Name
Windows vfwcap 0
Linux video4linux2 /dev/video0

Webcam support is very limited; you can't query what devices are available, nor can you query what their capabilities are without actually opening the device. Sorry, but that's how FFMPEG rolls.

Parameters:
args - Must contain two strings: a FFMPEG driver name and a device name (which is dependent on the FFMPEG driver).


Copyright © 2008, 2010 Xuggle