Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Simple utility for **node/io.js** to **create straightforward video slideshows b

To getting started you can take a look to the [examples](https://github.com/h2non/videoshow/tree/master/examples), [programmatic API](#api) and [command-line](#command-line-interface) interface

videoshow is used in production rendering thousands of videos per month.
videoshow is used in production rendering thousands of videos per month.

Click on the image to see an example video generated by `videoshow`:

Expand Down Expand Up @@ -271,6 +271,7 @@ Supported events for subscription:

- **start** `cmd` - Fired when ffmpeg process started
- **error** `error, stdout, stderr` - Fired when transcoding error happens
- **imagePreprocessed** `data` - Fired when image preprocessed. data = { count: 5, index: 0}.
- **progress** `data` - Fired with transcoding progress information
- **codecData** `codec` - Fired when input codec data is available
- **end** `videoPath` - Fired when the process finish successfully
Expand Down
10 changes: 7 additions & 3 deletions lib/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,25 @@ function render(videoshow) {
}

function processVideo(videoshow, bus) {
var imageJobs = convertImages(videoshow)
var imageJobs = convertImages(videoshow, bus)
var merge = mergeParts(videoshow, bus)

fw.series(imageJobs, merge)
}

function convertImages(videoshow) {
function convertImages(videoshow, bus) {
var params = options.define(videoshow.params)

return videoshow.images.map(function (image) {
var doneImageProcessingEvent = proxyEvent(bus)('imagePreprocessed')
var imagesSize = videoshow.images.length

return videoshow.images.map(function (image, ind) {
var output = randomName()
return function (done) {
video(image, params, output)
.on('error', done)
.on('end', function () {
doneImageProcessingEvent({count: imagesSize, index: ind })
done(null, output)
})
}
Expand Down
Loading