use of org.monte.media.Format in project selenium_java by sergueik.
the class VideoRecorder method startRecording.
public void startRecording(WebDriver driver) {
try {
GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
File dir = new File(RECORD_DIRECTORY);
Point point = driver.manage().window().getPosition();
Dimension dimension = driver.manage().window().getSize();
System.err.println(" Rectangle: " + dimension.width + " " + dimension.height);
Rectangle rectangle = new Rectangle(point.x, point.y, dimension.width, dimension.height);
this.screenRecorder = new ScreenRecorder(gc, rectangle, 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, dir);
this.screenRecorder.start();
} catch (Exception e) {
System.out.println(e);
}
}
use of org.monte.media.Format in project NoraUi by NoraUi.
the class ScreenServiceImpl method startVideoCapture.
/**
* {@inheritDoc}
*/
@Override
public void startVideoCapture(String screenName) throws IOException, AWTException {
File file = new File(System.getProperty(USER_DIR) + File.separator + DOWNLOADED_FILES_FOLDER);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Rectangle captureSize = new Rectangle(0, 0, screenSize.width, screenSize.height);
GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
this.screenRecorder = new NoraUiScreenRecorder(gc, captureSize, 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, file, screenName);
this.screenRecorder.start();
}
use of org.monte.media.Format in project carina by qaprosoft.
the class DesktopVideoRecorder method startDesktopScreenRecording.
/**
* start Desktop Recording with a lot of parameters.
* if you have more than one monitor it will record just first one.
*
* Requirements:
* ScreenRecoder supports "AVI" and "QuickTime" format for recording the video.
* For "AVI" format you need to install TSCC Codec (Techsmith Screen Capture Codec)
* while "QuickTime" format is supported by Appleās QuickTime Player.
* https://www.techsmith.com/download.html
* https://1481d.wpc.azureedge.net/801481D/origin.assets.techsmith.com/Downloads/TSCC.msi
*
* @param fileNameBase String
* @param file File
* @param captureSize Rectangle
* @param videoFileFormat can be VideoFormat.AVI or VideoFormat.MOV
* @param withSound if true will try to record sound. Works only on MOV and with a lot of noises.
* @throws Exception java.lang.Exception
*/
public void startDesktopScreenRecording(String fileNameBase, File file, Rectangle captureSize, VideoFormat videoFileFormat, boolean withSound) throws Exception {
GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
Format audio = null;
// AVI format
if (videoFileFormat.equals(VideoFormat.AVI)) {
if (withSound) {
// Not working AVI audio capabilities. Investigate if will be needed.
/*
* audio = new Format(MediaTypeKey, MediaType.AUDIO,
* EncodingKey, ENCODING_AVI_PCM,
* ByteOrderKey,ByteOrder.LITTLE_ENDIAN,
* SignedKey,true,SampleSizeInBitsKey,24);
*/
/*
* audio = new Format(MediaTypeKey,MediaType.AUDIO,EncodingKey,ENCODING_PCM_UNSIGNED,
* FrameRateKey, new Rational(48000L, 1L),
* SampleSizeInBitsKey, 16,
* ChannelsKey, 2,
* SignedKey,false);
*/
/*
* audio = new Format(MediaTypeKey, MediaType.AUDIO,
* EncodingKey, ENCODING_PCM_UNSIGNED,
* FrameRateKey, new Rational(48000L, 1L),
* SampleSizeInBitsKey,8,
* ChannelsKey, 2,
* SampleRateKey, new Rational(48000L, 1L),
* SignedKey, Boolean.valueOf(false)
* //,
* //AudioFormatKeys.ByteOrderKey, ByteOrder.BIG_ENDIAN
* );
*/
}
this.screenRecorder = new SpecializedScreenRecorder(gc, captureSize, 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)), audio, file, fileNameBase);
}
// MOV format
if (videoFileFormat.equals(VideoFormat.MOV)) {
if (withSound) {
audio = new Format(MediaTypeKey, MediaType.AUDIO, EncodingKey, ENCODING_QUICKTIME_TWOS_PCM, FrameRateKey, new Rational(48000L, 1L), SampleSizeInBitsKey, 16, ChannelsKey, 2, SampleRateKey, new Rational(48000L, 1L), SignedKey, Boolean.valueOf(true), AudioFormatKeys.ByteOrderKey, ByteOrder.BIG_ENDIAN);
}
this.screenRecorder = new SpecializedScreenRecorder(gc, captureSize, new Format(MediaTypeKey, MediaType.FILE, FormatKeys.MimeTypeKey, MIME_QUICKTIME), new Format(MediaTypeKey, MediaType.VIDEO, EncodingKey, ENCODING_QUICKTIME_ANIMATION, CompressorNameKey, COMPRESSOR_NAME_QUICKTIME_ANIMATION, DepthKey, 24, FrameRateKey, Rational.valueOf(15)), new Format(MediaTypeKey, MediaType.VIDEO, EncodingKey, "black", FrameRateKey, Rational.valueOf(30)), audio, file, fileNameBase);
}
LOGGER.info("Start video recording. \nAbsolute path: " + file.getAbsolutePath() + " . \nStarting name is '" + fileNameBase + "'. \nDimensions: " + captureSize.toString());
this.screenRecorder.start();
}
use of org.monte.media.Format in project acceptance-test-harness by jenkinsci.
the class TestRecorderRule method startRecording.
private void startRecording(Description des) {
try {
GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
String mimeType = FormatKeys.MIME_QUICKTIME;
String videoFormatName = VideoFormatKeys.ENCODING_QUICKTIME_ANIMATION;
String compressorName = VideoFormatKeys.COMPRESSOR_NAME_QUICKTIME_ANIMATION;
Dimension outputDimension = gc.getBounds().getSize();
int bitDepth = BIT_DEPTH;
float quality = QUALITY_RATIO;
int screenRate = FRAME_RATE_PER_SEC;
Format outputFormatForScreenCapture = getOutputFormatForScreenCapture(videoFormatName, compressorName, outputDimension, bitDepth, quality, screenRate);
this.screenRecorder = new JUnitScreenRecorder(gc, gc.getBounds(), getFileFormat(mimeType), outputFormatForScreenCapture, null, null, diagnostics);
this.screenRecorder.start();
} catch (HeadlessException e) {
logger.warning("Test recorder does not work with Headless mode");
this.headless = true;
} catch (UnsupportedOperationException | IOException | AWTException e) {
logger.log(Level.WARNING, "Exception starting test recording", e);
}
}
Aggregations