public MediaInfoBox getMinf() { return Box.findFirst(this, MediaInfoBox.class, "minf"); } }
public MediaInfoBox getMinf() { return Box.findFirst(this, MediaInfoBox.class, "minf"); } }
public int parseTimecode(String tc) { String[] split = tc.split(":"); TimecodeSampleEntry tmcd = Box .findFirst(box, TimecodeSampleEntry.class, "mdia", "minf", "stbl", "stsd", "tmcd"); byte nf = tmcd.getNumFrames(); return Integer.parseInt(split[3]) + Integer.parseInt(split[2]) * nf + Integer.parseInt(split[1]) * 60 * nf + Integer.parseInt(split[0]) * 3600 * nf; }
public int parseTimecode(String tc) { String[] split = tc.split(":"); TimecodeSampleEntry tmcd = Box .findFirst(box, TimecodeSampleEntry.class, "mdia", "minf", "stbl", "stsd", "tmcd"); byte nf = tmcd.getNumFrames(); return Integer.parseInt(split[3]) + Integer.parseInt(split[2]) * nf + Integer.parseInt(split[1]) * 60 * nf + Integer.parseInt(split[0]) * 3600 * nf; }
public List<Edit> getEdits() { EditListBox editListBox = Box.findFirst(box, EditListBox.class, "edts", "elst"); if (editListBox != null) return editListBox.getEdits(); return null; }
public String getName() { NameBox nameBox = Box.findFirst(box, NameBox.class, "udta", "name"); return nameBox != null ? nameBox.getName() : null; }
public String getName() { NameBox nb = Box.findFirst(this, NameBox.class, "udta", "name"); return nb == null ? null : nb.getName(); }
public List<Edit> getEdits() { EditListBox editListBox = Box.findFirst(box, EditListBox.class, "edts", "elst"); if (editListBox != null) return editListBox.getEdits(); return null; }
private static void setLabels(TrakBox trakBox, Label[] labels) { ChannelBox channel = Box.findFirst(trakBox, ChannelBox.class, "mdia", "minf", "stbl", "stsd", null, "chan"); if (channel == null) { channel = new ChannelBox(); Box.findFirst(trakBox, SampleEntry.class, "mdia", "minf", "stbl", "stsd", null).add(channel); } setLabels(labels, channel); }
public int getTrackId() { TrackFragmentHeaderBox tfhd = Box .findFirst(this, TrackFragmentHeaderBox.class, TrackFragmentHeaderBox.fourcc()); if (tfhd == null) throw new RuntimeException("Corrupt track fragment, no header atom found"); return tfhd.getTrackId(); } }
public int getSequenceNumber() { MovieFragmentHeaderBox mfhd = Box .findFirst(this, MovieFragmentHeaderBox.class, MovieFragmentHeaderBox.fourcc()); if (mfhd == null) throw new RuntimeException("Corrupt movie fragment, no header atom found"); return mfhd.getSequenceNumber(); } }
public int getSequenceNumber() { MovieFragmentHeaderBox mfhd = Box .findFirst(this, MovieFragmentHeaderBox.class, MovieFragmentHeaderBox.fourcc()); if (mfhd == null) throw new RuntimeException("Corrupt movie fragment, no header atom found"); return mfhd.getSequenceNumber(); } }
public int getTrackId() { TrackFragmentHeaderBox tfhd = Box .findFirst(this, TrackFragmentHeaderBox.class, TrackFragmentHeaderBox.fourcc()); if (tfhd == null) throw new RuntimeException("Corrupt track fragment, no header atom found"); return tfhd.getTrackId(); } }
public static AvcCBox parseAVCC(VideoSampleEntry vse) { Box lb = Box.findFirst(vse, Box.class, "avcC"); if (lb instanceof AvcCBox) return (AvcCBox) lb; else { AvcCBox avcC = new AvcCBox(); avcC.parse(((LeafBox) lb).getData().duplicate()); return avcC; } }
public AbstractMP4DemuxerTrack create(TrakBox trak) { SampleSizesBox stsz = findFirst(trak, SampleSizesBox.class, "mdia", "minf", "stbl", "stsz"); if (stsz.getDefaultSize() == 0) return new FramesMP4DemuxerTrack(movie, trak, input); else return new PCMMP4DemuxerTrack(movie, trak, input); }
public AbstractMP4DemuxerTrack create(TrakBox trak) { SampleSizesBox stsz = findFirst(trak, SampleSizesBox.class, "mdia", "minf", "stbl", "stsz"); if (stsz.getDefaultSize() == 0) return new FramesMP4DemuxerTrack(movie, trak, input); else return new PCMMP4DemuxerTrack(movie, trak, input); }
public Size getDisplayDimensions() { int width = 0, height = 0; if (sampleEntries.get(0) instanceof VideoSampleEntry) { VideoSampleEntry vse = (VideoSampleEntry) sampleEntries.get(0); PixelAspectExt paspBox = Box.findFirst(vse, PixelAspectExt.class, PixelAspectExt.fourcc()); Rational pasp = paspBox != null ? paspBox.getRational() : new Rational(1, 1); width = (int) (pasp.getNum() * vse.getWidth()) / pasp.getDen(); height = (int) vse.getHeight(); } return new Size(width, height); }
public Size getDisplayDimensions() { int width = 0, height = 0; if (sampleEntries.get(0) instanceof VideoSampleEntry) { VideoSampleEntry vse = (VideoSampleEntry) sampleEntries.get(0); PixelAspectExt paspBox = Box.findFirst(vse, PixelAspectExt.class, PixelAspectExt.fourcc()); Rational pasp = paspBox != null ? paspBox.getRational() : new Rational(1, 1); width = (int) (pasp.getNum() * vse.getWidth()) / pasp.getDen(); height = (int) vse.getHeight(); } return new Size(width, height); }
public static int tv2QTFrameNo(MovieBox movie, long tv) { TrakBox videoTrack = movie.getVideoTrack(); TrakBox timecodeTrack = movie.getTimecodeTrack(); if (timecodeTrack != null && Box.findFirst(videoTrack, "tref", "tmcd") != null) { return timevalueToTimecodeFrame(timecodeTrack, new RationalLarge(tv, videoTrack.getTimescale()), movie.getTimescale()); } else { return timevalueToFrame(videoTrack, tv); } }
public static int tv2QTFrameNo(MovieBox movie, long tv) { TrakBox videoTrack = movie.getVideoTrack(); TrakBox timecodeTrack = movie.getTimecodeTrack(); if (timecodeTrack != null && Box.findFirst(videoTrack, "tref", "tmcd") != null) { return timevalueToTimecodeFrame(timecodeTrack, new RationalLarge(tv, videoTrack.getTimescale()), movie.getTimescale()); } else { return timevalueToFrame(videoTrack, tv); } }