Package yearreview.app.render
Class VideoWorker
java.lang.Object
yearreview.app.render.VideoWorker
A class that pipes the generated images from the
Renderer
into an ffmpeg-subprocess to render the video.- Author:
- ColdStone37
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Process
ffmpeg-subprocess used for creating the video-file.private final OutputStream
Stream used to input raw frames into ffmpeg.private static final Logger
-
Constructor Summary
ConstructorDescriptionDefault Constructor for a VideoWorker that starts the ffmpeg-subprocess. -
Method Summary
Modifier and TypeMethodDescriptionvoid
end()
Ends the ffmpeg-process.void
writeFrame
(BufferedImage image) Writes aBufferedImage
to theOutputStream
connected to ffmpeg.
-
Field Details
-
ffmpeg
ffmpeg-subprocess used for creating the video-file. -
ffmpegInput
Stream used to input raw frames into ffmpeg. -
logger
-
-
Constructor Details
-
VideoWorker
public VideoWorker()Default Constructor for a VideoWorker that starts the ffmpeg-subprocess.
-
-
Method Details
-
writeFrame
Writes aBufferedImage
to theOutputStream
connected to ffmpeg.- Parameters:
image
- image that should be encoded by ffmpeg. Must useBufferedImage.TYPE_3BYTE_BGR
.
-
end
public void end()Ends the ffmpeg-process.
-