当前位置: 首页>>代码示例>>Java>>正文


Java IVideoPicture.setQuality方法代码示例

本文整理汇总了Java中com.xuggle.xuggler.IVideoPicture.setQuality方法的典型用法代码示例。如果您正苦于以下问题:Java IVideoPicture.setQuality方法的具体用法?Java IVideoPicture.setQuality怎么用?Java IVideoPicture.setQuality使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.xuggle.xuggler.IVideoPicture的用法示例。


在下文中一共展示了IVideoPicture.setQuality方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: encode

import com.xuggle.xuggler.IVideoPicture; //导入方法依赖的package包/类
@Override
public void encode(BufferedImage image) throws Exception {
    IVideoPicture frame = converter.toPicture(image, (long) (frameNo * deltat));
    frame.setQuality(0);

    movieWriter.encodeVideo(0, frame);
    frameNo++;
}
 
开发者ID:Helioviewer-Project,项目名称:JHelioviewer-SWHV,代码行数:9,代码来源:XuggleExporter.java

示例2: recordFrame

import com.xuggle.xuggler.IVideoPicture; //导入方法依赖的package包/类
public void recordFrame(BufferedImage frame) {
	final BufferedImage image = ConverterFactory.convertToType(frame, BufferedImage.TYPE_3BYTE_BGR);
	final IConverter converter = ConverterFactory.createConverter(image, IPixelFormat.Type.YUV420P);

	timestamp = (System.currentTimeMillis() - startTime) + timeOffset;

	final IVideoPicture f = converter.toPicture(image, timestamp * 1000);
	f.setKeyFrame(isFirstShotFrame);
	f.setQuality(0);

	if (forking) {
		synchronized (bufferedFrames) {
			bufferedFrames.add(f);
		}
	} else {
		isFirstShotFrame = false;

		synchronized (videoWriterLock) {
			if (recording)
				videoWriter.encodeVideo(0, f);
		}

		if (timestamp >= ShotRecorder.RECORD_LENGTH * 3) {
			logger.debug("Rolling video file {}, timestamp = {} ms", relativeVideoFile.getPath(), timestamp);
			fork(false);
		}
	}
}
 
开发者ID:phrack,项目名称:ShootOFF,代码行数:29,代码来源:RollingRecorder.java

示例3: recordFrame

import com.xuggle.xuggler.IVideoPicture; //导入方法依赖的package包/类
public void recordFrame(BufferedImage frame) {
	final BufferedImage image = ConverterFactory.convertToType(frame, BufferedImage.TYPE_3BYTE_BGR);
	final IConverter converter = ConverterFactory.createConverter(image, IPixelFormat.Type.YUV420P);

	final long timestamp = (System.currentTimeMillis() - startTime) + timeOffset;

	final IVideoPicture f = converter.toPicture(image, timestamp * 1000);
	f.setKeyFrame(isFirstShotFrame);
	f.setQuality(0);
	isFirstShotFrame = false;

	videoWriter.encodeVideo(0, f);
}
 
开发者ID:phrack,项目名称:ShootOFF,代码行数:14,代码来源:ShotRecorder.java

示例4: addImage

import com.xuggle.xuggler.IVideoPicture; //导入方法依赖的package包/类
/**
 * Add new image into video stream.
 */
@Override
public void addImage(final Image image) throws IOException {
    if (!isOpen()) {
        throw new IOException("Current object does not opened yet! Please call #open() method!");
    }

    final BufferedImage worksWithXugglerBufferedImage = convertToType(TypeConvert.toBufferedImage(image),
            BufferedImage.TYPE_3BYTE_BGR);
    final IPacket packet = IPacket.make();

    IConverter converter = null;
    try {
        converter = ConverterFactory.createConverter(worksWithXugglerBufferedImage, IPixelFormat.Type.YUV420P);
    } catch (final UnsupportedOperationException e) {
        throw new IOException(e.getMessage());
    }

    this.totalTimeStamp += this.incrementTimeStamp;
    final IVideoPicture outFrame = converter.toPicture(worksWithXugglerBufferedImage, this.totalTimeStamp);
    outFrame.setQuality(0);
    int retval = this.outStreamCoder.encodeVideo(packet, outFrame, 0);
    if (retval < 0) {
        throw new IOException("Could not encode video!");
    }

    if (packet.isComplete()) {
        retval = this.outContainer.writePacket(packet);
        if (retval < 0) {
            throw new IOException("Could not save packet to container!");
        }
    }
}
 
开发者ID:dzavodnikov,项目名称:JcvLib,代码行数:36,代码来源:VideoFileWriter.java

示例5: getPicture

import com.xuggle.xuggler.IVideoPicture; //导入方法依赖的package包/类
/**
  * Converts a bgr source image to a xuggle picture.
  *
  * @param bgrImage the source image (must be type TYPE_3BYTE_BGR)
  * @param pixelType the pixel type
  * @param timeStamp the timestamp in microseconds
  * @return the xuggle picture
  */
private IVideoPicture getPicture(BufferedImage bgrImage, IPixelFormat.Type pixelType, long timeStamp) {
	
	IVideoPicture picture = null;
	try {
		IConverter converter = getConverter(bgrImage, pixelType);
		picture = converter.toPicture(bgrImage, timeStamp);
		picture.setQuality(0);		
	} catch (Exception ex) {
		ex.printStackTrace();
	} catch (Error err) {
		err.printStackTrace();
	}
	return picture;
 }
 
开发者ID:OpenSourcePhysics,项目名称:video-engines,代码行数:23,代码来源:XuggleVideoRecorder.java


注:本文中的com.xuggle.xuggler.IVideoPicture.setQuality方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。