Java 如何让Monte媒体库记录多个监视器?
我正在使用Selenium和JAVA编写一个测试,过了一段时间,我决定这样做,所以我在我的程序中添加了框架,它工作得很好。 但在工作中,我有两个监视器,需要记录这两个监视器, 我还需要指定这个框架保存记录的路径Java 如何让Monte媒体库记录多个监视器?,java,selenium,selenium-webdriver,video-recording,Java,Selenium,Selenium Webdriver,Video Recording,我正在使用Selenium和JAVA编写一个测试,过了一段时间,我决定这样做,所以我在我的程序中添加了框架,它工作得很好。 但在工作中,我有两个监视器,需要记录这两个监视器, 我还需要指定这个框架保存记录的路径 public class MonteRecorder extends ScreenRecorder implements VideoRecorder { static final Logger logger = Logger.getLogger(MonteRecorder.class);
public class MonteRecorder extends ScreenRecorder implements VideoRecorder {
static final Logger logger = Logger.getLogger(MonteRecorder.class);
ScreenRecorder videoRecorder = null;
private String name = null;
/**
* MonteRecorder provides video capture of test script run.
*
* @param name
* video file root name, appended with date time stamp.
* @param movieFolder
* output folder for the video file, the filename will be set
* when the video is started.
* @param dim
* Capturing area for the video
* @throws IOException
* thrown if video file cannot be written to the output-file
* @throws AWTException
* thrown if an error with the capturing area occurs
*/
public MonteRecorder(String name, File movieFolder)
throws IOException, AWTException {
super(
/* default config */
GraphicsEnvironment
.getLocalGraphicsEnvironment()
.getDefaultScreenDevice()
.getDefaultConfiguration(),
/* Screen dimension for capture area */
null,
/* file format */
new Format(MediaTypeKey, MediaType.FILE, MimeTypeKey, MIME_AVI),
/* output format for screen capture */
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),
/* output format for mouse capture */
new Format(MediaTypeKey, MediaType.VIDEO, EncodingKey, "black",
FrameRateKey, Rational.valueOf(30)),
/* output format for audio - null == no audio */
null,
movieFolder);
this.name = name;
}
在参数的末尾添加一个额外的参数,lib中有几个构造函数,您需要一个接受movieFoler的构造函数。
下载好主意,我能问一下你的最后一句话与你的问题有什么关联吗?“我还需要指定此框架保存我的记录的路径。”@Yu Zhang我有两个问题1)记录我的两个监视器2)在windows它将记录保存在Libraries\Videos文件夹,但我希望它保存在我的program文件夹(或任何其他地方)