Using PEAT for Video Testing
Step 1: Producing a Video Capture of Your Web Browser
On a Mac, use Quicktime to capture the video of your animation. On Windows 10, you can use this built-in feature in Windows to capture video, but since not all computers running Windows support it, you may find CamStudio a good alternative (Note: I have not used either Windows solution to capture video, so your mileage may vary).
Step 2: Convert the Video to Uncompressed AVI format
PEAT is guaranteed to analyze 25 frame-per-second uncompressed AVIs. I have used FFmpeg to convert other types of video content to this format. Once you download the program (or install it with your favourite package manager like macports, brew, or cygwin), you can use the following command line recipe to do this:
ffmpeg -i input.mp4 -an -vcodec rawvideo -y -r 25 output.avi
For those who are interested: the -an
removes the audio (since PEAT doesn’t need it to analyze the video), the -vcodec rawvideo
converts the output to an uncompressed format, the -y
will overwrite the video without asking, and the -r 25
will ensure the output video has a framerate of 25 frames-per-second. Note that even though I use an MPEG-4 as the input video in the command above, FFmpeg can read and write a variety of other video formats.
Sometimes PEAT will fail to read the uncompressed video, or only analyze part of the video, because it’s too big. In that case, you should resize the video using this ffmpeg recipe:
ffmpeg -i input.mp4 -vf scale=640:-1 -an -vcodec rawvideo -y -r 25 output.avi
This will rescale the video to 640 pixels across without changing the aspect ratio. This rescale is acceptable for seizure testing purposes. https://www.useragentman.com/blog/2017/04/02/using-peat-to-create-seizureless-web-animations/