Skip to content

Commit

Permalink
log ffmpeg duration
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Jan 3, 2024
1 parent e5f7955 commit 4e31e44
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export default class VideoReporter extends WdioReporter {
if (this.#isDone) {
return
}
this.#log(`Generated videos: "${this.videos.join('", "')}", video report done!`)
this.#log(`Generated ${this.videos.length} videos, video report done!`)
this.#isDone = true
}

Expand Down Expand Up @@ -351,7 +351,8 @@ export default class VideoReporter extends WdioReporter {
]
this.#log(`ffmpeg command: ${command} ${args.join(' ')}`)

const promise = Promise
const start = Date.now()
const promise: Promise<void> = Promise
.all(this.screenshotPromises)
.then(() => frameCheckPromise)
.then(() => new Promise((resolve) => {
Expand All @@ -360,7 +361,10 @@ export default class VideoReporter extends WdioReporter {
shell: true,
windowsHide: true,
})
cp.on('close', resolve)
cp.on('close', () => {
this.#log(`Generated video: "${videoPath}" (${Date.now() - start}ms)`)
return resolve()
})
}))

this.videoPromises.push(promise)
Expand Down

0 comments on commit 4e31e44

Please sign in to comment.