Fix most broken formats
This commit is contained in:
parent
1c7b486946
commit
46084e7540
1 changed files with 3 additions and 2 deletions
5
index.js
5
index.js
|
@ -45,18 +45,19 @@ app.post("/convert", uploads.single("files"), (req, res) => {
|
||||||
'-preset', preset,
|
'-preset', preset,
|
||||||
'-f', format,
|
'-f', format,
|
||||||
'-loglevel', 'error',
|
'-loglevel', 'error',
|
||||||
|
'-movflags', 'frag_keyframe+empty_moov',
|
||||||
'-'
|
'-'
|
||||||
], {
|
], {
|
||||||
stdio: [
|
stdio: [
|
||||||
'pipe', 'pipe', 'pipe', 'pipe', 'pipe',
|
'pipe', 'pipe', 'pipe', 'pipe', 'pipe',
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
console.log(fs.statSync(file.path).size)
|
||||||
res.setHeader('Content-Disposition', `attachment; filename="${file.originalname.substring(0, file.originalname.lastIndexOf('.'))}.${formats[format] || format}"`);
|
res.setHeader('Content-Disposition', `attachment; filename="${file.originalname.substring(0, file.originalname.lastIndexOf('.'))}.${formats[format] || format}"`);
|
||||||
|
|
||||||
ffmpegProcess.stdio[1].pipe(res)
|
ffmpegProcess.stdio[1].pipe(res)
|
||||||
|
|
||||||
.on("close", () => {
|
.on("close", () => {
|
||||||
|
console.log("A")
|
||||||
fs.rmSync(file.path)
|
fs.rmSync(file.path)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue