mifi / editly

Slick, declarative command line video editing & API
MIT License
4.73k stars 308 forks source link

[Feature request] Support multitrack clip #102

Open inbreaks opened 3 years ago

inbreaks commented 3 years ago

Editly Declarative API is impressive, but I did not find support for multi-track clip. Consider the following use cases

  1. Add subtitles to video (this is very common), such as supporting .srt
  2. Add a watermark to the video, such as a logo

The above use cases does not seem to be solved well by adding clips linearly.

mifi commented 3 years ago
  1. this is a good feature request
  2. You can indeed add watermarks to a video, using the image-overlay layer?
inbreaks commented 3 years ago

You can indeed add watermarks to a video, using the image-overlay layer?

@mifi Thanks reply, image-overlay There are two problems

  1. It is not intuitive to use. No matter adding defaults or adding it in clips, it is not semantic enough.
  2. Affected by the transition animation, image-overlay will move with clip.
{
  outPath: './imageOverlay.mp4',
  defaults: {
    layerType: {
      'image-overlay': { path: './assets/logo.png', width: 0.1 , position: { originX: 'center', originY: 'center', x: 0.1, y: 0.2 }},
    },
  },
  clips: [
      { duration: 3, transition: { name: 'directionalWarp' }, layers: [{ type: 'title-background', text: 'Scene 1', background: { type: 'linear-gradient' } }, { type: 'image-overlay' }] },
      { duration: 3, transition: { name: 'pause' }, layers: [{ type: 'title-background', text: 'Scene 2', background: { type: 'linear-gradient' } }, { type: 'image-overlay' }] },
  ],
}

In view of this, consider supporting multi-track clips. 😁

mifi commented 3 years ago

Ahh now I understand what you mean. You want to have overlays that span across multiple clips? Like a normal video editor with a specified from - to time to be visible. It's possible, but editly was mostly meant for easily mashing clips together to generate a video, so it was never thought to be a fully flexible video editing API like a traditional editor.

inbreaks commented 3 years ago

You are right, keeping editly simple is also important.

thebrucecgit commented 3 years ago

I'm trying to do something similar. Is it somehow possible to just have one clip for the whole video, and then put all the videos as layers to have a multi-tracked video?

mifi commented 3 years ago

@thebrucecgit you can put one video as a layer inside one big clip, then you can have multiple smaller overlay videos starting at arbitrary times if that's what you mean. See https://github.com/mifi/editly/blob/master/examples/mosaic.json5