From 11ea17238fa617f8952e8255f3cfc400c53bd413 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 16 Jun 2018 17:09:15 +0200 Subject: 25fps --- app/client/live/player.js | 2 +- app/client/live/whammy.js | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'app/client/live') diff --git a/app/client/live/player.js b/app/client/live/player.js index 2fafb5c..483bbf1 100644 --- a/app/client/live/player.js +++ b/app/client/live/player.js @@ -15,7 +15,7 @@ export function stopSynthesizing(){ } export function startRecording(){ - videoWriter = new Whammy.Video(10) + videoWriter = new Whammy.Video(25, 0.95) recording = true store.dispatch({ type: types.player.start_recording, diff --git a/app/client/live/whammy.js b/app/client/live/whammy.js index 08a0ce9..762abca 100644 --- a/app/client/live/whammy.js +++ b/app/client/live/whammy.js @@ -541,12 +541,20 @@ module.exports = (function(){ WhammyVideo.prototype.compile = function(outputAsArray, callback){ this.encodeFrames(function(){ - - var webm = new toWebM(this.frames.map(function(frame){ - var webp = parseWebP(parseRIFF(atob(frame.image.slice(23)))); - webp.duration = frame.duration; - return webp; - }), outputAsArray); + var width = 0 + var height = 0 + var webm = new toWebM( + this.frames.map(function(frame){ + var webp = parseWebP(parseRIFF(atob(frame.image.slice(23)))); + webp.duration = frame.duration; + if (! webp || !webp.width || !webp.height) return null + if (! width) width = webp.width + else if (width !== webp.width) return null + if (! height) height = webp.height + else if (height !== webp.height) return null + return webp; + }).filter(function(frame){ return !!frame }) + , outputAsArray); callback(webm); }.bind(this)); -- cgit v1.2.3-70-g09d2