public static SampleSizesBox createSampleSizesBox2(int[] sizes) { SampleSizesBox stsz = new SampleSizesBox(new Header(fourcc())); stsz.sizes = sizes; stsz.count = sizes.length; return stsz; }
public static EsdsBox createEsdsBox(ByteBuffer streamInfo, int objectType, int bufSize, int maxBitrate, int avgBitrate, int trackId) { EsdsBox esds = new EsdsBox(new Header(fourcc())); esds.objectType = objectType; esds.bufSize = bufSize; esds.maxBitrate = maxBitrate; esds.avgBitrate = avgBitrate; esds.trackId = trackId; esds.streamInfo = streamInfo; return esds; }
public static TrunBox createTrunBox1(int sampleCount) { TrunBox trun = new TrunBox(new Header(fourcc())); trun.sampleCount = sampleCount; return trun; }
public static AvcCBox createAvcCBox(int profile, int profileCompat, int level, int nalLengthSize, List<ByteBuffer> spsList, List<ByteBuffer> ppsList) { AvcCBox avcc = new AvcCBox(new Header(fourcc())); avcc.profile = profile; avcc.profileCompat = profileCompat; avcc.level = level; avcc.nalLengthSize = nalLengthSize; avcc.spsList = spsList; avcc.ppsList = ppsList; return avcc; }
public static SampleToChunkBox createSampleToChunkBox(SampleToChunkEntry[] sampleToChunk) { SampleToChunkBox box = new SampleToChunkBox(new Header(fourcc())); box.sampleToChunk = sampleToChunk; return box; } private SampleToChunkEntry[] sampleToChunk;
public static TrackFragmentHeaderBox createTrackFragmentHeaderBoxWithId(int trackId) { TrackFragmentHeaderBox box = new TrackFragmentHeaderBox(new Header(fourcc())); box.trackId = trackId; return box; }
public static ColorExtension createColorExtension(short primariesIndex, short transferFunctionIndex, short matrixIndex) { ColorExtension c = new ColorExtension(new Header(fourcc())); c.primariesIndex = primariesIndex; c.transferFunctionIndex = transferFunctionIndex; c.matrixIndex = matrixIndex; return c; }
public FileTypeBox(String majorBrand, int minorVersion, Collection<String> compBrands) { super(new Header(fourcc())); this.majorBrand = majorBrand; this.minorVersion = minorVersion; this.compBrands = compBrands; }
public FielExtension(byte type, byte order) { super(new Header(fourcc())); this.type = type; this.order = order; }
public MediaHeaderBox(int timescale, long duration, int language, long created, long modified, int quality) { super(new Header(fourcc())); this.timescale = timescale; this.duration = duration; this.language = language; this.created = created; this.modified = modified; this.quality = quality; }
public static VideoMediaHeaderBox createVideoMediaHeaderBox(int graphicsMode, int rOpColor, int gOpColor, int bOpColor) { VideoMediaHeaderBox vmhd = new VideoMediaHeaderBox(new Header(fourcc())); vmhd.graphicsMode = graphicsMode; vmhd.rOpColor = rOpColor; vmhd.gOpColor = gOpColor; vmhd.bOpColor = bOpColor; return vmhd; }
public MP4Muxer(SeekableByteChannel output, FileTypeBox ftyp) throws IOException { this.out = output; ByteBuffer buf = ByteBuffer.allocate(1024); ftyp.write(buf); new Header("wide", 8).write(buf); new Header("mdat", 1).write(buf); mdatOffset = buf.position(); buf.putLong(0); buf.flip(); output.write(buf); }
protected void putEdits(TrakBox trak) { if (edits != null) { NodeBox edts = new NodeBox(new Header("edts")); edts.add(EditListBox.createEditListBox(edits)); trak.add(edts); } }
public static Box parseBox(ByteBuffer input, Header childAtom, BoxFactory factory) { Box box = newBox(childAtom, factory); if (childAtom.getBodySize() < MAX_BOX_SIZE) { box.parse(input); return box; } else { return new LeafBox(new Header("free", 8)); } }
public static PixelAspectExt createPixelAspectExt(Rational par) { PixelAspectExt pasp = new PixelAspectExt(new Header(fourcc())); pasp.hSpacing = par.getNum(); pasp.vSpacing = par.getDen(); return pasp; }
public static VideoSampleEntry videoSampleEntry(String fourcc, Size size, String encoderName) { return createVideoSampleEntry(new Header(fourcc), (short) 0, (short) 0, "jcod", 0, 768, (short) size.getWidth(), (short) size.getHeight(), 72, 72, (short) 1, encoderName != null ? encoderName : "jcodec", (short) 24, (short) 1, (short) -1); }
public void setEdits(List<Edit> edits) { NodeBox edts = findFirst(this, NodeBox.class, "edts"); if (edts == null) { edts = new NodeBox(new Header("edts")); this.add(edts); } edts.removeChildren("elst"); edts.add(new EditListBox(edits)); getTrackHeader().setDuration(getEditedDuration(this)); }
public void setEdits(List<Edit> edits) { NodeBox edts = NodeBox.findFirst(this, NodeBox.class, "edts"); if (edts == null) { edts = new NodeBox(new Header("edts")); this.add(edts); } edts.removeChildren("elst"); edts.add(EditListBox.createEditListBox(edits)); getTrackHeader().setDuration(getEditedDuration(this)); }
public void tapt(TrakBox trak) { Size dd = getDisplayDimensions(); if (type == VIDEO) { NodeBox tapt = new NodeBox(new Header("tapt")); tapt.add(new ClearApertureBox(dd.getWidth(), dd.getHeight())); tapt.add(new ProductionApertureBox(dd.getWidth(), dd.getHeight())); tapt.add(new EncodedPixelBox(dd.getWidth(), dd.getHeight())); trak.add(tapt); } }
public void setAperture(Size sar, Size dar) { removeChildren("tapt"); NodeBox tapt = new NodeBox(new Header("tapt")); tapt.add(new ClearApertureBox(dar.getWidth(), dar.getHeight())); tapt.add(new ProductionApertureBox(dar.getWidth(), dar.getHeight())); tapt.add(new EncodedPixelBox(sar.getWidth(), sar.getHeight())); add(tapt); }