コード例 #1
0
ファイル: AVCMP4Mux.java プロジェクト: jaechoon2/jcodec
  private static void addSampleEntry(
      FramesMP4MuxerTrack track, SeqParameterSet[] spss, PictureParameterSet[] ppss) {
    SeqParameterSet sps = spss[0];
    Size size = new Size((sps.pic_width_in_mbs_minus1 + 1) << 4, getPicHeightInMbs(sps) << 4);

    SampleEntry se = MP4Muxer.videoSampleEntry("avc1", size, "JCodec");

    avcC = new AvcCBox(sps.profile_idc, 0, sps.level_idc, write(spss), write(ppss));
    se.add(avcC);
    track.addSampleEntry(se);
  }
コード例 #2
0
  private void cleanDrefs(TrakBox trak) {
    MediaInfoBox minf = trak.getMdia().getMinf();
    DataInfoBox dinf = trak.getMdia().getMinf().getDinf();
    if (dinf == null) {
      dinf = new DataInfoBox();
      minf.add(dinf);
    }

    DataRefBox dref = dinf.getDref();
    if (dref == null) {
      dref = new DataRefBox();
      dinf.add(dref);
    }

    dref.getBoxes().clear();
    dref.add(AliasBox.createSelfRef());

    for (SampleEntry entry :
        NodeBox.findAll(trak, SampleEntry.class, "mdia", "minf", "stbl", "stsd", null)) {
      entry.setDrefInd((short) 1);
    }
  }
コード例 #3
0
 private SeekableByteChannel getInput(Chunk chunk) {
   SampleEntry se = entries[chunk.getEntry() - 1];
   return inputs[se.getDrefInd() - 1];
 }