public class IPCameraFrameGrabber extends FrameGrabber
FrameGrabber.Array, FrameGrabber.Exception, FrameGrabber.ImageMode, FrameGrabber.PropertyEditor, FrameGrabber.SampleMode
aspectRatio, audioBitrate, audioChannels, audioCodec, audioCodecName, audioDisposition, audioMetadata, audioOptions, audioSideData, audioStream, bpp, charset, deinterlace, format, frameNumber, frameRate, gamma, imageHeight, imageMode, imageScalingFlags, imageWidth, list, maxDelay, metadata, numBuffers, options, pixelFormat, sampleFormat, sampleMode, sampleRate, SENSOR_PATTERN_BGGR, SENSOR_PATTERN_GBRG, SENSOR_PATTERN_GRBG, SENSOR_PATTERN_RGGB, sensorPattern, startTime, timeout, timestamp, triggerMode, videoBitrate, videoCodec, videoCodecName, videoDisposition, videoMetadata, videoOptions, videoSideData, videoStream
Constructor and Description |
---|
IPCameraFrameGrabber(String urlstr)
Deprecated.
By not setting the connection timeout and the read timeout if your network ever crashes
then
start() or grab() can hang for upwards of 45 to 60 seconds before failing.
You should always explicitly set the connectionTimeout and readTimeout so that your application can
respond appropriately to a loss or failure to connect. |
IPCameraFrameGrabber(String urlstr,
int connectionTimeout,
int readTimeout,
TimeUnit timeUnit) |
IPCameraFrameGrabber(URL url,
int startTimeout,
int grabTimeout,
TimeUnit timeUnit) |
Modifier and Type | Method and Description |
---|---|
Frame |
grab()
Each call to grab stores the new image in the memory address for the previously returned frame.
|
BufferedImage |
grabBufferedImage() |
void |
release() |
void |
start() |
void |
stop() |
void |
trigger() |
static void |
tryLoad() |
close, create, create, create, create, createArray, createDefault, createDefault, createDefault, delayedGrab, flush, get, getAspectRatio, getAudioBitrate, getAudioChannels, getAudioCodec, getAudioCodecName, getAudioDisposition, getAudioMetadata, getAudioMetadata, getAudioOption, getAudioOptions, getAudioSideData, getAudioSideData, getAudioStream, getBitsPerPixel, getCharset, getDefault, getDelayedFrame, getDelayedTime, getFormat, getFrameNumber, getFrameRate, getGamma, getImageHeight, getImageMode, getImageScalingFlags, getImageWidth, getLengthInFrames, getLengthInTime, getMaxDelay, getMetadata, getMetadata, getNumBuffers, getOption, getOptions, getPixelFormat, getSampleFormat, getSampleMode, getSampleRate, getSensorPattern, getTimeout, getTimestamp, getVideoBitrate, getVideoCodec, getVideoCodecName, getVideoDisposition, getVideoMetadata, getVideoMetadata, getVideoOption, getVideoOptions, getVideoSideData, getVideoSideData, getVideoStream, grabAtFrameRate, grabFrame, init, isDeinterlace, isTriggerMode, resetStartTime, restart, setAspectRatio, setAudioBitrate, setAudioChannels, setAudioCodec, setAudioCodecName, setAudioDisposition, setAudioMetadata, setAudioMetadata, setAudioOption, setAudioOptions, setAudioSideData, setAudioSideData, setAudioStream, setBitsPerPixel, setCharset, setDeinterlace, setFormat, setFrameNumber, setFrameRate, setGamma, setImageHeight, setImageMode, setImageScalingFlags, setImageWidth, setMaxDelay, setMetadata, setMetadata, setNumBuffers, setOption, setOptions, setPixelFormat, setSampleFormat, setSampleMode, setSampleRate, setSensorPattern, setTimeout, setTimestamp, setTriggerMode, setVideoBitrate, setVideoCodec, setVideoCodecName, setVideoDisposition, setVideoMetadata, setVideoMetadata, setVideoOption, setVideoOptions, setVideoSideData, setVideoSideData, setVideoStream, waitForTimestamp
public IPCameraFrameGrabber(URL url, int startTimeout, int grabTimeout, TimeUnit timeUnit)
url
- The URL to create the camera connection with.startTimeout
- How long should this wait on the connection while trying to start()
before
timing out.
If this value is less than zero it will be ignored.
URLConnection.setConnectTimeout(int)
grabTimeout
- How long should grab wait while reading the connection before timing out.
If this value is less than zero it will be ignored.
URLConnection.setReadTimeout(int)
timeUnit
- The time unit to use for the connection and read timeout.
If this value is null then the start timeout and grab timeout will be ignored.public IPCameraFrameGrabber(String urlstr, int connectionTimeout, int readTimeout, TimeUnit timeUnit) throws MalformedURLException
MalformedURLException
@Deprecated public IPCameraFrameGrabber(String urlstr) throws MalformedURLException
start()
or grab()
can hang for upwards of 45 to 60 seconds before failing.
You should always explicitly set the connectionTimeout and readTimeout so that your application can
respond appropriately to a loss or failure to connect.urlstr
- A string to be used to create the URL.MalformedURLException
- if the urlstr is a malformed URLpublic static void tryLoad() throws FrameGrabber.Exception
FrameGrabber.Exception
public void start() throws FrameGrabber.Exception
start
in class FrameGrabber
FrameGrabber.Exception
public void stop() throws FrameGrabber.Exception
stop
in class FrameGrabber
FrameGrabber.Exception
public void trigger() throws FrameGrabber.Exception
trigger
in class FrameGrabber
FrameGrabber.Exception
public Frame grab() throws FrameGrabber.Exception
FrameGrabber
grabber.grab() == grabber.grab()
Frame.clone()
the
returned frame as the next call to grab will overwrite your existing image's memory.
grab
in class FrameGrabber
FrameGrabber.Exception
public BufferedImage grabBufferedImage() throws IOException
IOException
public void release() throws FrameGrabber.Exception
release
in class FrameGrabber
FrameGrabber.Exception
Copyright © 2022. All rights reserved.