GizStackGizStack
View .mdOpen in ChatGPTOpen in Claude

gizai/tasks/enhance

the video jobs that need no model: enhance-video (operation video.enhance, RTX Video) and interpolate-video (video.interpolate, optical flow) on a worker's GPU.

gizlang
import * as Enhance from "gizai/tasks/enhance";

Types

Treatment

gizlang
type Treatment = { e: Enhance.Enhance; times: i64; effort: string; }

What a job does to the frames: RTX Video e, or (times above 1) times - 1 frames made between each two (of quality effort: Interpolate.interpolationQualities).

  • e: _gizlang_lib_ai__video__enhance.Enhance
  • times: i64
  • effort: string

Functions

service

gizlang
function service(): Hosting.Service

The worker service for video enhancement and frame interpolation.

Effects: fail, alloc.

enhanceFile

gizlang
function enhanceFile(gpu: Gpu, ffmpeg: string, source: string, s: Decode.Source, how: Treatment, codec: string, dir: string, progress: (f: i64, total: i64) => bool): i64 throws W.Failure

source (s: Decode.sourceOf) through how into DIR/output.mp4 of codec, with the source's audio: NVDEC, the effect or the interpolation, and NVENC on gpu, then ffmpeg times the track at the source's rate (times how.times) beside the audio. progress takes the source frames done and expected each 8 frames and gives false to cancel.

Effects: fail, read, write, console, io, alloc.

Constants

WORKER

gizlang
const WORKER = "video-processing"

The worker argument for the enhancement and interpolation operations.

QUALITY

gizlang
const QUALITY: i64 = 20

NVENC's constant quality of an enhanced video, for a model that upscales its own output too.