Created
April 15, 2020 21:24
-
-
Save SergeiMeza/4eeccaac53a96371784c9232e719889a to your computer and use it in GitHub Desktop.
Sample FFMPEG in Typescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function processHLS(args: { | |
videoPath: string | |
size: string | |
outPath: string | |
}) { | |
return new Promise((res, rej) => { | |
Ffmpeg(args.videoPath) | |
.videoBitrate(1024) | |
.videoCodec("libx264") | |
.noAudio() | |
.addOption("-hls_time", "5") | |
// .addOption("preset", "superfast") | |
// .addOption( | |
// "-hls_base_url", | |
// `https://storage.googleapis.com/${bucket}/${currentUser.id}/`, | |
// ) | |
.addOption("-hls_list_size", "0") | |
.size(args.size) | |
.output(args.outPath) | |
.on("end", res) | |
.on("error", err => rej(err)) | |
.run() | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment