fromDevice

fun fromDevice(audioDevice: AudioDevice?, deviceName: String = defaultDevice(), mode: PlayMode = PlayMode.VIDEO, frameRate: Double? = null, imageWidth: Int? = null, imageHeight: Int? = null, configuration: VideoPlayerConfiguration = VideoPlayerConfiguration.live(), pixelFormat: String? = null, codec: String? = null): VideoPlayerFFMPEG(source)

Opens a webcam or video device

Return

a ready-to-play video player on success

Parameters

deviceName

a machine-specific device name

mode

which streams should be opened and played

frameRate

optional frame rate (in Hz)

imageWidth

optional image width

imageHeight

optional image height

configuration

optional video player configuration

pixelFormat

optional FFmpeg name of the pixel format of an uncompressed mode, like nv12

codec

optional FFmpeg name of the codec of a compressed mode, like mjpeg. macOS does not select codecs.


fun fromDevice(audioDevice: AudioDevice?, deviceName: String = defaultDevice(), deviceMode: VideoDeviceMode, mode: PlayMode = PlayMode.VIDEO, configuration: VideoPlayerConfiguration = VideoPlayerConfiguration.live()): VideoPlayerFFMPEG(source)

Opens a webcam or video device in deviceMode, a mode from listDeviceModes. The device delivers images of the size and in the pixel format or codec of the mode, at the highest frame rate of the mode.

Return

a ready-to-play video player on success

Parameters

deviceName

a machine-specific device name

mode

which streams should be opened and played

configuration

optional video player configuration