public RationalLarge divideByLong(long scalar) { return new RationalLarge(num, den * scalar); }
public static RationalLarge R(long num) { return R(num, 1); }
protected long withTimestamp(long pts, boolean isPts) { return scale.multiplyS(pts); } }.fix(src);
int newTimescale = (int) newFPS.multiply(new RationalLarge(totalDuration, nSamples)).scalarClip(); if (newTimescale >= MIN_TIMESCALE_ALLOWED) { } else { double mul = new RationalLarge(vt.getTimescale() * totalDuration, nSamples).divideBy(newFPS) .scalar(); Logger.info("Applying multiplier to sample durations: " + mul); for (TimeToSampleEntry e : entries) { vt.setDuration(newDuration); } else { Logger.info("Already at " + newFPS.toString() + "fps, not changing.");
/** * Calculates and formats tape timecode as in Quicktime player * * @param timecodeTrack * @param tv * @param startCounter * @return * @throws IOException */ public static String qtPlayerTimecode(TimecodeMP4DemuxerTrack timecodeTrack, RationalLarge tv, int movieTimescale) throws IOException { TrakBox tt = timecodeTrack.getBox(); int ttTimescale = tt.getTimescale(); long ttTv = editedToMedia(tt, tv.multiplyS(ttTimescale), movieTimescale); return formatTimecode( timecodeTrack.getBox(), timecodeTrack.getStartTimecode() + timevalueToTimecodeFrame(timecodeTrack.getBox(), new RationalLarge(ttTv, ttTimescale), movieTimescale)); }
/** * * @return Duration of video track in seconds */ public double getDuration() { return videoTrack.getDuration().scalar(); }
final RationalLarge scale = RationalLarge.parse(cmd.getArg(1)); new BaseCommand(stream) { protected long withTimestamp(long pts, boolean isPts) {
/** * Calculates and formats tape timecode as in Quicktime player * * @param timecodeTrack * @param tv * @param startCounter * @return * @throws IOException */ public static String qtPlayerTimecode(TimecodeMP4DemuxerTrack timecodeTrack, RationalLarge tv, int movieTimescale) throws IOException { TrakBox tt = timecodeTrack.getBox(); int ttTimescale = tt.getTimescale(); long ttTv = editedToMedia(tt, tv.multiplyS(ttTimescale), movieTimescale); return formatTimecode( timecodeTrack.getBox(), timecodeTrack.getStartTimecode() + timevalueToTimecodeFrame(timecodeTrack.getBox(), new RationalLarge(ttTv, ttTimescale), movieTimescale)); }
/** * * @return Duration of video track in seconds */ public double getDuration() { return videoTrack.getDuration().scalar(); }
System.exit(-1); final RationalLarge newFPS = RationalLarge.parse(cmd.getArg(1));
public static RationalLarge R(long num, long den) { return new RationalLarge(num, den); }
/** * Calculates and formats tape timecode as in Quicktime player * * @param timecodeTrack * @param tv * @param startCounter * @return * @throws IOException */ public static String qtPlayerTimecode(TimecodeMP4DemuxerTrack timecodeTrack, RationalLarge tv, int movieTimescale) throws IOException { TrakBox tt = timecodeTrack.getBox(); int ttTimescale = tt.getTimescale(); long ttTv = editedToMedia(tt, tv.multiplyS(ttTimescale), movieTimescale); return formatTimecode( timecodeTrack.getBox(), timecodeTrack.getStartTimecode() + timevalueToTimecodeFrame(timecodeTrack.getBox(), new RationalLarge(ttTv, ttTimescale), movieTimescale)); }
public RationalLarge getPtsR() { return RationalLarge.R(pts, timescale); }
/** * Converts timevalue to frame number based on timecode track * * @param timecodeTrack * @param tv * @return */ public static int timevalueToTimecodeFrame(TrakBox timecodeTrack, RationalLarge tv, int movieTimescale) { TimecodeSampleEntry se = (TimecodeSampleEntry) timecodeTrack.getSampleEntries()[0]; return (int) ((2 * tv.multiplyS(se.getTimescale()) / se.getFrameDuration()) + 1) / 2; }
public RationalLarge minus(long scalar) { return new RationalLarge(num - scalar * den, den); }
public RationalLarge getPtsR() { return RationalLarge.R(pts, timescale); }
/** * Converts timevalue to frame number based on timecode track * * @param timecodeTrack * @param tv * @return */ public static int timevalueToTimecodeFrame(TrakBox timecodeTrack, RationalLarge tv, int movieTimescale) { TimecodeSampleEntry se = (TimecodeSampleEntry) timecodeTrack.getSampleEntries()[0]; return (int) ((2 * tv.multiplyS(se.getTimescale()) / se.getFrameDuration()) + 1) / 2; }
public static RationalLarge R(long num, long den) { return new RationalLarge(num, den); }
public static RationalLarge R1(long num) { return R(num, 1); }