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


Java MP4Muxer.videoSampleEntry方法代码示例

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


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

示例1: createMOVSampleEntry

import org.jcodec.containers.mp4.muxer.MP4Muxer; //导入方法依赖的package包/类
public static SampleEntry createMOVSampleEntry(List<ByteBuffer> spsList, List<ByteBuffer> ppsList) {
    SeqParameterSet sps = readSPS(NIOUtils.duplicate(spsList.get(0)));
    AvcCBox avcC = new AvcCBox(sps.profile_idc, 0, sps.level_idc, spsList, ppsList);

    int codedWidth = (sps.pic_width_in_mbs_minus1 + 1) << 4;
    int codedHeight = getPicHeightInMbs(sps) << 4;

    int width = sps.frame_cropping_flag ? codedWidth
            - ((sps.frame_crop_right_offset + sps.frame_crop_left_offset) << sps.chroma_format_idc.compWidth[1])
            : codedWidth;
    int height = sps.frame_cropping_flag ? codedHeight
            - ((sps.frame_crop_bottom_offset + sps.frame_crop_top_offset) << sps.chroma_format_idc.compHeight[1])
            : codedHeight;

    Size size = new Size(width, height);

    SampleEntry se = MP4Muxer.videoSampleEntry("avc1", size, "JCodec");
    se.add(avcC);

    return se;
}
 
开发者ID:PenoaksDev,项目名称:OpenSpaceDVR,代码行数:22,代码来源:H264Utils.java

示例2: toSampleEntry

import org.jcodec.containers.mp4.muxer.MP4Muxer; //导入方法依赖的package包/类
private SampleEntry toSampleEntry(GenericDescriptor d) {
    if (track.isVideo()) {
        GenericPictureEssenceDescriptor ped = (GenericPictureEssenceDescriptor) d;

        VideoSampleEntry se = MP4Muxer.videoSampleEntry(MP4Util.getFourcc(track.getCodec().getCodec()), new Size(
                ped.getDisplayWidth(), ped.getDisplayHeight()), "JCodec");
        Rational ar = ped.getAspectRatio();
        se.add(new PixelAspectExt(
                new Rational((int) ((1000 * ar.getNum() * ped.getDisplayHeight()) / (ar.getDen() * ped
                        .getDisplayWidth())), 1000)));

        return se;
    } else if (track.isAudio()) {
        GenericSoundEssenceDescriptor sed = (GenericSoundEssenceDescriptor) d;
        int sampleSize = sed.getQuantizationBits() >> 3;
        MXFCodecMapping codec = track.getCodec();

        return MP4Muxer.audioSampleEntry(sampleSize == 3 ? "in24" : "sowt", 0, sampleSize, sed.getChannelCount(),
                (int) sed.getAudioSamplingRate().asFloat(), codec == MXFCodecMapping.PCM_S16BE ? Endian.BIG_ENDIAN
                        : Endian.LITTLE_ENDIAN);
    }
    throw new RuntimeException("Can't get sample entry");
}
 
开发者ID:PenoaksDev,项目名称:OpenSpaceDVR,代码行数:24,代码来源:MXFVirtualTrack.java

示例3: close

import org.jcodec.containers.mp4.muxer.MP4Muxer; //导入方法依赖的package包/类
@Override
public void close() throws IOException
{
   Size size = new Size(width, height);
   SampleEntry sampleEntry = MP4Muxer.videoSampleEntry("jpeg", size, "IHMCVideoCodecs");
   track.addSampleEntry(sampleEntry);
   muxer.writeHeader();
   channel.close();
   encoder.delete();
}
 
开发者ID:ihmcrobotics,项目名称:ihmc-video-codecs,代码行数:11,代码来源:MP4MJPEGMovieBuilder.java


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