Java中录制视频

在RPA系统开发中,为了清晰观察Selenium运行过程中的错误,文章介绍了如何使用Java进行视频录制,具体涉及screen-recorder-0.7.7.jar库的应用。
摘要由CSDN通过智能技术生成

由于公司最近做RPA系统比较多,有时候单独的看日志看不出Selenium的具体问题,需要了解运行到哪一步出错,因此需要将RPA运行的过程录制下来。
需要Jar包 screen-recorder-0.7.7.jar

//Video Record
	public static ScreenRecorder createScreenRecorder(String dir_download,String fileName) throws IOException, AWTException {
		ScreenRecorder screenRecorder;
		GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
		screenRecorder = 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, (int)24, FrameRateKey, Rational.valueOf(15),
                        QualityKey, 1.0f,
                        KeyFrameIntervalKey, (int) (15 * 60)),
                new Format(Media
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值