Fix 1080p
This commit is contained in:
parent
ad1d3996b9
commit
076dc80ed9
1 changed files with 18 additions and 4 deletions
22
index.js
22
index.js
|
@ -29,10 +29,24 @@ app.get("/convert", async (req, res) => {
|
|||
name = name.substring(0, name.lastIndexOf("[") - 1)
|
||||
res.setHeader('Content-Disposition', `attachment; filename="${encodeURIComponent(name)}.${format}"`);
|
||||
|
||||
// ffmpegProcess.stderr.setEncoding('utf-8')
|
||||
// ffmpegProcess.stderr.on('data', (data) => {
|
||||
// console.log(data)
|
||||
// })
|
||||
const ffmpegProcess = cp.spawn(ffmpeg, [
|
||||
'-i', filePath,
|
||||
'-f', formats[format] || format,
|
||||
'-movflags', 'frag_keyframe+empty_moov',
|
||||
'-preset','ultrafast',
|
||||
'-crf', '23',
|
||||
'-loglevel', 'error',
|
||||
'-'
|
||||
], {
|
||||
stdio: [
|
||||
'pipe', 'pipe', 'pipe', 'pipe', 'pipe',
|
||||
],
|
||||
})
|
||||
|
||||
ffmpegProcess.stderr.setEncoding('utf-8')
|
||||
ffmpegProcess.stderr.on('data', (data) => {
|
||||
console.log(data)
|
||||
})
|
||||
// These are debugging lines to watch FFMPEG output :3
|
||||
|
||||
ffmpegProcess.stdio[1].pipe(res)
|
||||
|
|
Loading…
Reference in a new issue