VideoContent
Bring in a movie file and cut it into your video, or pull single frames and its sound into a script.
A VideoContent points at a video file (MP4, MOV, WebM, GIF and more), read through ffmpeg, which has to be installed. The file stays on disk. FrameCount, FPS, Size and Duration come from the file. video:GetFrame(i) returns frame i as an ImageContent and video:GetSound() its sound as a SoundContent. Dropped on the Cook timeline it becomes a clip where you drop it (on a viewport, at the playhead), with its sound, decoded at the size it is drawn.
Properties
File
| Name | Type | Default | Description |
|---|---|---|---|
| Duration | number | The video's duration, read from the file. | |
| FPS | number | The video's frames per second, read from the file. | |
| FrameCount | number | The number of frames in the video, read from the file. | |
| Path | string | The path to the video file, read through ffmpeg. | |
| Resolution | read-only text | Properties window only |
Scripts
| Size | Vector2 | scripts only | The video's size, read from the file. |
Methods
| Name | Arguments | Returns | Description |
|---|---|---|---|
| GetFrame | (index: number, into: ImageContent?) | ImageContent | Decodes frame i of the video and gives it as an ImageContent; recent frames are cached. |
| GetSound | () | SoundContent | Gives a SoundContent on the same file, one per video. |
