@brainsights/media-tools
Advanced tools
Comparing version 3.4.7 to 3.4.8
@@ -7,2 +7,3 @@ const _ = require("lodash"); | ||
const debug = require("debug")("media-tools:media-track"); | ||
const fs = require("fs-extra"); | ||
const __ = new WeakMap(); | ||
@@ -130,6 +131,8 @@ | ||
let info = __.get(this).info; | ||
let passlogFile = tempy.file(); | ||
let displayProfile = selectBestDisplayProfile(profile.DISPLAY_TRACK_SETTINGS, info); | ||
let tasks = []; | ||
let cleanupFiles = []; | ||
let passlogFile = tempy.file(); | ||
let ffmpeg = new Ffmpeg({ source: __.get(this).media.path }) | ||
@@ -207,3 +210,4 @@ .addOptions([ | ||
}); | ||
pass2.on("end", () => { | ||
pass2.on("end", async () => { | ||
await fs.remove(passlogFile); | ||
context.progress(100); | ||
@@ -210,0 +214,0 @@ context.resolve(outputFile); |
@@ -118,5 +118,7 @@ const path = require("path"); | ||
let tasks = []; | ||
let cleanupFiles = []; | ||
if(this.isVideo()) { | ||
let videoTrack = this.tracks.defaultVideo(); | ||
let videoOutputFile = `${tempy.file({ extension: profile.video.fileExtension })}`; | ||
cleanupFiles.push(videoOutputFile); | ||
tasks.push(videoTrack.transcode(profile, videoOutputFile)); | ||
@@ -127,2 +129,3 @@ | ||
let audioOutputFile = `${tempy.file({ extension: profile.audio.fileExtension })}`; | ||
cleanupFiles.push(audioOutputFile); | ||
tasks.push(audioTrack.transcode(profile, audioOutputFile)); | ||
@@ -133,2 +136,3 @@ } | ||
let audioOutputFile = `${tempy.file({ extension: profile.audio.fileExtension })}`; | ||
cleanupFiles.push(audioOutputFile); | ||
tasks.push(audioTrack.transcode(profile, audioOutputFile)); | ||
@@ -138,2 +142,3 @@ } else if(this.isImage()) { | ||
let imageOutputFile = `${tempy.file({ extension: profile.image.fileExtension })}`; | ||
cleanupFiles.push(imageOutputFile); | ||
tasks.push(imageTrack.transcode(profile, imageOutputFile)); | ||
@@ -155,2 +160,5 @@ } | ||
media = await Media.merge(await Promise.all(_.map(outputFiles, Media.load)), outputFile, options); | ||
for(let file of cleanupFiles) { | ||
await fs.remove(file); | ||
} | ||
} catch(e) { | ||
@@ -157,0 +165,0 @@ console.trace(e); |
{ | ||
"name": "@brainsights/media-tools", | ||
"version": "3.4.7", | ||
"version": "3.4.8", | ||
"description": "Tools for reading metadata and transcoding media files.", | ||
@@ -22,3 +22,6 @@ "main": "index.js", | ||
"tmp-promise": "1.0.4" | ||
}, | ||
"volta": { | ||
"node": "10.24.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
930
509885
7