本文整理汇总了Java中org.bytedeco.javacv.FrameRecorder类的典型用法代码示例。如果您正苦于以下问题:Java FrameRecorder类的具体用法?Java FrameRecorder怎么用?Java FrameRecorder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FrameRecorder类属于org.bytedeco.javacv包,在下文中一共展示了FrameRecorder类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: writeFrame
import org.bytedeco.javacv.FrameRecorder; //导入依赖的package包/类
private void writeFrame(byte[] frameData, long time)
{
try
{
// Update frame
((ByteBuffer) imageFrame.image[0].position(0)).put(frameData);
// Update timestamp
long t = 1000 * (time - startTime);
if (t > writer.getTimestamp())
{
writer.setTimestamp(t);
}
// Write frame
writer.record(imageFrame, pixelFormat);
}
catch (FrameRecorder.Exception e)
{
Log.e("Error while writing frame", e);
}
}
开发者ID:hcmlab,项目名称:ssj,代码行数:23,代码来源:FFMPEGWriter.java
示例2: flush
import org.bytedeco.javacv.FrameRecorder; //导入依赖的package包/类
@Override
public void flush(Stream[] stream_in) throws SSJFatalException
{
try
{
writer.stop();
writer.release();
}
catch (FrameRecorder.Exception e)
{
Log.e("Error while stopping writer", e);
}
}
开发者ID:hcmlab,项目名称:ssj,代码行数:14,代码来源:FFMPEGWriter.java
示例3: recordFrame
import org.bytedeco.javacv.FrameRecorder; //导入依赖的package包/类
/**
* 录制帧
* @throws FrameRecorder.Exception
*/
private void recordFrame(Frame frame) throws FrameRecorder.Exception, FrameFilter.Exception {
mFrameFilter.push(frame);
Frame filteredFrame;
while ((filteredFrame = mFrameFilter.pull()) != null) {
recorder.record(filteredFrame);
}
}
开发者ID:Grrsun,项目名称:meipaiAll,代码行数:12,代码来源:WXLikeVideoRecorder.java
示例4: record
import org.bytedeco.javacv.FrameRecorder; //导入依赖的package包/类
/**
* thread safe recording of avi
*
* @param key
* - input, filter, or display
* @param data
*/
public void record(OpenCVData data) {
try {
if (!outputFileStreams.containsKey(recordingSource)) {
// FFmpegFrameRecorder recorder = new FFmpegFrameRecorder
// (String.format("%s.avi",filename), frame.width(),
// frame.height());
FrameRecorder recorder = new OpenCVFrameRecorder(String.format("%s.avi", recordingSource), frame.width(), frame.height());
// recorder.setCodecID(CV_FOURCC('M','J','P','G'));
// TODO - set frame rate to framerate
recorder.setFrameRate(15);
recorder.setPixelFormat(1);
recorder.start();
outputFileStreams.put(recordingSource, recorder);
}
// TODO - add input, filter & display
outputFileStreams.get(recordingSource).record(data.getImage(recordingSource));
if (closeOutputs) {
OpenCVFrameRecorder output = (OpenCVFrameRecorder) outputFileStreams.get(recordingSource);
outputFileStreams.remove(output);
output.stop();
output.release();
recordOutput = false;
closeOutputs = false;
}
} catch (Exception e) {
Logging.logError(e);
}
}
开发者ID:glaudiston,项目名称:project-bianca,代码行数:41,代码来源:VideoProcessor.java
示例5: record
import org.bytedeco.javacv.FrameRecorder; //导入依赖的package包/类
public void record(OpenCVData data) {
try {
if (!outputFileStreams.containsKey(recordingSource)) {
// FFmpegFrameRecorder recorder = new FFmpegFrameRecorder
// (String.format("%s.avi",filename), frame.width(),
// frame.height());
FrameRecorder recorder = new OpenCVFrameRecorder(String.format("%s.avi", recordingSource),
frame.imageWidth, frame.imageHeight);
// recorder.setCodecID(CV_FOURCC('M','J','P','G'));
// TODO - set frame rate to framerate
recorder.setFrameRate(15);
recorder.setPixelFormat(1);
recorder.start();
outputFileStreams.put(recordingSource, recorder);
}
// TODO - add input, filter & display
outputFileStreams.get(recordingSource).record(converter.convert(data.getImage(recordingSource)));
if (closeOutputs) {
OpenCVFrameRecorder output = (OpenCVFrameRecorder) outputFileStreams.get(recordingSource);
outputFileStreams.remove(output);
output.stop();
output.release();
recordOutput = false;
closeOutputs = false;
}
} catch (Exception e) {
Logging.logError(e);
}
}
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:33,代码来源:VideoProcessor.java
注:本文中的org.bytedeco.javacv.FrameRecorder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论