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


Java IContainerFormat.make方法代码示例

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


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

示例1: getSupportedCodecs

import com.xuggle.xuggler.IContainerFormat; //导入方法依赖的package包/类
/**
 * Given the short name of a container, prints out information about
 * it, including which codecs Xuggler can write (mux) into that container.
 * 
 * @param name the short name of the format (e.g. "flv")
 */
public static void getSupportedCodecs(String name) {
  IContainerFormat format = IContainerFormat.make();
  format.setOutputFormat(name, null, null);

  List<ID> codecs = format.getOutputCodecsSupported();
  if (codecs.isEmpty())
    System.out.println("no supported codecs for "+name); //$NON-NLS-1$
  else {
    System.out.println(name+" ("+format+") supports following codecs:"); //$NON-NLS-1$ //$NON-NLS-2$
    for(ID id : codecs) {
      if (id != null) {
        ICodec codec = ICodec.findEncodingCodec(id);
        if (codec != null) {
          System.out.println(codec);
        }
      }
    }
  }
}
 
开发者ID:OpenSourcePhysics,项目名称:video-engines,代码行数:26,代码来源:XuggleVideoRecorder.java

示例2: setup

import com.xuggle.xuggler.IContainerFormat; //导入方法依赖的package包/类
public void setup(final SegmentFacade facade, ISimpleMediaFile outputStreamInfo) {
	log.debug("setup {}", outputUrl);
	this.outputStreamInfo = outputStreamInfo;
	this.facade = facade;
	// output to a custom handler
	outputStreamInfo.setURL(outputUrl);
	// setup our mpeg-ts io handler
	MpegTsIoHandler outputHandler = new MpegTsIoHandler(outputUrl, facade);
	MpegTsHandlerFactory.getFactory().registerStream(outputHandler, outputStreamInfo);
	// create a container
	container = IContainer.make();
	log.trace("Container buffer length: {}", container.getInputBufferLength());
	// create format 
	containerFormat = IContainerFormat.make();
	containerFormat.setOutputFormat("mpegts", outputUrl, null);
}
 
开发者ID:Red5,项目名称:red5-hls-plugin,代码行数:17,代码来源:HLSStreamWriter.java

示例3: setEncodingParameters

import com.xuggle.xuggler.IContainerFormat; //导入方法依赖的package包/类
/**
 * A quick hack. Encoding paramaters are hard-coded here.
 *
 * @throws IOException
 */
@Override
public void setEncodingParameters() throws IOException {
    containerFormat = IContainerFormat.make();
    containerFormat.setOutputFormat("avi", null, null);
    // ObjectOutputStream oos = new ObjectOutputStream();
    // oos.writeObject(containerFormat);

    streamCoders = new IStreamCoder[] { IStreamCoder
            .make(IStreamCoder.Direction.ENCODING) };

    ICodec codec = ICodec.guessEncodingCodec(containerFormat, null, null,
            null, ICodec.Type.CODEC_TYPE_VIDEO);

    streamCoders[0].setNumPicturesInGroupOfPictures(1);
    streamCoders[0].setCodec(codec);

    streamCoders[0].setBitRate(25000);
    streamCoders[0].setBitRateTolerance(9000);
    streamCoders[0].setPixelType(IPixelFormat.Type.YUV420P);
    streamCoders[0].setWidth(352);
    streamCoders[0].setHeight(288);
    streamCoders[0].setFlag(IStreamCoder.Flags.FLAG_QSCALE, true);
    streamCoders[0].setGlobalQuality(0);

    IRational frameRate = IRational.make(25, 1);
    streamCoders[0].setFrameRate(frameRate);
    streamCoders[0].setTimeBase(IRational.make(frameRate.getDenominator(),
            frameRate.getNumerator()));
}
 
开发者ID:openpreserve,项目名称:video-batch,代码行数:35,代码来源:XugglerCompressor.java

示例4: saveScratch

import com.xuggle.xuggler.IContainerFormat; //导入方法依赖的package包/类
/**
  * Saves the video to the current scratchFile.
  * 
  * @throws IOException
  */
@Override
protected void saveScratch() throws IOException {
	FileFilter fileFilter	=	videoType.getDefaultFileFilter();
	if (!hasContent || !(fileFilter instanceof VideoFileFilter))
		return;
	
	// set container format
	IContainerFormat format = IContainerFormat.make();
	VideoFileFilter xuggleFilter = (VideoFileFilter)fileFilter;
	format.setOutputFormat(xuggleFilter.getContainerType(), null, null);
	
	// set the pixel type--may depend on selected fileFilter?
	IPixelFormat.Type pixelType = IPixelFormat.Type.YUV420P;

	// open the output stream, write the images, close the stream
	openStream(format, pixelType);
	
	// open temp images and encode
	long timeStamp = 0;
	int n=0;
	synchronized (tempFiles) {
		for (File imageFile: tempFiles) {
			if (!imageFile.exists())
				throw new IOException("temp image file not found"); //$NON-NLS-1$
			BufferedImage image = ResourceLoader.getBufferedImage(imageFile.getAbsolutePath(), BufferedImage.TYPE_3BYTE_BGR);
			if (image==null || image.getType()!=BufferedImage.TYPE_3BYTE_BGR) {
				throw new IOException("unable to load temp image file"); //$NON-NLS-1$
			}
			
			encodeImage(image, pixelType, timeStamp);
			n++;
			timeStamp = Math.round(n*frameDuration*1000); // frameDuration in ms, timestamp in microsec
		}
	}
	closeStream();
	deleteTempFiles();
	hasContent = false;
	canRecord = false;
}
 
开发者ID:OpenSourcePhysics,项目名称:video-engines,代码行数:45,代码来源:XuggleVideoRecorder.java


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