/** * Create an instance of {@link TimecodesType } * */ public TimecodesType createTimecodesType() { return new TimecodesType(); }
TimecodesType timecodes = new TimecodesType(); TimecodeType lineUpStart = new TimecodeType(); lineUpStart.setValue(LINE_UP_START); DurationType zeroDuration = new DurationType(); zeroDuration.setValue("00:00:00:00"); timecodes.setLineUpStart(lineUpStart); timecodes.setIdentClockStart(identClockStart); timecodes.setTotalNumberOfParts(1); timecodes.setTotalProgrammeDuration(zeroDuration); segment.setPartDuration(zeroDuration); segmentation.getPart().add(segment); timecodes.setParts(segmentation);
private void fillTcp() { TCP.fillEmptyValue(); if (metadata.getTechnical().getTimecodes() == null) { return; } if (metadata.getTechnical().getTimecodes().getParts() == null) { return; } if (metadata.getTechnical().getTimecodes().getParts().getPart() == null) { return; } if (metadata.getTechnical().getTimecodes().getParts().getPart().isEmpty()) { return; } TimecodeType tc = metadata.getTechnical().getTimecodes().getParts().getPart().get(0).getPartSOM(); String[] parts = tc.getValue().split("[:;]"); StringBuilder sb = new StringBuilder(); for (String part : parts) { if (part.length() == 1) { sb.append("0"); sb.append(part); } else if (part.length() > 2) { sb.append(part.substring(part.length() - 2, part.length())); } else { sb.append(part); } } TCP.setValue(sb.toString()); }
/** * Check that total duration specified in Metadata.xml is less than total duration of the output file. * Otherwise conversion will abort at the very last step (BMX). It may make the user unhappy after a long conversion. */ private void checkTotalDuration() { String metadataTotalDurationTc = metadataXmlProvider.getDpp().getTechnical().getTimecodes().getTotalProgrammeDuration().getValue(); if (StringUtils.isEmpty(metadataTotalDurationTc)) { return; } String destFps = contextProvider.getDestContext().getParameterValue(DestContextParameters.FRAME_RATE); if (destFps == null) { destFps = MetadataXmlProvider.DEST_FRAME_RATE; } BigFraction fps = ConversionHelper.parseEditRate(destFps); long metadataTotalDurationMs = ConversionHelper.smpteTimecodeToMilliSeconds( metadataTotalDurationTc, fps); long cplTotalDurationMs = getCplTotalDurationMs(); // BMX accepts any total duration if zero timecode is specified in metadata.xml if (metadataTotalDurationMs == 0) { return; } if (metadataTotalDurationMs > cplTotalDurationMs) { throw new ConversionException( String.format("A total programme duration as specified in metadata.xml (%s, %s ms) exceeds a " + "total duration of the output as defined by the CPL (%s, %s ms) ", metadataTotalDurationTc, String.valueOf(metadataTotalDurationMs), ConversionHelper.msToSmpteTimecode(cplTotalDurationMs, fps), String.valueOf(cplTotalDurationMs))); } }
/** * Create an instance of {@link TimecodesType } * */ public TimecodesType createTimecodesType() { return new TimecodesType(); }