summaryrefslogtreecommitdiff
path: root/app/client/live
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-06-16 17:09:15 +0200
committerJules Laplace <julescarbon@gmail.com>2018-06-16 17:09:15 +0200
commit11ea17238fa617f8952e8255f3cfc400c53bd413 (patch)
tree9cf5d8c9f7fa46f11d2be573afe62810c99fb106 /app/client/live
parenta5dc29fdb15f05c79ea6bb780b92f888ef17ba1e (diff)
25fps
Diffstat (limited to 'app/client/live')
-rw-r--r--app/client/live/player.js2
-rw-r--r--app/client/live/whammy.js20
2 files changed, 15 insertions, 7 deletions
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));