editframe-js icon indicating copy to clipboard operation
editframe-js copied to clipboard

Invalid filter "fadein" / "fadeout"

Open wernerdweight opened this issue 2 years ago • 0 comments

Hi there,

The docs list fadein and fadeout as supported filters (here), but if I try to use it, there's a validation error saying:

TypeError: Validation Errors:
  filter: { name } attribute in addFilter must be of type brightness, contrast, grayscale, lighten, negative, saturation. Got: "fadein"

I'm not sure if this is an error with the docs or with the library, or just a missing feature.

Code to reproduce:

import { Editframe } from "@editframe/editframe-js"
import * as fs from 'fs'

const videoFile = fs.createReadStream('[some video file here]')

const composition = await editframe.videos.new(
  {
    backgroundColor: "#c400ac",
    dimensions: {
      height: 1080,
      width: 1920,
    },
    duration: 10,
    metadata: {
      user_id: 1,
      anything: 'test'
    }
  }
)

await composition.addVideo(videoFile)

await composition.addFilter({ name: 'fadein', options: { color: '#55aaff', duration: 1, startTime: 0 } })
await composition.addFilter({ name: 'fadeout', options: { color: '#55aaff', duration: 1, startTime: 9 } })

await composition.encode()

wernerdweight avatar Feb 16 '23 12:02 wernerdweight