Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
nwittwer committed Feb 24, 2019
1 parent 190e3f5 commit 8dad5c2
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gulp-tasks/tasks/build-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ gulp.task('version-app:prompt-version', function (done) {
}

// Update the final ZIP path with the version
PATH_TO_MAC_ZIP = 'build/Reflex-' + NEXT_APP_VERSION + '-mac.zip'
PATH_TO_MAC_ZIP = 'build/Reflex-' + NEXT_APP_VERSION + '.dmg'

done()
})
Expand Down
53 changes: 53 additions & 0 deletions gulp-tasks/tasks/gif.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const gulp = require('gulp')
const exec = require('child_process').exec

// 1. Open the app
// Remove all user data
// Reload

// 2. Start recording
// Create Basic 3 screens
// Go to demo website (medium.com)
// Click sync, scroll down
// Show screenshot functionality

// 3. Save video...wait to finish
// 4. Convert video to GIF

const MOV_FILE = 'screenshot.mov'

// Convert input video to a GIF
// gulp.task('makeGIF:palette', (done) => {
// exec(`ffmpeg -i ${MOV_FILE} -y -vf fps=15,scale=360:-1:flags=lanczos,palettegen palette.png`, function (err) {
// if (err) return false
// done(err)
// })
// })

// gulp.task('makeGIF:convert', (done) => {
// exec(`ffmpeg -i palette.png -y -filter_complex "fps=15,scale=720:-1:flags=lanczos[x];[x][1:v]paletteuse" screenshot.gif`, function (err) {
// if (err) {
// console.log(err)
// return false
// }
// done(err)
// })
// })

gulp.task('makeVID', (done) => {
exec(`ffmpeg -i screenshot.mov -movflags faststart -pix_fmt yuv420p -vf "scale=720:-1" screenshot.mp4`, function (err) {
if (err) {
console.log(err)
return false
}
done(err)
})
})

gulp.task('makeGIF', gulp.series(
// 'makeGIF:palette',
// 'makeGIF:convert'
'makeVID'
))

// ffmpeg -i ./screenshot.mov -vf scale=720:-1:flags=lanczos,palettegen palette.png -r 10 -f gif - | gifsicle --optimize=1 --delay=3 > ./screenshot.gif
Binary file removed screenshot.gif
Binary file not shown.
Binary file added screenshot.mov
Binary file not shown.
Binary file added screenshot.mp4
Binary file not shown.

0 comments on commit 8dad5c2

Please sign in to comment.