UNPKG

videoshowlas

Version:

Simple command-line and programmatic interface to create videos slideshows from images using ffmpeg

21 lines (15 loc) 422 B
var msTime = require('./mstime') exports.stringify = function (data) { var buf = data.map(function (s) { var track = [] if (!isNaN(s.startTime) && !isNaN(s.endTime)) { s.startTime = msTime(+s.startTime) s.endTime = msTime(+s.endTime) } track.push(s.id) track.push(s.startTime + ' --> ' + s.endTime) track.push(s.text) return track.join('\n') }) return buf.join('\n\n') }