Package org.bytedeco.copiedstuff
Class FFmpegFrameGrabber
java.lang.Object
org.bytedeco.copiedstuff.FrameGrabber
org.bytedeco.copiedstuff.FFmpegFrameGrabber
- All Implemented Interfaces:
Closeable
,AutoCloseable
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bytedeco.copiedstuff.FrameGrabber
FrameGrabber.Array, FrameGrabber.Exception, FrameGrabber.ImageMode, FrameGrabber.PropertyEditor
-
Field Summary
Fields inherited from class org.bytedeco.copiedstuff.FrameGrabber
aspectRatio, audioBitrate, audioChannels, audioCodec, audioMetadata, audioOptions, audioStream, bpp, deinterlace, format, frameNumber, frameRate, gamma, imageHeight, imageMode, imageWidth, list, metadata, numBuffers, options, pixelFormat, sampleFormat, sampleRate, SENSOR_PATTERN_BGGR, SENSOR_PATTERN_GBRG, SENSOR_PATTERN_GRBG, SENSOR_PATTERN_RGGB, sensorPattern, timeout, timestamp, triggerMode, videoBitrate, videoCodec, videoMetadata, videoOptions, videoStream
-
Constructor Summary
ConstructorDescriptionFFmpegFrameGrabber
(File file) FFmpegFrameGrabber
(InputStream inputStream) FFmpegFrameGrabber
(String filename) -
Method Summary
Modifier and TypeMethodDescriptionstatic FFmpegFrameGrabber
createDefault
(int deviceNumber) static FFmpegFrameGrabber
createDefault
(File deviceFile) static FFmpegFrameGrabber
createDefault
(String devicePath) protected void
finalize()
double
int
int
int
getAudioMetadata
(String key) static String[]
org.bytedeco.javacpp.avformat.AVFormatContext
double
double
getGamma()
int
int
int
long
getMetadata
(String key) int
int
int
int
int
getVideoMetadata
(String key) grab()
Each call to grab stores the new image in the memory address for the previously returned frame.grabFrame
(boolean doAudio, boolean doVideo, boolean processImage, boolean keyFrames) org.bytedeco.javacpp.avcodec.AVPacket
void
release()
void
setFrameNumber
(int frameNumber) void
setTimestamp
(long timestamp) void
start()
void
stop()
void
trigger()
static void
tryLoad()
Methods inherited from class org.bytedeco.copiedstuff.FrameGrabber
close, create, create, create, create, createArray, delayedGrab, flush, get, getAudioOption, getAudioStream, getBitsPerPixel, getDefault, getDelayedFrame, getDelayedTime, getFrameNumber, getImageMode, getMetadata, getNumBuffers, getOption, getSensorPattern, getTimeout, getTimestamp, getVideoOption, getVideoStream, grabFrame, init, isDeinterlace, isTriggerMode, restart, setAspectRatio, setAudioBitrate, setAudioChannels, setAudioCodec, setAudioMetadata, setAudioOption, setAudioStream, setBitsPerPixel, setDeinterlace, setFormat, setFrameRate, setGamma, setImageHeight, setImageMode, setImageWidth, setMetadata, setNumBuffers, setOption, setPixelFormat, setSampleFormat, setSampleRate, setSensorPattern, setTimeout, setTriggerMode, setVideoBitrate, setVideoCodec, setVideoMetadata, setVideoOption, setVideoStream
-
Constructor Details
-
FFmpegFrameGrabber
-
FFmpegFrameGrabber
-
FFmpegFrameGrabber
-
-
Method Details
-
getDeviceDescriptions
- Throws:
FrameGrabber.Exception
-
createDefault
- Throws:
FrameGrabber.Exception
-
createDefault
- Throws:
FrameGrabber.Exception
-
createDefault
- Throws:
FrameGrabber.Exception
-
tryLoad
- Throws:
FrameGrabber.Exception
-
release
- Specified by:
release
in classFrameGrabber
- Throws:
FrameGrabber.Exception
-
finalize
-
getGamma
public double getGamma()- Overrides:
getGamma
in classFrameGrabber
-
getFormat
- Overrides:
getFormat
in classFrameGrabber
-
getImageWidth
public int getImageWidth()- Overrides:
getImageWidth
in classFrameGrabber
-
getImageHeight
public int getImageHeight()- Overrides:
getImageHeight
in classFrameGrabber
-
getAudioChannels
public int getAudioChannels()- Overrides:
getAudioChannels
in classFrameGrabber
-
getPixelFormat
public int getPixelFormat()- Overrides:
getPixelFormat
in classFrameGrabber
-
getVideoCodec
public int getVideoCodec()- Overrides:
getVideoCodec
in classFrameGrabber
-
getVideoBitrate
public int getVideoBitrate()- Overrides:
getVideoBitrate
in classFrameGrabber
-
getAspectRatio
public double getAspectRatio()- Overrides:
getAspectRatio
in classFrameGrabber
-
getFrameRate
public double getFrameRate()- Overrides:
getFrameRate
in classFrameGrabber
-
getAudioCodec
public int getAudioCodec()- Overrides:
getAudioCodec
in classFrameGrabber
-
getAudioBitrate
public int getAudioBitrate()- Overrides:
getAudioBitrate
in classFrameGrabber
-
getSampleFormat
public int getSampleFormat()- Overrides:
getSampleFormat
in classFrameGrabber
-
getSampleRate
public int getSampleRate()- Overrides:
getSampleRate
in classFrameGrabber
-
getMetadata
- Overrides:
getMetadata
in classFrameGrabber
-
getVideoMetadata
- Overrides:
getVideoMetadata
in classFrameGrabber
-
getAudioMetadata
- Overrides:
getAudioMetadata
in classFrameGrabber
-
setFrameNumber
- Overrides:
setFrameNumber
in classFrameGrabber
- Throws:
FrameGrabber.Exception
-
setTimestamp
- Overrides:
setTimestamp
in classFrameGrabber
- Throws:
FrameGrabber.Exception
-
getLengthInFrames
public int getLengthInFrames()- Overrides:
getLengthInFrames
in classFrameGrabber
-
getLengthInTime
public long getLengthInTime()- Overrides:
getLengthInTime
in classFrameGrabber
-
getFormatContext
public org.bytedeco.javacpp.avformat.AVFormatContext getFormatContext() -
start
- Specified by:
start
in classFrameGrabber
- Throws:
FrameGrabber.Exception
-
stop
- Specified by:
stop
in classFrameGrabber
- Throws:
FrameGrabber.Exception
-
trigger
- Specified by:
trigger
in classFrameGrabber
- Throws:
FrameGrabber.Exception
-
grab
Description copied from class:FrameGrabber
Each call to grab stores the new image in the memory address for the previously returned frame.
IE.
grabber.grab() == grabber.grab()
This means that if you need to cache images returned from grab you shouldFrame.clone()
the returned frame as the next call to grab will overwrite your existing image's memory.
Why?
Using this method instead of allocating a new buffer every time a frame is grabbed improves performance by reducing the frequency of garbage collections. Almost no additional heap space is typically allocated per frame.- Specified by:
grab
in classFrameGrabber
- Returns:
- The frame returned from the grabber
- Throws:
FrameGrabber.Exception
- If there is a problem grabbing the frame.
-
grabImage
- Throws:
FrameGrabber.Exception
-
grabSamples
- Throws:
FrameGrabber.Exception
-
grabKeyFrame
- Throws:
FrameGrabber.Exception
-
grabFrame
public Frame grabFrame(boolean doAudio, boolean doVideo, boolean processImage, boolean keyFrames) throws FrameGrabber.Exception - Throws:
FrameGrabber.Exception
-
grabPacket
- Throws:
FrameGrabber.Exception
-