@brainsights/media-tools
Advanced tools
Comparing version 3.4.5 to 3.4.6
@@ -23,3 +23,3 @@ const _ = require("lodash"); | ||
let rank = [ | ||
displayProfile.width/inputSize.width, | ||
displayProfile.width/inputSize.width, | ||
displayProfile.height/inputSize.height | ||
@@ -36,3 +36,3 @@ ]; | ||
const computeOutputDisplaySize = (displayProfile, inputSize) => | ||
const computeOutputDisplaySize = (displayProfile, inputSize) => | ||
{ | ||
@@ -137,7 +137,7 @@ let width, height; | ||
.addOptions([ | ||
`-map 0:${info.index}`, | ||
`-map 0:${info.index}`, | ||
]) | ||
.videoCodec(profile.video.codec) | ||
.fps(Math.min(30, info.frame_rate)) | ||
.addOptions([ | ||
.addOptions([ | ||
`-quality ${profile.video.quality}`, | ||
@@ -161,3 +161,3 @@ `-threads ${displayProfile.threads}`, | ||
.addOptions([ | ||
`-pass 1`, | ||
`-pass 1`, | ||
`-passlogfile ${passlogFile}`, | ||
@@ -189,3 +189,3 @@ `-speed 4`, | ||
let pass2 = ffmpeg.clone() | ||
.addOptions([ | ||
.addOptions([ | ||
`-speed ${profile.video.speed}`, | ||
@@ -244,3 +244,3 @@ `-auto-alt-ref ${profile.video.autoAltRef}`, | ||
let ffmpeg = new Ffmpeg({ source: __.get(this).media.path }) | ||
let ffmpeg = new Ffmpeg({ source: __.get(this).media.path }) | ||
.addOptions([ | ||
@@ -277,3 +277,3 @@ `-map 0:${info.index ? info.index : "a"}`, | ||
pass1.on("progress", (progress) => { | ||
context.progress(100*moment.duration(progress.timemark).as("milliseconds")/info.duration); | ||
context.progress(progress.percent); | ||
}); | ||
@@ -311,8 +311,8 @@ pass1.on("start", (command) => { | ||
pass2.on("progress", (progress) => { | ||
context.progress(100*moment.duration(progress.timemark).as("milliseconds")/info.duration); | ||
context.progress(progress.percent); | ||
}); | ||
pass2.on("start", (command) => { | ||
debug(`audio pass 2: ${command}`); | ||
}); | ||
pass2.saveToFile(outputFile); | ||
}); | ||
pass2.saveToFile(outputFile); | ||
})); | ||
@@ -379,3 +379,3 @@ | ||
{ | ||
} | ||
@@ -382,0 +382,0 @@ } |
@@ -18,3 +18,3 @@ const path = require("path"); | ||
// const mediainfo = (path) => | ||
// const mediainfo = (path) => | ||
// { | ||
@@ -134,3 +134,3 @@ // return new Promise((resolve, reject) => { | ||
} else if(this.isImage()) { | ||
let imageTrack = this.tracks.defaultImage(); | ||
let imageTrack = this.tracks.defaultImage(); | ||
let imageOutputFile = `${tempy.file({ extension: profile.image.fileExtension })}`; | ||
@@ -183,3 +183,3 @@ tasks.push(imageTrack.transcode(profile, imageOutputFile)); | ||
.saveToFile(outputFile); | ||
}); | ||
}); | ||
} else { | ||
@@ -186,0 +186,0 @@ let item = media[0]; |
{ | ||
"name": "@brainsights/media-tools", | ||
"version": "3.4.5", | ||
"version": "3.4.6", | ||
"description": "Tools for reading metadata and transcoding media files.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29677