( encoder: string, options: NativeVideoExportStartOptions, outputPath: string, )
| 276 | } |
| 277 | |
| 278 | export function buildNativeVideoExportArgs( |
| 279 | encoder: string, |
| 280 | options: NativeVideoExportStartOptions, |
| 281 | outputPath: string, |
| 282 | ): string[] { |
| 283 | const args = [ |
| 284 | "-y", |
| 285 | "-hide_banner", |
| 286 | "-loglevel", |
| 287 | "error", |
| 288 | "-f", |
| 289 | "rawvideo", |
| 290 | "-pix_fmt", |
| 291 | "rgba", |
| 292 | "-s:v", |
| 293 | `${options.width}x${options.height}`, |
| 294 | "-framerate", |
| 295 | String(options.frameRate), |
| 296 | "-i", |
| 297 | "pipe:0", |
| 298 | "-vf", |
| 299 | "vflip", |
| 300 | "-an", |
| 301 | "-c:v", |
| 302 | encoder, |
| 303 | "-g", |
| 304 | String(Math.max(1, Math.round(options.frameRate * 5))), |
| 305 | ...getBitrateArgs(options.bitrate), |
| 306 | ]; |
| 307 | |
| 308 | if (encoder === "libx264") { |
| 309 | args.push(...getLibx264ModeArgs(options.encodingMode)); |
| 310 | } |
| 311 | |
| 312 | args.push("-pix_fmt", "yuv420p", "-movflags", "+faststart", outputPath); |
| 313 | return args; |
| 314 | } |
| 315 | |
| 316 | export function buildNativeCudaOverlayStaticLayoutArgs( |
| 317 | config: NativeStaticLayoutExportArgsConfig, |
no test coverage detected