英文:
How to reduce video size with Java's Monte Screen Recorder
问题
我正在使用 Monte Screen Recorder 进行屏幕录制,但输出文件非常大。我认为可以尝试使用 MP4 H.264 来减小文件大小,或者通过降低视频比特率来实现。然而,我不知道如何更改这些设置。也许我需要使用第三方的 Java 库来转换文件,然后删除原始文件?有没有人对如何最好地做到这一点有什么想法。下面是我初始化 ScreenRecorder 的方式:
screenLogger = new ScreenRecorder(gc, null,
new Format(MediaTypeKey, MediaType.FILE, MimeTypeKey, MIME_AVI),
new Format(MediaTypeKey, MediaType.VIDEO, EncodingKey, ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE,
CompressorNameKey, ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE,
DepthKey, 24, FrameRateKey, Rational.valueOf(15),
QualityKey, 1.0f,
KeyFrameIntervalKey, 15 * 60),
new Format(MediaTypeKey, MediaType.VIDEO, EncodingKey, "black",
FrameRateKey, Rational.valueOf(30)),
null, new File(pathToFile));
英文:
I'm recording my screen using Monte Screen Recorder, but the output files are huge. I think I could reduce the file size using MP4 H.264 or maybe turning the video bit rate down somehow. However, I have no idea how to change those settings. Maybe I need to use a secondary java library to convert the file then delete the original? Anyone have any ideas on the best way to do this. Here is how I'm initializing the ScreenRecorder:
screenLogger = new ScreenRecorder(gc, null,
new Format(MediaTypeKey, MediaType.FILE, MimeTypeKey, MIME_AVI),
new Format(MediaTypeKey, MediaType.VIDEO, EncodingKey, ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE,
CompressorNameKey, ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE,
DepthKey, 24, FrameRateKey, Rational.valueOf(15),
QualityKey, 1.0f,
KeyFrameIntervalKey, 15 * 60),
new Format(MediaTypeKey, MediaType.VIDEO, EncodingKey, "black",
FrameRateKey, Rational.valueOf(30)),
null, new File(pathToFile));
专注分享java语言的经验与见解,让所有开发者获益!
评论