public void fitDuration() {
        KeyFrame kf = timeLine.getKeyFrameAtIndex(timeLine.getLastKeyFrameIndex());
        float d = 0;
        for (int i = 0; i < kf.getCinematicEvents().size(); i++) {
            CinematicEvent ce = kf.getCinematicEvents().get(i);
            float dur = timeLine.getKeyFrameTime(kf) + ce.getDuration() * ce.getSpeed();
            if (d < dur) {
                d = dur;
            }
        }

        initialDuration = d;
    }
fits the duration of the cinematic to the duration of all its child
cinematic events
jme3-core/src/main/java/com/jme3/cinematic/Cinematic.java