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


Java IStream.getIndexEntries方法代码示例

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


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

示例1: getMeanGOPLength

import com.xuggle.xuggler.IStream; //导入方法依赖的package包/类
public static int getMeanGOPLength(IContainer container) throws CannotProceedException, IOException {
 int numStreams = container.getNumStreams();
 
 if( numStreams <= 0 )
     throw new IOException( "No streams found in container." );
 
 List<IIndexEntry> index_list = null;
 
 for( int j = 0; j < container.getNumStreams(); j++ ) {
     IStream stream = container.getStream(j);
     IStreamCoder coder = stream.getStreamCoder();
     if( coder.getCodecType() != ICodec.Type.CODEC_TYPE_VIDEO)
         continue;
     index_list = stream.getIndexEntries();
 }
 
 if( index_list == null || index_list.size() == 0)
     throw new CannotProceedException( "No index entries found!" );
 
 int k = 0;
 for( int i = 0; i < index_list.size(); i++ )
    if ( index_list.get(i).isKeyFrame() ) k++; 
 
    return index_list.size() / k;
}
 
开发者ID:openpreserve,项目名称:video-batch,代码行数:26,代码来源:XugglerAnalyzer.java

示例2: getAvgGOPLength

import com.xuggle.xuggler.IStream; //导入方法依赖的package包/类
public long getAvgGOPLength(){
 
 List<IIndexEntry> index_list = null;

    IStream videostream = null;
 
 for( int j = 0; j < container.getNumStreams(); j++ ) {
     IStream stream = container.getStream(j);
     IStreamCoder coder = stream.getStreamCoder();
     if( coder.getCodecType() != ICodec.Type.CODEC_TYPE_VIDEO)
         continue;
     index_list = stream.getIndexEntries();
        videostream = stream;
 }
 
    // TODO: generalize MediaFramework interface to deal with audio too (where not videostream is contained)
 if( index_list == null || index_list.isEmpty() )
        return videostream.getNumFrames();
 
 int k = 0;
 for( int i = 0; i < index_list.size(); i++ )
    if ( index_list.get(i).isKeyFrame() ) k++; 
 
    return index_list.size() / k;
}
 
开发者ID:openpreserve,项目名称:video-batch,代码行数:26,代码来源:XugglerMediaFramework.java

示例3: getMeanVideoFrameSize

import com.xuggle.xuggler.IStream; //导入方法依赖的package包/类
/**
 * Calculates average frame size in bytes of the video stream of the given container.
 * @param container
 * @return
 * @throws IOException
 * @throws CannotProceedException
 */
public static int getMeanVideoFrameSize( IContainer container ) throws IOException, CannotProceedException {
    
 int numStreams = container.getNumStreams();
 
 if( numStreams <= 0 )
     throw new IOException( "No streams found in container." );
 
 List<IIndexEntry> index_list = null;
 
 for( int j = 0; j < container.getNumStreams(); j++ ) {
     IStream stream = container.getStream(j);
     IStreamCoder coder = stream.getStreamCoder();
     if( coder.getCodecType() != ICodec.Type.CODEC_TYPE_VIDEO)
         continue;
     index_list = stream.getIndexEntries();
 }
 
 if( index_list == null || index_list.size() == 0)
     throw new CannotProceedException( "No index entries found!" );
 
 BigInteger avg_size = new BigInteger("0");
 
 for( int i = 0; i < index_list.size(); i++ )
     avg_size = avg_size.add( new BigInteger( index_list.get(i).getSize() + "") );
 
 avg_size = avg_size.divide( new BigInteger( index_list.size() + "" ));
		
    return avg_size.intValue();
}
 
开发者ID:openpreserve,项目名称:video-batch,代码行数:37,代码来源:XugglerAnalyzer.java


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