()
| 124 | }); |
| 125 | |
| 126 | async function convertVideo() { |
| 127 | const outputPath = "./video.webm"; |
| 128 | logger.log("converting video", { input: videoPath, output: outputPath }); |
| 129 | |
| 130 | const childProcess = await execute(ffmpeg.path, [ |
| 131 | "-hide_banner", |
| 132 | "-y", // overwrite output, don't prompt |
| 133 | "-i", |
| 134 | videoPath, |
| 135 | // seek to 25s |
| 136 | "-ss", |
| 137 | "25", |
| 138 | // stop after 5s |
| 139 | "-t", |
| 140 | "5", |
| 141 | outputPath, |
| 142 | ]); |
| 143 | |
| 144 | logger.log("video converted", { |
| 145 | input: videoPath, |
| 146 | output: outputPath, |
| 147 | stderr: childProcess.stderr, |
| 148 | stdout: childProcess.stdout, |
| 149 | }); |
| 150 | } |
| 151 | |
| 152 | export const ffmpegConvert = task({ |
| 153 | id: "ffmpeg-convert", |
no test coverage detected
searching dependent graphs…