本文整理汇总了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);
}
}
示例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");
}
示例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;
}
示例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");
}
示例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;
}
示例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");
}
示例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);
}
}
示例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);
}
}
示例9: GenericAdaptor
import org.jcodec.common.VideoDecoder; //导入依赖的package包/类
public GenericAdaptor(VideoDecoder detect) {
this.decoder = detect;
}
示例10: getDecoder
import org.jcodec.common.VideoDecoder; //导入依赖的package包/类
protected abstract VideoDecoder getDecoder(int scaleFactor);