Skip to content

Commit

Permalink
better UX
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaphasilor committed Jul 27, 2021
1 parent 8a882f0 commit c1007d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ class VideoSyncCommand extends Command {
type: `confirm`,
name: `continue`,
message: `It seems like one of the videos might be warped (slightly sped up or slowed down). This might make synchronization impossible. Do you want to continue anyway?`,
default: false,
}])).continue
}

Expand Down
10 changes: 7 additions & 3 deletions util/merge-tracks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ const probe = require(`node-ffprobe`)
const cli = require(`cli-ux`).default
const ora = require('ora');
const chalk = require('chalk');
const ms = require(`ms`)

const tracks = require(`./tracks`)

module.exports = function(video1, video2, output, offset, tracksToSync) {
return new Promise(async (resolve, reject) => {

let spinner = ora(`Figuring out offsets for audio tracks...`).start();
let spinner = ora(`Figuring out offsets for selected tracks...`).start();
// cli.action.start(`Figuring out offsets for audio tracks`)

let matchedTracks
Expand Down Expand Up @@ -75,9 +77,11 @@ module.exports = function(video1, video2, output, offset, tracksToSync) {
merger.stdout.setEncoding(`utf8`)
merger.stderr.setEncoding(`utf8`)

const startTime = Date.now()
const simpleBar = cli.progress({
format: `Muxing output video [${chalk.green('{bar}')}] {percentage} % | ETA: {eta}s`,
format: `Muxing output video [${chalk.green('{bar}')}] {percentage} % | ETA: {eta_formatted}`,
etaBuffer: 7,
clearOnComplete: true,
})
simpleBar.start(100, 0);

Expand Down Expand Up @@ -109,7 +113,7 @@ module.exports = function(video1, video2, output, offset, tracksToSync) {
}

const tempSpinner = ora(``).start();
tempSpinner.succeed(`Done.`)
tempSpinner.succeed(`Successfully muxed output video in ${ms(Date.now() - startTime)}.`)

return resolve()

Expand Down

0 comments on commit c1007d4

Please sign in to comment.