+async function generateVideoWithFramerate (fps = 60) {
+ const tempFixturePath = buildAbsoluteFixturePath(`video_${fps}fps.mp4`, true)
+
+ await ensureDir(dirname(tempFixturePath))
+
+ const exists = await pathExists(tempFixturePath)
+ if (!exists) {
+ console.log('Generating video with framerate %d.', fps)
+
+ return new Promise<string>((res, rej) => {
+ ffmpeg()
+ .outputOptions([ '-f rawvideo', '-video_size 1280x720', '-i /dev/urandom' ])
+ .outputOptions([ '-ac 2', '-f s16le', '-i /dev/urandom', '-t 10' ])
+ .outputOptions([ `-r ${fps}` ])
+ .output(tempFixturePath)
+ .on('error', rej)
+ .on('end', () => res(tempFixturePath))
+ .run()
+ })
+ }
+
+ return tempFixturePath
+}
+
+async function getFileSize (path: string) {
+ const stats = await stat(path)
+
+ return stats.size
+}
+