public static SampleEntry createMOVSampleEntryFromAvcC(AvcCBox avcC) { SeqParameterSet sps = SeqParameterSet.read(avcC.getSpsList().get(0).duplicate()); int codedWidth = (sps.picWidthInMbsMinus1 + 1) << 4; int codedHeight = SeqParameterSet.getPicHeightInMbs(sps) << 4; SampleEntry se = VideoSampleEntry.videoSampleEntry("avc1", getPicSize(sps), "JCodec"); se.add(avcC); return se; }
public void setPAR(Rational par) { for (SampleEntry sampleEntry : getSampleEntries()) { sampleEntry.removeChildren("pasp"); sampleEntry.add(new PixelAspectExt(par)); } }
public void setPAR(Rational par) { SampleEntry[] sampleEntries = getSampleEntries(); for (int i = 0; i < sampleEntries.length; i++) { SampleEntry sampleEntry = sampleEntries[i]; sampleEntry.removeChildren("pasp"); sampleEntry.add(PixelAspectExt.createPixelAspectExt(par)); } }
public void setPAR(Rational par) { for (SampleEntry sampleEntry : getSampleEntries()) { sampleEntry.removeChildren("pasp"); sampleEntry.add(new PixelAspectExt(par)); } }
public void setCodecPrivateIfNeeded() { if (codec == Codec.H264) { List<ByteBuffer> sps = selectUnique(spsList); List<ByteBuffer> pps = selectUnique(ppsList); if (!sps.isEmpty() && !pps.isEmpty()) { getEntries().get(0).add(H264Utils.createAvcCFromPS(sps, pps, 4)); } else { Logger.warn("CodecMP4MuxerTrack: Not adding a sample entry for h.264 track, missing any SPS/PPS NAL units"); } } else if (codec == Codec.AAC) { if (adtsHeader != null) { getEntries().get(0).add(EsdsBox.fromADTS(adtsHeader)); } else { Logger.warn("CodecMP4MuxerTrack: Not adding a sample entry for AAC track, missing any ADTS headers."); } } }
Size size = new Size(width, height); SampleEntry sampleEntry = MP4Muxer.videoSampleEntry("avc1", size, "OpenH264"); sampleEntry.add(avcCBox);
Size size = new Size(width, height); SampleEntry sampleEntry = MP4Muxer.videoSampleEntry("avc1", size, "OpenH264"); sampleEntry.add(avcCBox);
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 static void _setLabels(TrakBox trakBox, Label[] labels) { ChannelBox channel = NodeBox.findFirstPath(trakBox, ChannelBox.class, new String[] { "mdia", "minf", "stbl", "stsd", null, "chan" }); if (channel == null) { channel = ChannelBox.createChannelBox(); NodeBox.findFirstPath(trakBox, SampleEntry.class, new String[] { "mdia", "minf", "stbl", "stsd", null }).add(channel); } setLabels(labels, channel); }
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); }
void addVideoSampleEntry(VideoCodecMeta meta) { SampleEntry se = VideoSampleEntry.videoSampleEntry(codec2fourcc.get(codec), meta.getSize(), "JCodec"); if (meta.getPixelAspectRatio() != null) se.add(PixelAspectExt.createPixelAspectExt(meta.getPixelAspectRatio())); addSampleEntry(se); }
se.add(avcC); track.addSampleEntry(se);