本文整理汇总了Java中com.coremedia.iso.boxes.MediaHeaderBox.setDuration方法的典型用法代码示例。如果您正苦于以下问题:Java MediaHeaderBox.setDuration方法的具体用法?Java MediaHeaderBox.setDuration怎么用?Java MediaHeaderBox.setDuration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.coremedia.iso.boxes.MediaHeaderBox
的用法示例。
在下文中一共展示了MediaHeaderBox.setDuration方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMdhd
import com.coremedia.iso.boxes.MediaHeaderBox; //导入方法依赖的package包/类
protected Box createMdhd(Movie movie, Track track) {
MediaHeaderBox mdhd = new MediaHeaderBox();
mdhd.setCreationTime(track.getTrackMetaData().getCreationTime());
mdhd.setDuration(getDuration(track));
mdhd.setTimescale(track.getTrackMetaData().getTimescale());
mdhd.setLanguage(track.getTrackMetaData().getLanguage());
return mdhd;
}
示例2: createTrackBox
import com.coremedia.iso.boxes.MediaHeaderBox; //导入方法依赖的package包/类
protected TrackBox createTrackBox(Track track, Mp4Movie movie) {
TrackBox trackBox = new TrackBox();
TrackHeaderBox tkhd = new TrackHeaderBox();
tkhd.setEnabled(true);
tkhd.setInMovie(true);
tkhd.setInPreview(true);
if (track.isAudio()) {
tkhd.setMatrix(Matrix.ROTATE_0);
} else {
tkhd.setMatrix(movie.getMatrix());
}
tkhd.setAlternateGroup(0);
tkhd.setCreationTime(track.getCreationTime());
tkhd.setDuration(track.getDuration() * getTimescale(movie) / track.getTimeScale());
tkhd.setHeight(track.getHeight());
tkhd.setWidth(track.getWidth());
tkhd.setLayer(0);
tkhd.setModificationTime(new Date());
tkhd.setTrackId(track.getTrackId() + 1);
tkhd.setVolume(track.getVolume());
trackBox.addBox(tkhd);
MediaBox mdia = new MediaBox();
trackBox.addBox(mdia);
MediaHeaderBox mdhd = new MediaHeaderBox();
mdhd.setCreationTime(track.getCreationTime());
mdhd.setDuration(track.getDuration());
mdhd.setTimescale(track.getTimeScale());
mdhd.setLanguage("eng");
mdia.addBox(mdhd);
HandlerBox hdlr = new HandlerBox();
hdlr.setName(track.isAudio() ? "SoundHandle" : "VideoHandle");
hdlr.setHandlerType(track.getHandler());
mdia.addBox(hdlr);
MediaInformationBox minf = new MediaInformationBox();
minf.addBox(track.getMediaHeaderBox());
DataInformationBox dinf = new DataInformationBox();
DataReferenceBox dref = new DataReferenceBox();
dinf.addBox(dref);
DataEntryUrlBox url = new DataEntryUrlBox();
url.setFlags(1);
dref.addBox(url);
minf.addBox(dinf);
Box stbl = createStbl(track);
minf.addBox(stbl);
mdia.addBox(minf);
return trackBox;
}
示例3: createTrackBox
import com.coremedia.iso.boxes.MediaHeaderBox; //导入方法依赖的package包/类
private TrackBox createTrackBox(Track track, Mp4Movie movie) {
TrackBox trackBox = new TrackBox();
TrackHeaderBox tkhd = new TrackHeaderBox();
tkhd.setEnabled(true);
tkhd.setInMovie(true);
tkhd.setInPreview(true);
if (track.isAudio()) {
tkhd.setMatrix(Matrix.ROTATE_0);
} else {
tkhd.setMatrix(movie.getMatrix());
}
tkhd.setAlternateGroup(0);
tkhd.setCreationTime(track.getCreationTime());
tkhd.setModificationTime(track.getCreationTime());
tkhd.setDuration(track.getDuration() * getTimescale(movie) / track.getTimeScale());
tkhd.setHeight(track.getHeight());
tkhd.setWidth(track.getWidth());
tkhd.setLayer(0);
tkhd.setModificationTime(new Date());
tkhd.setTrackId(track.getTrackId() + 1);
tkhd.setVolume(track.getVolume());
trackBox.addBox(tkhd);
MediaBox mdia = new MediaBox();
trackBox.addBox(mdia);
MediaHeaderBox mdhd = new MediaHeaderBox();
mdhd.setCreationTime(track.getCreationTime());
mdhd.setModificationTime(track.getCreationTime());
mdhd.setDuration(track.getDuration());
mdhd.setTimescale(track.getTimeScale());
mdhd.setLanguage("eng");
mdia.addBox(mdhd);
HandlerBox hdlr = new HandlerBox();
hdlr.setName(track.isAudio() ? "SoundHandle" : "VideoHandle");
hdlr.setHandlerType(track.getHandler());
mdia.addBox(hdlr);
MediaInformationBox minf = new MediaInformationBox();
minf.addBox(track.getMediaHeaderBox());
DataInformationBox dinf = new DataInformationBox();
DataReferenceBox dref = new DataReferenceBox();
dinf.addBox(dref);
DataEntryUrlBox url = new DataEntryUrlBox();
url.setFlags(1);
dref.addBox(url);
minf.addBox(dinf);
Box stbl = createStbl(track);
minf.addBox(stbl);
mdia.addBox(minf);
return trackBox;
}