Package io.antmedia.recorder
Class FFmpegFrameRecorder
java.lang.Object
io.antmedia.recorder.FrameRecorder
io.antmedia.recorder.FFmpegFrameRecorder
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Author:
- Samuel Audet
-
Nested Class Summary
Nested classes/interfaces inherited from class io.antmedia.recorder.FrameRecorder
FrameRecorder.Seekable
-
Field Summary
Modifier and TypeFieldDescriptionprivate org.bytedeco.ffmpeg.avcodec.AVCodecContext
private org.bytedeco.ffmpeg.avcodec.AVCodec
private int
private org.bytedeco.javacpp.BytePointer
private int
private org.bytedeco.ffmpeg.avcodec.AVPacket
private org.bytedeco.ffmpeg.avformat.AVStream
private org.bytedeco.ffmpeg.avutil.AVChannelLayout
private String
private org.bytedeco.ffmpeg.avutil.AVFrame
private int[]
private int[]
private org.bytedeco.ffmpeg.avformat.AVFormatContext
private org.bytedeco.ffmpeg.swscale.SwsContext
private static FFmpegFrameRecorder.Exception
private org.bytedeco.ffmpeg.avformat.AVFormatContext
private org.bytedeco.ffmpeg.avformat.AVOutputFormat
(package private) static Map<org.bytedeco.javacpp.Pointer,
OutputStream> private org.bytedeco.ffmpeg.avutil.AVFrame
private org.bytedeco.javacpp.BytePointer
private org.bytedeco.javacpp.PointerPointer
private org.bytedeco.javacpp.PointerPointer
private int
private org.bytedeco.ffmpeg.swresample.SwrContext
private int
private org.bytedeco.javacpp.Pointer[]
private org.bytedeco.javacpp.BytePointer[]
private int
private boolean
private org.bytedeco.ffmpeg.avutil.AVFrame
private org.bytedeco.ffmpeg.avcodec.AVCodecContext
private org.bytedeco.ffmpeg.avcodec.AVCodec
private org.bytedeco.javacpp.BytePointer
private int
private org.bytedeco.ffmpeg.avcodec.AVPacket
private org.bytedeco.ffmpeg.avformat.AVStream
Fields inherited from class io.antmedia.recorder.FrameRecorder
aspectRatio, audioBitrate, audioChannels, audioCodec, audioCodecName, audioMetadata, audioOptions, audioQuality, charset, format, frameNumber, frameRate, gopSize, imageHeight, imageScalingFlags, imageWidth, interleaved, list, maxBFrames, maxDelay, metadata, options, pixelFormat, sampleFormat, sampleRate, timestamp, trellis, videoBitrate, videoCodec, videoCodecName, videoMetadata, videoOptions, videoQuality
-
Constructor Summary
ConstructorDescriptionFFmpegFrameRecorder
(String filename, int imageWidth, int imageHeight, int audioChannels) -
Method Summary
Modifier and TypeMethodDescriptionvoid
debugSetStarted
(boolean started) protected void
finalize()
void
flush()
int
org.bytedeco.ffmpeg.avutil.AVFrame
long
Returns best guess for timestamp in microseconds...void
boolean
recordImage
(int width, int height, int depth, int channels, int[] stride, int pixelFormat, Buffer... image) boolean
recordSamples
(int sampleRate, int audioChannels, Buffer... samples) boolean
recordSamples
(Buffer... samples) void
release()
void
void
setFrameNumber
(int frameNumber) void
setTimestamp
(long timestamp) void
start()
void
void
stop()
static void
tryLoad()
private boolean
writeFrame
(org.bytedeco.ffmpeg.avutil.AVFrame frame) private void
writePacket
(int mediaType, org.bytedeco.ffmpeg.avcodec.AVPacket avPacket) private void
writeSamples
(int nb_samples) Methods inherited from class io.antmedia.recorder.FrameRecorder
close, create, create, create, createDefault, createDefault, get, getAspectRatio, getAudioBitrate, getAudioChannels, getAudioCodec, getAudioCodecName, getAudioMetadata, getAudioMetadata, getAudioOption, getAudioOptions, getAudioQuality, getDefault, getFormat, getFrameRate, getGopSize, getImageHeight, getImageScalingFlags, getImageWidth, getMaxBFrames, getMaxDelay, getMetadata, getMetadata, getOption, getOptions, getPixelFormat, getSampleFormat, getSampleRate, getTrellis, getVideoBitrate, getVideoCodec, getVideoCodecName, getVideoMetadata, getVideoMetadata, getVideoOption, getVideoOptions, getVideoQuality, init, isInterleaved, setAspectRatio, setAudioBitrate, setAudioChannels, setAudioCodec, setAudioCodecName, setAudioMetadata, setAudioMetadata, setAudioOption, setAudioOptions, setAudioQuality, setFormat, setFrameRate, setGopSize, setImageHeight, setImageScalingFlags, setImageWidth, setInterleaved, setMaxBFrames, setMaxDelay, setMetadata, setMetadata, setOption, setOptions, setPixelFormat, setSampleFormat, setSampleRate, setTrellis, setVideoBitrate, setVideoCodec, setVideoCodecName, setVideoMetadata, setVideoMetadata, setVideoOption, setVideoOptions, setVideoQuality
-
Field Details
-
loadingException
-
outputStreams
-
filename
-
picture
private org.bytedeco.ffmpeg.avutil.AVFrame picture -
tmp_picture
private org.bytedeco.ffmpeg.avutil.AVFrame tmp_picture -
picture_buf
private org.bytedeco.javacpp.BytePointer picture_buf -
video_outbuf
private org.bytedeco.javacpp.BytePointer video_outbuf -
video_outbuf_size
private int video_outbuf_size -
frame
private org.bytedeco.ffmpeg.avutil.AVFrame frame -
samples_in
private org.bytedeco.javacpp.Pointer[] samples_in -
samples_out
private org.bytedeco.javacpp.BytePointer[] samples_out -
audio_outbuf
private org.bytedeco.javacpp.BytePointer audio_outbuf -
audio_outbuf_size
private int audio_outbuf_size -
audio_input_frame_size
private int audio_input_frame_size -
oformat
private org.bytedeco.ffmpeg.avformat.AVOutputFormat oformat -
oc
private org.bytedeco.ffmpeg.avformat.AVFormatContext oc -
video_codec
private org.bytedeco.ffmpeg.avcodec.AVCodec video_codec -
audio_codec
private org.bytedeco.ffmpeg.avcodec.AVCodec audio_codec -
video_c
private org.bytedeco.ffmpeg.avcodec.AVCodecContext video_c -
audio_c
private org.bytedeco.ffmpeg.avcodec.AVCodecContext audio_c -
video_st
private org.bytedeco.ffmpeg.avformat.AVStream video_st -
audio_st
private org.bytedeco.ffmpeg.avformat.AVStream audio_st -
img_convert_ctx
private org.bytedeco.ffmpeg.swscale.SwsContext img_convert_ctx -
samples_convert_ctx
private org.bytedeco.ffmpeg.swresample.SwrContext samples_convert_ctx -
samples_channels
private int samples_channels -
samples_format
private int samples_format -
samples_rate
private int samples_rate -
planePtr
private org.bytedeco.javacpp.PointerPointer planePtr -
planePtr2
private org.bytedeco.javacpp.PointerPointer planePtr2 -
video_pkt
private org.bytedeco.ffmpeg.avcodec.AVPacket video_pkt -
audio_pkt
private org.bytedeco.ffmpeg.avcodec.AVPacket audio_pkt -
got_video_packet
private int[] got_video_packet -
got_audio_packet
private int[] got_audio_packet -
ifmt_ctx
private org.bytedeco.ffmpeg.avformat.AVFormatContext ifmt_ctx -
started
private volatile boolean started -
default_layout
private org.bytedeco.ffmpeg.avutil.AVChannelLayout default_layout
-
-
Constructor Details
-
FFmpegFrameRecorder
-
-
Method Details
-
tryLoad
- Throws:
FFmpegFrameRecorder.Exception
-
release
- Specified by:
release
in classFrameRecorder
- Throws:
FFmpegFrameRecorder.Exception
-
releaseUnsafe
- Throws:
FFmpegFrameRecorder.Exception
-
finalize
-
getFrameNumber
public int getFrameNumber()- Overrides:
getFrameNumber
in classFrameRecorder
-
setFrameNumber
public void setFrameNumber(int frameNumber) - Overrides:
setFrameNumber
in classFrameRecorder
-
getTimestamp
public long getTimestamp()Returns best guess for timestamp in microseconds...- Overrides:
getTimestamp
in classFrameRecorder
-
setTimestamp
public void setTimestamp(long timestamp) - Overrides:
setTimestamp
in classFrameRecorder
-
start
- Specified by:
start
in classFrameRecorder
- Throws:
FFmpegFrameRecorder.Exception
-
startUnsafe
- Throws:
FFmpegFrameRecorder.Exception
-
flush
- Specified by:
flush
in classFrameRecorder
- Throws:
FFmpegFrameRecorder.Exception
-
stop
- Specified by:
stop
in classFrameRecorder
- Throws:
FFmpegFrameRecorder.Exception
-
record
- Specified by:
record
in classFrameRecorder
- Throws:
FFmpegFrameRecorder.Exception
-
recordImage
public boolean recordImage(int width, int height, int depth, int channels, int[] stride, int pixelFormat, Buffer... image) throws FFmpegFrameRecorder.Exception - Throws:
FFmpegFrameRecorder.Exception
-
recordSamples
- Throws:
FFmpegFrameRecorder.Exception
-
recordSamples
public boolean recordSamples(int sampleRate, int audioChannels, Buffer... samples) throws FFmpegFrameRecorder.Exception - Throws:
FFmpegFrameRecorder.Exception
-
writeSamples
- Throws:
FFmpegFrameRecorder.Exception
-
writeFrame
private boolean writeFrame(org.bytedeco.ffmpeg.avutil.AVFrame frame) throws FFmpegFrameRecorder.Exception - Throws:
FFmpegFrameRecorder.Exception
-
writePacket
private void writePacket(int mediaType, org.bytedeco.ffmpeg.avcodec.AVPacket avPacket) throws FFmpegFrameRecorder.Exception - Throws:
FFmpegFrameRecorder.Exception
-
getFilename
-
getPicture
public org.bytedeco.ffmpeg.avutil.AVFrame getPicture() -
debugSetStarted
public void debugSetStarted(boolean started)
-