2

HTML 文件通过双击打开。播放器屏幕是黑色的,如果我点击播放按钮,它会直接跳到最后。但是,如果我拖动视频播放器的手柄,我可以在屏幕上看到视频中的一些镜头。

这是 HTML 文件:

<!DOCTYPE html>
<html>
<body>

<video width="400" controls="controls">
  <source src="video.mp4" type="video/mp4">
  Your browser does not support HTML5 video.
</video>

</body>
</html>

这是视频生成 Java 代码:

private LinkedList<BufferedImage> buffer;
...
public void saveVideo (File f) throws IOException {
        if (converting) return;
        System.out.println("Attempting to save video");
        synchronized (lock) {
            System.out.println("Starting the conversation");
            converting = true;

            SequenceEncoder enc = new SequenceEncoder(f);

            while(!buffer.isEmpty()) {
                BufferedImage image = buffer.getFirst();
                buffer.removeFirst();
                enc.encodeImage(image);
            }
            enc.finish();

            System.out.println("Finished the conversation");
            converting = false;
        }
    }
4

0 回答 0