diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-16 17:09:15 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-16 17:09:15 +0200 |
| commit | 11ea17238fa617f8952e8255f3cfc400c53bd413 (patch) | |
| tree | 9cf5d8c9f7fa46f11d2be573afe62810c99fb106 /app/client | |
| parent | a5dc29fdb15f05c79ea6bb780b92f888ef17ba1e (diff) | |
25fps
Diffstat (limited to 'app/client')
| -rw-r--r-- | app/client/live/player.js | 2 | ||||
| -rw-r--r-- | app/client/live/whammy.js | 20 | ||||
| -rw-r--r-- | app/client/modules/pix2pix/views/pix2pix.live.js | 4 |
3 files changed, 17 insertions, 9 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)); diff --git a/app/client/modules/pix2pix/views/pix2pix.live.js b/app/client/modules/pix2pix/views/pix2pix.live.js index 8c32d0c..9769109 100644 --- a/app/client/modules/pix2pix/views/pix2pix.live.js +++ b/app/client/modules/pix2pix/views/pix2pix.live.js @@ -129,7 +129,7 @@ class Pix2PixLive extends Component { this.props.opt.savingVideo ? 'Saving video...' : this.props.opt.recording - ? 'Recording (' + timeInSeconds(this.props.opt.recordFrames) +')' + ? 'Recording (' + timeInSeconds(this.props.opt.recordFrames/25) +')' : 'Record video' } onClick={this.toggleRecording} @@ -301,7 +301,7 @@ class Pix2PixLive extends Component { } } function timeInSeconds(n){ - return (n / 10).toFixed(1) + ' s.' + return n.toFixed(1) + ' s.' } const mapStateToProps = state => ({ last_message: state.live.last_message, |
