Code Monkey home page Code Monkey logo

automatedscreenrecorder's Introduction

Automated Screen Recorder

Purpose

The automated screen recorder project allows a user to write a script to record a tutorial video for a web based application, complete with audio.

prerequisits

  • ffmpeg
  • selenium web driver for google chrome
  • amazon AWS account for Amazon Polly (for text to speech conversion)
  • Java8+
  • Maven

quickstart

clone the current repository

git clone https://github.com/headwirecom/automatedscreenrecorder.git

Modify the asr.properties file to point to the location of the chrome driver and ffmpeg to be used.

Note: you can also set the properties in asr.properties by passing them as -D arguments on the command line. For example -Daudio=false -DmaxWait=100 will allow you to quickly test your script without adding audio into the final file and waiting for a maximum time of 100ms at every wait.

Make sure the environment variables for your AWS account are set up - for windows you can use

set AWS_ACCESS_KEY_ID=<ID>
set AWS_SECRET_ACCESS_KEY=<ACCESS_KEY>

Compile and run the screen recorder with

mvn install exec:java

by default a script in src/main/resources/test.script will be executed. This script assumes you have a local copy of the peregrine-cms installed. The script will result in a video like https://youtu.be/_oOdR27F3kM

script syntax

The script follows a simple syntax:

Comments: 
# some comment

Single Line:
command modifier data

Multi Line:
command modifier `data
more lines`

#multiple commands with the same modifier and data
command,command modifier data

Commands

The following commands are implemented:

use

use <browser>

Chooses the browser to use. At present chrome or firefox are supported - make sure the driver property in the asr.properties file points to the location of the selenium web driver for the selected browser.

start

start <name>

example: 
start recording

Start a recording into a file called final-<recording>.avi. The file can be found in the target folder of the project after the recording is complete. An additional file called <recording>.avi is created in the target folder without the audio track.

stop

stop

The stop command completes the recording and starts the post processing steps (merge audio into video).

open


#example:
open https://github.com/headwirecom/automatedscreenrecorder

opens the given url in the browser

audio

audio text <text to insert>

example: 
# single line audio
audio text hello world

# multi line audio
audio text `welcome to the automated screen recorder. 
We're excited to see you try our tool`

Insert audio at this location in the video given the <text to insert> text. This command requires your Amazon AWS credentials to be set up correctly to run Amazon Polly for the text to speech conversion. The resulting audio file will be stored in the target folder of your project. The filename is an SHA256 hash of the text followed by .mp3 file extension. To reduce cost the conversion is only performed if the file is not present yet. Amazon Polly has a free tier for a limited amount of conversions.

wait

wait <time in ms or audio>

examples: 
# wait 1 second
wait 1000

# wait for audio to complete playing
wait audio

# wait for audio to complete playing plus/minus an offset
wait audio -1000

The wait command waits either for a given time in milli seconds or for the most recent audio file to complete playing. If the audio option is used an additional parameter can be passed to add/subtract time. This allows you to for example start the next mouse movement before the end of the audio file to generate a more fluent recording.

moveTo

moveTo <modifier> <data>

examples: 
# move the mouse to a location on the screen by id
moveTo id some-id

# move the mouse to a location on the screen by name
moveTo name some-name

# move the mouse to a location on the screen by xpath
moveTo xpath some-xpath

moves the mouse to the given location of an html page by id, name or xpath. If audio generation is turned off the mouse will move directly to the new element, otherwise it will move to the new location within a second to create a more realistic recording.

click

click <modifier> <data> same as moveTo but clicks the item.

input

input <text> types the given text

enter

enter types the enter key

acceptDialog

acceptDialog accepts a browser dialog

Prerequisits Installation and Setup

  • Download browser driver Download the driver for one of the supported browsers:

    Selenium components for Google Chrome and Mozilla Firefox

  • Install FFmpeg to merge audio & video: FFmpeg

  • AWS Polly

    In order to get to know and use Amazon's web service Polly, visit the AWS Documentation. Setting up an AWS Account and creating a user is mandatory for you to use the service. After successfully signing up, look for your AWS AccessKeyID and your AWSSecretKey. You'll need the credentials to connect the SDK to Amazons Services.

automatedscreenrecorder's People

Contributors

reusr1 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.