Scratch for Java

FFmpegRecorder::stop()

This works in a project you run on your own computer, but not in the examples you can start here in the browser. There is no file system, no video encoder and no OpenGL behind a web page, so calling it there tells you as much and does nothing.

Stops the recording process and converts the recorded frames into a video file using FFmpeg.

This method overrides the stop method from the superclass. It first calls the superclass's stop method, then checks if the temporary directory (tmpDir) is not null. If it is not null, it constructs a command to run FFmpeg, which converts the recorded frames (stored as PNG files) into a video file with the specified frame rate and codec.

The FFmpeg command is executed, and a message is printed to the console indicating that the video conversion is in progress. If there is an error during the execution of the command, the error message is printed to the console.

Syntax

Java

.stop()

Return

void

stop()

Create Shareable URL

Select Sections