public class FFmpegFrameGrabber extends FrameGrabber
FrameGrabber.Array, FrameGrabber.Exception, FrameGrabber.ImageMode, FrameGrabber.PropertyEditor, FrameGrabber.SampleModeaspectRatio, audioBitrate, audioChannels, audioCodec, audioCodecName, audioMetadata, audioOptions, audioStream, bpp, 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, timeout, timestamp, triggerMode, videoBitrate, videoCodec, videoCodecName, videoMetadata, videoOptions, videoStream| Constructor and Description |
|---|
FFmpegFrameGrabber(File file) |
FFmpegFrameGrabber(InputStream inputStream)
Calls
FFmpegFrameGrabber(inputStream, Integer.MAX_VALUE - 8)
so that the whole input stream is seekable. |
FFmpegFrameGrabber(InputStream inputStream,
int maximumSize) |
FFmpegFrameGrabber(String filename) |
| Modifier and Type | Method and Description |
|---|---|
static FFmpegFrameGrabber |
createDefault(File deviceFile) |
static FFmpegFrameGrabber |
createDefault(int deviceNumber) |
static FFmpegFrameGrabber |
createDefault(String devicePath) |
protected void |
finalize() |
double |
getAspectRatio() |
int |
getAudioBitrate() |
int |
getAudioChannels() |
int |
getAudioCodec() |
double |
getAudioFrameRate()
Estimation of audio frames per second
|
Map<String,String> |
getAudioMetadata() |
String |
getAudioMetadata(String key) |
static String[] |
getDeviceDescriptions() |
String |
getFormat() |
AVFormatContext |
getFormatContext() |
double |
getFrameRate()
Returns
getVideoFrameRate() |
double |
getGamma() |
int |
getImageHeight() |
int |
getImageWidth() |
int |
getLengthInAudioFrames() |
int |
getLengthInFrames()
Returns
getLengthInVideoFrames() |
long |
getLengthInTime() |
int |
getLengthInVideoFrames()
Returns
(int) Math.round(getLengthInTime() * getFrameRate() / 1000000L), which is an approximation in general. |
Map<String,String> |
getMetadata() |
String |
getMetadata(String key) |
int |
getPixelFormat() |
int |
getSampleFormat() |
int |
getSampleRate() |
int |
getVideoBitrate() |
int |
getVideoCodec() |
double |
getVideoFrameRate() |
Map<String,String> |
getVideoMetadata() |
String |
getVideoMetadata(String key) |
Frame |
grab()
Each call to grab stores the new image in the memory address for the previously returned frame.
|
Frame |
grabFrame(boolean doAudio,
boolean doVideo,
boolean doProcessing,
boolean keyFrames) |
Frame |
grabImage() |
Frame |
grabKeyFrame() |
AVPacket |
grabPacket() |
Frame |
grabSamples() |
boolean |
hasAudio()
Is there an audio stream?
|
boolean |
hasVideo()
Is there a video stream?
|
boolean |
isCloseInputStream() |
void |
release() |
void |
releaseUnsafe() |
void |
setAudioFrameNumber(int frameNumber)
if there is audio stream tries to seek to audio frame with corresponding timestamp
ignoring otherwise
|
void |
setAudioTimestamp(long timestamp)
setTimestamp with resulting audio frame type if there is an audio stream
|
void |
setCloseInputStream(boolean closeInputStream) |
void |
setFrameNumber(int frameNumber)
default override of super.setFrameNumber implies setting
of a frame close to a video frame having that number
|
void |
setTimestamp(long timestamp)
setTimestamp without checking frame content (using old code used in JavaCV versions prior to 1.4.1)
|
void |
setTimestamp(long timestamp,
boolean checkFrame)
setTimestamp with possibility to select between old quick seek code or new code
doing check of frame content.
|
void |
setVideoFrameNumber(int frameNumber)
if there is video stream tries to seek to video frame with corresponding timestamp
otherwise sets super.frameNumber only because frameRate==0 if there is no video stream
|
void |
setVideoTimestamp(long timestamp)
setTimestamp with resulting video frame type if there is a video stream
|
void |
start() |
void |
startUnsafe() |
void |
stop() |
void |
trigger() |
static void |
tryLoad() |
close, create, create, create, create, createArray, delayedGrab, flush, get, getAudioCodecName, getAudioOption, getAudioOptions, getAudioStream, getBitsPerPixel, getDefault, getDelayedFrame, getDelayedTime, getFrameNumber, getImageMode, getImageScalingFlags, getMaxDelay, getNumBuffers, getOption, getOptions, getSampleMode, getSensorPattern, getTimeout, getTimestamp, getVideoCodecName, getVideoOption, getVideoOptions, getVideoStream, grabFrame, init, isDeinterlace, isTriggerMode, restart, setAspectRatio, setAudioBitrate, setAudioChannels, setAudioCodec, setAudioCodecName, setAudioMetadata, setAudioMetadata, setAudioOption, setAudioOptions, setAudioStream, setBitsPerPixel, setDeinterlace, setFormat, setFrameRate, setGamma, setImageHeight, setImageMode, setImageScalingFlags, setImageWidth, setMaxDelay, setMetadata, setMetadata, setNumBuffers, setOption, setOptions, setPixelFormat, setSampleFormat, setSampleMode, setSampleRate, setSensorPattern, setTimeout, setTriggerMode, setVideoBitrate, setVideoCodec, setVideoCodecName, setVideoMetadata, setVideoMetadata, setVideoOption, setVideoOptions, setVideoStreampublic FFmpegFrameGrabber(File file)
public FFmpegFrameGrabber(String filename)
public FFmpegFrameGrabber(InputStream inputStream)
FFmpegFrameGrabber(inputStream, Integer.MAX_VALUE - 8)
so that the whole input stream is seekable.public FFmpegFrameGrabber(InputStream inputStream, int maximumSize)
public static String[] getDeviceDescriptions() throws FrameGrabber.Exception
FrameGrabber.Exceptionpublic static FFmpegFrameGrabber createDefault(File deviceFile) throws FrameGrabber.Exception
FrameGrabber.Exceptionpublic static FFmpegFrameGrabber createDefault(String devicePath) throws FrameGrabber.Exception
FrameGrabber.Exceptionpublic static FFmpegFrameGrabber createDefault(int deviceNumber) throws FrameGrabber.Exception
FrameGrabber.Exceptionpublic static void tryLoad()
throws FrameGrabber.Exception
FrameGrabber.Exceptionpublic void release()
throws FrameGrabber.Exception
release in class FrameGrabberFrameGrabber.Exceptionpublic void releaseUnsafe()
throws FrameGrabber.Exception
FrameGrabber.Exceptionprotected void finalize()
throws Throwable
public boolean isCloseInputStream()
public void setCloseInputStream(boolean closeInputStream)
public boolean hasVideo()
video_st!=null;public boolean hasAudio()
audio_st!=null;public double getGamma()
getGamma in class FrameGrabberpublic String getFormat()
getFormat in class FrameGrabberpublic int getImageWidth()
getImageWidth in class FrameGrabberpublic int getImageHeight()
getImageHeight in class FrameGrabberpublic int getAudioChannels()
getAudioChannels in class FrameGrabberpublic int getPixelFormat()
getPixelFormat in class FrameGrabberpublic int getVideoCodec()
getVideoCodec in class FrameGrabberpublic int getVideoBitrate()
getVideoBitrate in class FrameGrabberpublic double getAspectRatio()
getAspectRatio in class FrameGrabberpublic double getFrameRate()
getVideoFrameRate()getFrameRate in class FrameGrabberpublic double getAudioFrameRate()
public double getVideoFrameRate()
public int getAudioCodec()
getAudioCodec in class FrameGrabberpublic int getAudioBitrate()
getAudioBitrate in class FrameGrabberpublic int getSampleFormat()
getSampleFormat in class FrameGrabberpublic int getSampleRate()
getSampleRate in class FrameGrabberpublic Map<String,String> getMetadata()
getMetadata in class FrameGrabberpublic Map<String,String> getVideoMetadata()
getVideoMetadata in class FrameGrabberpublic Map<String,String> getAudioMetadata()
getAudioMetadata in class FrameGrabberpublic String getMetadata(String key)
getMetadata in class FrameGrabberpublic String getVideoMetadata(String key)
getVideoMetadata in class FrameGrabberpublic String getAudioMetadata(String key)
getAudioMetadata in class FrameGrabberpublic void setFrameNumber(int frameNumber)
throws FrameGrabber.Exception
setFrameNumber in class FrameGrabberFrameGrabber.Exceptionpublic void setVideoFrameNumber(int frameNumber)
throws FrameGrabber.Exception
FrameGrabber.Exceptionpublic void setAudioFrameNumber(int frameNumber)
throws FrameGrabber.Exception
FrameGrabber.Exceptionpublic void setTimestamp(long timestamp)
throws FrameGrabber.Exception
setTimestamp in class FrameGrabberFrameGrabber.Exceptionpublic void setTimestamp(long timestamp,
boolean checkFrame)
throws FrameGrabber.Exception
FrameGrabber.Exceptionpublic void setVideoTimestamp(long timestamp)
throws FrameGrabber.Exception
FrameGrabber.Exceptionpublic void setAudioTimestamp(long timestamp)
throws FrameGrabber.Exception
FrameGrabber.Exceptionpublic int getLengthInFrames()
getLengthInVideoFrames()getLengthInFrames in class FrameGrabberpublic long getLengthInTime()
getLengthInTime in class FrameGrabberpublic int getLengthInVideoFrames()
(int) Math.round(getLengthInTime() * getFrameRate() / 1000000L), which is an approximation in general.public int getLengthInAudioFrames()
public AVFormatContext getFormatContext()
public void start()
throws FrameGrabber.Exception
start in class FrameGrabberFrameGrabber.Exceptionpublic void startUnsafe()
throws FrameGrabber.Exception
FrameGrabber.Exceptionpublic void stop()
throws FrameGrabber.Exception
stop in class FrameGrabberFrameGrabber.Exceptionpublic void trigger()
throws FrameGrabber.Exception
trigger in class FrameGrabberFrameGrabber.Exceptionpublic 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 FrameGrabberFrameGrabber.Exceptionpublic Frame grabImage() throws FrameGrabber.Exception
FrameGrabber.Exceptionpublic Frame grabSamples() throws FrameGrabber.Exception
FrameGrabber.Exceptionpublic Frame grabKeyFrame() throws FrameGrabber.Exception
FrameGrabber.Exceptionpublic Frame grabFrame(boolean doAudio, boolean doVideo, boolean doProcessing, boolean keyFrames) throws FrameGrabber.Exception
FrameGrabber.Exceptionpublic AVPacket grabPacket() throws FrameGrabber.Exception
FrameGrabber.ExceptionCopyright © 2019. All rights reserved.