Class DisplayWebcamVideo


  • public class DisplayWebcamVideo
    extends java.lang.Object
    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:

    • Microsoft Windows:
      java -cp %XUGGLE_HOME%\share\java\jars\avpkit-core.jar com.avpkit.core.demos.DisplayWebcamVideo vfwcap 0
    • Linux:
      java -cp $XUGGLE_HOME/share/java/jars/avpkit-core.jar com.avpkit.core.demos.DisplayWebcamVideo video4linux2 /dev/video0

    Author:
    aclarke
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.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
    • Method Detail

      • main

        public static void main​(java.lang.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).