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


Java MP4Muxer.audioSampleEntry方法代码示例

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


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

示例1: 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

示例2: WavTrack

import org.jcodec.containers.mp4.muxer.MP4Muxer; //导入方法依赖的package包/类
public WavTrack(ByteChannelPool pool, Label... labels) throws IOException {
    this.pool = pool;

    SeekableByteChannel ch = null;
    try {
        ch = pool.getChannel();
        header = WavHeader.read(Channels.newInputStream(ch));
        size = header.dataSize <= 0 ? ch.size() : header.dataSize;
    } finally {
        ch.close();
    }

    se = MP4Muxer.audioSampleEntry("sowt", 1, header.fmt.bitsPerSample >> 3, header.fmt.numChannels,
            header.fmt.sampleRate, Endian.LITTLE_ENDIAN);
    ChannelBox chan = new ChannelBox();
    if (labels != null && labels.length > 0) {
        ChannelUtils.setLabels(labels, chan);
    } else {
        labels = new Label[header.getFormat().getChannels()];
        for (int i = 0; i < labels.length; i++)
            labels[i] = Label.Mono;
        ChannelUtils.setLabels(labels, chan);
    }
    se.add(chan);

    pktDataLen = FRAMES_PER_PKT * header.fmt.numChannels * (header.fmt.bitsPerSample >> 3);
    pktDuration = (double) FRAMES_PER_PKT / header.fmt.sampleRate;

    offset = header.dataOffset;
    pts = 0;
    frameNo = 0;
}
 
开发者ID:PenoaksDev,项目名称:OpenSpaceDVR,代码行数:33,代码来源:WavTrack.java

示例3: getSampleEntry

import org.jcodec.containers.mp4.muxer.MP4Muxer; //导入方法依赖的package包/类
@Override
public SampleEntry getSampleEntry() {
    return MP4Muxer.audioSampleEntry(format);
}
 
开发者ID:PenoaksDev,项目名称:OpenSpaceDVR,代码行数:5,代码来源:PCMDVDTrack.java

示例4: getSampleEntry

import org.jcodec.containers.mp4.muxer.MP4Muxer; //导入方法依赖的package包/类
@Override
public SampleEntry getSampleEntry() {
    return MP4Muxer.audioSampleEntry("sowt", 1, 2, 2, rate, Endian.LITTLE_ENDIAN);
}
 
开发者ID:PenoaksDev,项目名称:OpenSpaceDVR,代码行数:5,代码来源:StereoDownmixTrack.java


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