如何使用Java的Monte屏幕录制器来减小视频大小

huangapple 未分类评论44阅读模式
英文:

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));

huangapple
  • 本文由 发表于 2020年7月24日 08:23:06
  • 转载请务必保留本文链接:https://java.coder-hub.com/63065020.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定