Class DisplayWebcamVideo


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

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

    Author:
    aclarke, trebor
    • Constructor Summary

      Constructors 
      Constructor Description
      DisplayWebcamVideo​(java.lang.String driverName, java.lang.String deviceName)
      Construct a DisplayWebcamVideo which reads and plays a video from an attached webcam.
    • 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
    • Constructor Detail

      • DisplayWebcamVideo

        public DisplayWebcamVideo​(java.lang.String driverName,
                                  java.lang.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​(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).