/** * * @return Horizontal dimension of video track */ public int getWidth() { return ((VideoSampleEntry) videoTrack.getSampleEntries()[0]).getWidth(); }
/** * * @return Horizontal dimension of video track */ public int getWidth() { return ((VideoSampleEntry) videoTrack.getSampleEntries()[0]).getWidth(); }
/** * Retrieves coded size of this video track. * * Note: May be different from video display dimension. * * @return */ public Size getCodedSize() { SampleEntry se = getSampleEntries()[0]; if (!(se instanceof VideoSampleEntry)) throw new IllegalArgumentException("Not a video track"); VideoSampleEntry vse = (VideoSampleEntry) se; return new Size(vse.getWidth(), vse.getHeight()); }
/** * Retrieves coded size of this video track. * * Note: May be different from video display dimension. * * @return */ public Size getCodedSize() { SampleEntry se = getSampleEntries()[0]; if (!(se instanceof VideoSampleEntry)) throw new IllegalArgumentException("Not a video track"); VideoSampleEntry vse = (VideoSampleEntry) se; return new Size(vse.getWidth(), vse.getHeight()); }
/** * Retrieves coded size of this video track. * * Note: May be different from video display dimension. * * @return */ public Size getCodedSize() { SampleEntry se = getSampleEntries()[0]; if (!(se instanceof VideoSampleEntry)) throw new IllegalArgumentException("Not a video track"); VideoSampleEntry vse = (VideoSampleEntry) se; return new Size(vse.getWidth(), vse.getHeight()); }
public Size getDisplayDimensions() { int width = 0, height = 0; if (sampleEntries != null && !sampleEntries.isEmpty() && sampleEntries.get(0) instanceof VideoSampleEntry) { VideoSampleEntry vse = (VideoSampleEntry) sampleEntries.get(0); PixelAspectExt paspBox = NodeBox.findFirst(vse, PixelAspectExt.class, PixelAspectExt.fourcc()); Rational pasp = paspBox != null ? paspBox.getRational() : new Rational(1, 1); width = pasp.getNum() * vse.getWidth() / pasp.getDen(); height = 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 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); }
Picture target1 = Picture.create((ine.getWidth() + 15) & ~0xf, (ine.getHeight() + 15) & ~0xf, ColorSpace.YUV420); Picture rgb = Picture.create(ine.getWidth(), ine.getHeight(), ColorSpace.RGB); ByteBuffer _out = ByteBuffer.allocate(ine.getWidth() * ine.getHeight() * 6); BufferedImage bi = new BufferedImage(ine.getWidth(), ine.getHeight(), BufferedImage.TYPE_3BYTE_BGR); AvcCBox avcC = Box.as(AvcCBox.class, Box.findFirst(ine, LeafBox.class, "avcC"));
public Size getStoredSize() { TrakBox videoTrack = getVideoTrack(); if (videoTrack == null) return null; EncodedPixelBox enof = NodeBox.findFirst(videoTrack, EncodedPixelBox.class, "tapt", "enof"); if (enof != null) { return new Size((int) enof.getWidth(), (int) enof.getHeight()); } Box box = NodeBox.findFirst(videoTrack, SampleDescriptionBox.class, "mdia", "minf", "stbl", "stsd").getBoxes() .get(0); if (box == null || !(box instanceof VideoSampleEntry)) return null; VideoSampleEntry vs = (VideoSampleEntry) box; return new Size((int) vs.getWidth(), (int) vs.getHeight()); }
public Size getStoredSize() { TrakBox videoTrack = getVideoTrack(); if (videoTrack == null) return null; EncodedPixelBox enof = NodeBox.findFirst(videoTrack, EncodedPixelBox.class, "tapt", "enof"); if (enof != null) { return new Size((int) enof.getWidth(), (int) enof.getHeight()); } Box box = NodeBox.findFirst(videoTrack, SampleDescriptionBox.class, "mdia", "minf", "stbl", "stsd").getBoxes() .get(0); if (box == null || !(box instanceof VideoSampleEntry)) return null; VideoSampleEntry vs = (VideoSampleEntry) box; return new Size((int) vs.getWidth(), (int) vs.getHeight()); }
public Size getStoredSize() { TrakBox videoTrack = getVideoTrack(); if (videoTrack == null) return null; EncodedPixelBox enof = NodeBox.findFirstPath(videoTrack, EncodedPixelBox.class, Box.path("tapt.enof")); if (enof != null) { return new Size((int) enof.getWidth(), (int) enof.getHeight()); } Box box = NodeBox.findFirstPath(videoTrack, SampleDescriptionBox.class, Box.path("mdia.minf.stbl.stsd")).getBoxes() .get(0); if (box == null || !(box instanceof VideoSampleEntry)) return null; VideoSampleEntry vs = (VideoSampleEntry) box; return new Size((int) vs.getWidth(), (int) vs.getHeight()); } }
public Size getDisplaySize() { TrakBox videoTrack = getVideoTrack(); if (videoTrack == null) return null; ClearApertureBox clef = NodeBox.findFirst(videoTrack, ClearApertureBox.class, "tapt", "clef"); if (clef != null) { return applyMatrix(videoTrack, new Size((int) clef.getWidth(), (int) clef.getHeight())); } Box box = NodeBox.findFirst(videoTrack, SampleDescriptionBox.class, "mdia", "minf", "stbl", "stsd").getBoxes() .get(0); if (box == null || !(box instanceof VideoSampleEntry)) return null; VideoSampleEntry vs = (VideoSampleEntry) box; Rational par = videoTrack.getPAR(); return applyMatrix(videoTrack, new Size((int) ((vs.getWidth() * par.getNum()) / par.getDen()), (int) vs.getHeight())); }
public Size getDisplaySize() { TrakBox videoTrack = getVideoTrack(); if (videoTrack == null) return null; ClearApertureBox clef = NodeBox.findFirst(videoTrack, ClearApertureBox.class, "tapt", "clef"); if (clef != null) { return applyMatrix(videoTrack, new Size((int) clef.getWidth(), (int) clef.getHeight())); } Box box = NodeBox.findFirst(videoTrack, SampleDescriptionBox.class, "mdia", "minf", "stbl", "stsd").getBoxes() .get(0); if (box == null || !(box instanceof VideoSampleEntry)) return null; VideoSampleEntry vs = (VideoSampleEntry) box; Rational par = videoTrack.getPAR(); return applyMatrix(videoTrack, new Size((int) ((vs.getWidth() * par.getNum()) / par.getDen()), (int) vs.getHeight())); }
@Override public void apply(MovieBox mov) { TrakBox vt = mov.getVideoTrack(); vt.setPAR(newPAR); Box box = NodeBox.findFirstPath(vt, SampleDescriptionBox.class, Box.path("mdia.minf.stbl.stsd")).getBoxes() .get(0); if (box != null && (box instanceof VideoSampleEntry)) { VideoSampleEntry vs = (VideoSampleEntry) box; int codedWidth = (int) vs.getWidth(); int codedHeight = (int) vs.getHeight(); int displayWidth = codedWidth * newPAR.getNum() / newPAR.getDen(); vt.getTrackHeader().setWidth(displayWidth); if (BoxUtil.containsBox(vt, "tapt")) { vt.setAperture(new Size(codedWidth, codedHeight), new Size(displayWidth, codedHeight)); } } }
public Size getDisplaySize() { TrakBox videoTrack = getVideoTrack(); if (videoTrack == null) return null; ClearApertureBox clef = NodeBox.findFirstPath(videoTrack, ClearApertureBox.class, Box.path("tapt.clef")); if (clef != null) { return applyMatrix(videoTrack, new Size((int) clef.getWidth(), (int) clef.getHeight())); } Box box = NodeBox.findFirstPath(videoTrack, SampleDescriptionBox.class, Box.path("mdia.minf.stbl.stsd")).getBoxes() .get(0); if (box == null || !(box instanceof VideoSampleEntry)) return null; VideoSampleEntry vs = (VideoSampleEntry) box; Rational par = videoTrack.getPAR(); return applyMatrix(videoTrack, new Size((int) ((vs.getWidth() * par.getNum()) / par.getDen()), (int) vs.getHeight())); }