本文整理汇总了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");
}
示例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;
}
示例3: getSampleEntry
import org.jcodec.containers.mp4.muxer.MP4Muxer; //导入方法依赖的package包/类
@Override
public SampleEntry getSampleEntry() {
return MP4Muxer.audioSampleEntry(format);
}
示例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);
}