mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
increase base transcoding quality
This commit is contained in:
parent
7fcbedc8f4
commit
dea1840439
@ -9,13 +9,13 @@ import videoTranscode from "@services/videoTranscode"
|
||||
* @param {string} [options.videoCodec="libx264"] - The video codec to use.
|
||||
* @param {string} [options.format="mp4"] - The format to use.
|
||||
* @param {number} [options.audioBitrate=128] - The audio bitrate to use.
|
||||
* @param {number} [options.videoBitrate=1024] - The video bitrate to use.
|
||||
* @param {number} [options.videoBitrate=2024] - The video bitrate to use.
|
||||
* @throws {Error} Throws an error if file parameter is not provided.
|
||||
* @return {Object} The processed video file object.
|
||||
*/
|
||||
async function processVideo(
|
||||
file,
|
||||
options = {}
|
||||
options = {},
|
||||
) {
|
||||
if (!file) {
|
||||
throw new Error("file is required")
|
||||
@ -26,14 +26,14 @@ async function processVideo(
|
||||
videoCodec = "libx264",
|
||||
format = "mp4",
|
||||
audioBitrate = 128,
|
||||
videoBitrate = 1024,
|
||||
videoBitrate = 2024,
|
||||
} = options
|
||||
|
||||
const result = await videoTranscode(file.filepath, file.cachePath, {
|
||||
videoCodec,
|
||||
format,
|
||||
audioBitrate,
|
||||
videoBitrate,
|
||||
videoBitrate: [videoBitrate, true],
|
||||
})
|
||||
|
||||
file.filepath = result.filepath
|
||||
|
@ -50,7 +50,12 @@ export default (input, cachePath, params = defaultParams) => {
|
||||
console.warn(`[TRANSCODING] Method ${key} is not a function`)
|
||||
return false
|
||||
}
|
||||
exec = exec[key](commands[key])
|
||||
|
||||
if (Array.isArray(commands[key])) {
|
||||
exec = exec[key](...commands[key])
|
||||
} else {
|
||||
exec = exec[key](commands[key])
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user