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


Java VideoDecoder类代码示例

本文整理汇总了Java中org.jcodec.common.VideoDecoder的典型用法代码示例。如果您正苦于以下问题:Java VideoDecoder类的具体用法?Java VideoDecoder怎么用?Java VideoDecoder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getDecoder

import org.jcodec.common.VideoDecoder; //导入依赖的package包/类
@Override
protected VideoDecoder getDecoder(int scaleFactor) {
    SampleEntry srcSE = src.getSampleEntry();
    FielExtension fiel = Box.findFirst(srcSE, FielExtension.class, "fiel");
    boolean interlace = false, topField = false;
    if(fiel != null) {
        interlace = fiel.isInterlaced();
        topField = fiel.topFieldFirst();
    }
    
    
    switch (scaleFactor) {
    case 2:
        return new JpegToThumb2x2(interlace, topField);
    case 1:
        return new JpegToThumb4x4(interlace, topField);
    case 0:
        return new JpegDecoder(interlace, topField);
    default:
        throw new IllegalArgumentException("Unsupported scale factor: " + scaleFactor);
    }
}
 
开发者ID:PenoaksDev,项目名称:OpenSpaceDVR,代码行数:23,代码来源:Jpeg2AVCTrack.java

示例2: detectDecoder

import org.jcodec.common.VideoDecoder; //导入依赖的package包/类
private ContainerAdaptor detectDecoder(SeekableDemuxerTrack videoTrack, Packet frame) throws JCodecException {
     if (videoTrack instanceof AbstractMP4DemuxerTrack) {
         SampleEntry se = ((AbstractMP4DemuxerTrack) videoTrack).getSampleEntries()[((MP4Packet) frame).getEntryNo()];
         VideoDecoder byFourcc = byFourcc(se.getHeader().getFourcc());
         if (byFourcc instanceof H264Decoder) {
	return new AVCMP4Adaptor(((AbstractMP4DemuxerTrack) videoTrack).getSampleEntries());
}
     }

     throw new UnsupportedFormatException("Codec is not supported");
 }
 
开发者ID:vitrivr,项目名称:cineast,代码行数:12,代码来源:JcodecFrameGrab.java

示例3: byFourcc

import org.jcodec.common.VideoDecoder; //导入依赖的package包/类
private VideoDecoder byFourcc(String fourcc) {
    if (fourcc.equals("avc1")) {
        return new H264Decoder();
    } else if (fourcc.equals("m1v1") || fourcc.equals("m2v1")) {
        return new MPEGDecoder();
    } else if (fourcc.equals("apco") || fourcc.equals("apcs") || fourcc.equals("apcn") || fourcc.equals("apch")
            || fourcc.equals("ap4h")) {
        return new ProresDecoder();
    }
    return null;
}
 
开发者ID:vitrivr,项目名称:cineast,代码行数:12,代码来源:JcodecFrameGrab.java

示例4: detectDecoder

import org.jcodec.common.VideoDecoder; //导入依赖的package包/类
private ContainerAdaptor detectDecoder(SeekableDemuxerTrack videoTrack, Packet frame) throws JCodecException {
	if (videoTrack instanceof AbstractMP4DemuxerTrack) {
		SampleEntry se = ((AbstractMP4DemuxerTrack) videoTrack).getSampleEntries()[((MP4Packet) frame).getEntryNo()];
		VideoDecoder byFourcc = videoDecoder(se.getHeader().getFourcc());
		if (byFourcc instanceof H264Decoder)
			return new AVCMP4Adaptor(((AbstractMP4DemuxerTrack) videoTrack).getSampleEntries());
	}
	throw new UnsupportedFormatException("Codec is not supported");
}
 
开发者ID:arisona,项目名称:ether,代码行数:10,代码来源:FrameGrab.java

示例5: videoDecoder

import org.jcodec.common.VideoDecoder; //导入依赖的package包/类
private VideoDecoder videoDecoder(String fourcc) {
	if (fourcc.equals("avc1"))
		return new H264Decoder();
	else if (fourcc.equals("m1v1") || fourcc.equals("m2v1"))
		return new MPEGDecoder();
	else if (fourcc.equals("apco") || fourcc.equals("apcs") || fourcc.equals("apcn") || fourcc.equals("apch") || fourcc.equals("ap4h"))
		return new ProresDecoder();
	LOG.info("No video decoder for '" + fourcc + "'");
	return null;
}
 
开发者ID:arisona,项目名称:ether,代码行数:11,代码来源:FrameGrab.java

示例6: detectDecoder

import org.jcodec.common.VideoDecoder; //导入依赖的package包/类
private ContainerAdaptor detectDecoder(SeekableDemuxerTrack videoTrack, Packet frame) throws JCodecException {
    if (videoTrack instanceof AbstractMP4DemuxerTrack) {
        SampleEntry se = ((AbstractMP4DemuxerTrack) videoTrack).getSampleEntries()[((MP4Packet) frame).getEntryNo()];
        VideoDecoder byFourcc = byFourcc(se.getHeader().getFourcc());
        if (byFourcc instanceof H264Decoder)
            return new AVCMP4Adaptor(((AbstractMP4DemuxerTrack) videoTrack).getSampleEntries());
    }

    throw new UnsupportedFormatException("Codec is not supported");
}
 
开发者ID:PenoaksDev,项目名称:OpenSpaceDVR,代码行数:11,代码来源:FrameGrab.java

示例7: getDecoder

import org.jcodec.common.VideoDecoder; //导入依赖的package包/类
protected VideoDecoder getDecoder(int scaleFactor) {
    switch (scaleFactor) {
    case 2:
        return new Mpeg2Thumb2x2();
    case 1:
        return new Mpeg2Thumb4x4();
    case 0:
        return new MPEGDecoder();
    default:
        throw new IllegalArgumentException("Unsupported scale factor: " + scaleFactor);
    }
}
 
开发者ID:PenoaksDev,项目名称:OpenSpaceDVR,代码行数:13,代码来源:MPEGToAVCTranscoder.java

示例8: getDecoder

import org.jcodec.common.VideoDecoder; //导入依赖的package包/类
@Override
protected VideoDecoder getDecoder(int scaleFactor) {
    switch (scaleFactor) {
    case 2:
        return new ProresToThumb2x2();
    case 1:
        return new ProresToThumb4x4();
    case 0:
        return new ProresDecoder();
    default:
        throw new IllegalArgumentException("Unsupported scale factor: " + scaleFactor);
    }
}
 
开发者ID:PenoaksDev,项目名称:OpenSpaceDVR,代码行数:14,代码来源:Prores2AVCTrack.java

示例9: GenericAdaptor

import org.jcodec.common.VideoDecoder; //导入依赖的package包/类
public GenericAdaptor(VideoDecoder detect) {
    this.decoder = detect;
}
 
开发者ID:PenoaksDev,项目名称:OpenSpaceDVR,代码行数:4,代码来源:GenericAdaptor.java

示例10: getDecoder

import org.jcodec.common.VideoDecoder; //导入依赖的package包/类
protected abstract VideoDecoder getDecoder(int scaleFactor); 
开发者ID:PenoaksDev,项目名称:OpenSpaceDVR,代码行数:2,代码来源:Transcode2AVCTrack.java


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