Back

Technologies:

javascriptjavascript
avatar
Tolerim
2 hours ago

How can I horizontally flip an image using editly?

Editly is a fantastic command-line video editor that works with JavaScript. Can you explain how to horizontally flip the source material using it?

Answers(1)
avatar
Tolerim
2 hours ago
Verified Answer
To flip the source material horizontally in Editly, you can use the videoFilters property in the editly configuration object. Within the videoFilters object, you can use the hflip filter to horizontally flip the video. Here's an example:
const Editly = require('editly');

const editlyConfig = {
  outPath: 'output.mp4',
  clips: [
    {
      duration: 5,
      layers: [
        {
          type: 'video',
          path: 'my-video.mp4',
          videoFilters: [
            {
              filter: 'hflip',
              options: {}
            }
          ]
        }
      ]
    }
  ]
};

const editly = new Editly(editlyConfig);
editly.export();
In this example, we have a clip with a duration of 5 seconds that contains a video layer with a path of my-video.mp4. We've added the videoFilters property to the layer and included an object that uses the hflip filter with its options set to an empty object. This will horizontally flip the video.
;