public static String encodeHex(byte[] data) { return encodeHex(data, 0); }
esds.setData(ByteBuffer.wrap(Hex.decodeHex("038080801B000100048080800D6C11000000000A1CB4000A1CB4068080800102"))); esds.setEsDescriptor((ESDescriptor) ObjectDescriptorFactory.createFrom(-1, ByteBuffer.wrap(Hex.decodeHex("038080801B000100048080800D6C11000000000A1CB4000A1CB4068080800102")))); mp4v.addBox(esds); this.syncSamples = new long[jpegs.length];
videoKey = new SecretKeySpec(Hex.decodeHex(this.encKeySecretKeyVideo), "AES"); } else if (this.encKeySecretKeyFileVideo != null) { try { videoKey = new SecretKeySpec(Hex.decodeHex(FileUtils.readFileToString(this.encKeySecretKeyFileVideo)), "AES"); } catch (IOException e) { throw new CmdLineException(cmdLineParser, new Message("Content Encryption Key file " + this.encKeySecretKeyFileAudio.getAbsolutePath() + " could not be read")); audioKey = new SecretKeySpec(Hex.decodeHex(this.encKeySecretKeyAudio), "AES"); } else if (this.encKeySecretKeyFileAudio != null) { try { audioKey = new SecretKeySpec(Hex.decodeHex(FileUtils.readFileToString((this.encKeySecretKeyFileAudio))), "AES"); } catch (IOException e) { throw new CmdLineException(cmdLineParser, new Message("Content Encryption Key file " + this.encKeySecretKeyFileAudio.getAbsolutePath() + " could not be read"));
@Override public String toString() { return "Entry{" + "iv=" + Hex.encodeHex(iv) + ", pairs=" + Arrays.toString(pairs) + '}'; }
esds.setData(ByteBuffer.wrap(Hex.decodeHex("038080801B000100048080800D6C11000000000A1CB4000A1CB4068080800102"))); esds.setEsDescriptor((ESDescriptor) ObjectDescriptorFactory.createFrom(-1, ByteBuffer.wrap(Hex.decodeHex("038080801B000100048080800D6C11000000000A1CB4000A1CB4068080800102")))); mp4v.addBox(esds); this.syncSamples = new long[jpegs.length];
public List<String> getSequenceParameterSetExtsAsStrings() { List<String> result = new ArrayList<String>(sequenceParameterSetExts.size()); for (ByteBuffer parameterSet : sequenceParameterSetExts) { result.add(Hex.encodeHex(parameterSet)); } return result; }
public List<String> getSequenceParameterSetsAsStrings() { List<String> result = new ArrayList<String>(sequenceParameterSets.size()); for (ByteBuffer parameterSet : sequenceParameterSets) { result.add(Hex.encodeHex(parameterSet)); } return result; }
public List<String> getPictureParameterSetsAsStrings() { List<String> result = new ArrayList<String>(pictureParameterSets.size()); for (ByteBuffer parameterSet : pictureParameterSets) { result.add(Hex.encodeHex(parameterSet)); } return result; }
@Override public String toString() { ByteBuffer bb = content.duplicate(); bb.rewind(); byte[] b = new byte[bb.limit()]; bb.get(b); return "UnknownEntry{" + "content=" + Hex.encodeHex(b) + '}'; }
@Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("DecoderSpecificInfo"); sb.append("{bytes=").append(bytes == null ? "null" : Hex.encodeHex(bytes)); sb.append('}'); return sb.toString(); }
@Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("ExtensionDescriptor"); sb.append("{bytes=").append(bytes == null ? "null" : Hex.encodeHex(bytes)); sb.append('}'); return sb.toString(); } }
@Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("ExtensionDescriptor"); sb.append("tag=").append(tag); sb.append(",bytes=").append(Hex.encodeHex(data.array())); sb.append('}'); return sb.toString(); }
@Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("ProtectionSpecificHeader"); sb.append("{data="); ByteBuffer data = getData().duplicate(); data.rewind(); byte[] bytes = new byte[data.limit()]; data.get(bytes); sb.append(Hex.encodeHex(bytes)); sb.append('}'); return sb.toString(); } }
@Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("DecoderConfigDescriptor"); sb.append("{objectTypeIndication=").append(objectTypeIndication); sb.append(", streamType=").append(streamType); sb.append(", upStream=").append(upStream); sb.append(", bufferSizeDB=").append(bufferSizeDB); sb.append(", maxBitRate=").append(maxBitRate); sb.append(", avgBitRate=").append(avgBitRate); sb.append(", decoderSpecificInfo=").append(decoderSpecificInfo); sb.append(", audioSpecificInfo=").append(audioSpecificInfo); sb.append(", configDescriptorDeadBytes=").append(Hex.encodeHex(configDescriptorDeadBytes != null ? configDescriptorDeadBytes : new byte[]{})); sb.append(", profileLevelIndicationDescriptors=").append(profileLevelIndicationDescriptors == null ? "null" : profileLevelIndicationDescriptors); sb.append('}'); return sb.toString(); } /*objectTypeIndication values
throw new RuntimeException("we have a userType but no uuid box type. Something's wrong"); constructor = mapping.getProperty("uuid[" + Hex.encodeHex(userType).toUpperCase() + "]"); if (constructor == null) { constructor = mapping.getProperty((parent) + "-uuid[" + Hex.encodeHex(userType).toUpperCase() + "]");
final StringBuilder sb = new StringBuilder(); sb.append("AudioSpecificConfig"); sb.append("{configBytes=").append(Hex.encodeHex(configBytes)); sb.append(", audioObjectType=").append(audioObjectType).append(" (").append(audioObjectTypeMap.get(audioObjectType)).append(")"); sb.append(", samplingFrequencyIndex=").append(samplingFrequencyIndex).append(" (").append(samplingFrequencyIndexMap.get(samplingFrequencyIndex)).append(")");
public static void main(String[] args) throws IOException { IsoFile isofile = new IsoFile("C:\\content\\bbb-small\\output_320x180-mjpeg.mp4"); ESDescriptorBox esDescriptorBox = Path.getPath(isofile, "/moov[0]/trak[0]/mdia[0]/minf[0]/stbl[0]/stsd[0]/mp4v[0]/esds[0]"); byte[] d = new byte[esDescriptorBox.getData().rewind().remaining()]; esDescriptorBox.getData().get(d); System.err.println(Hex.encodeHex(d)); Movie mRef = MovieCreator.build("C:\\content\\bbb-small\\output_320x180_150.mp4"); Track refTrack = mRef.getTracks().get(0); File baseDir = new File("C:\\content\\bbb-small"); File[] iFrameJpegs = baseDir.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return name.endsWith(".jpg"); } }); Arrays.sort(iFrameJpegs); Movie mRes = new Movie(); mRes.addTrack(new OneJpegPerIframe("iframes", iFrameJpegs, refTrack)); new DefaultMp4Builder().build(mRes).writeContainer(new FileOutputStream("output-mjpeg.mp4").getChannel()); } }
public static String encodeHex(byte[] data) { return encodeHex(data, 0); }
static String hexByte(long l) { return Hex.encodeHex(new byte[]{(byte) (l & 0xFF)}); }