How to use a watch folder for video enconding

Video encoding for web is a common task that requires some technical knowledge about video compression. Moreover, it has several consecuences over the web performance, demanding automation for a right video optimization process.

Now, using the Abraia gulp plugin it is easy to configure a watch folder and get all your videos optimized every time you add a new one to a folder. You just need to follow the guide bellow to perfectly optimize your videos without freezing your computer (a new task performs in the cloud every time). Moreover, you are not going to worry about the encoding parametrization thanks to Abraia provides the best encoding settings for every major web format (MP4, WEBM, HEVC, HLS).

Abraia gulp plugin installation

To use a watch folder with the Abraia service, you need to have Node installed in your system. Once installed, you must create a project directory to configure the watch folder.

Create a project folder and open a terminal inside it. Then start the project and install the gulp plugin:

npm init -y
npm install gulp gulp-abraia --save-dev

Get your API key from the settings tab in the Abraia web console.

Video enconding configuration

Create a gulpfile.js file and add the configuration bellow to start watching the videos folder. Every time you add a video to the watch folder, an encoding task is launched on the cloud. Remember to configure your API key at the start of the gulpfile.js.


const gulp = require('gulp')
const abraia = require('gulp-abraia')

gulp.task('variants', () => {
  return gulp.src('videos/*')
      { height: 720, output: '{name}-720p.mp4' },
      { height: 720, output: '{name}-720p.webm' }

gulp.task('watch', () => {'videos/*', gulp.series('variants'))

You can easily generate perfectly optimized short videos in different formats and sizes, including padding and cropping options, and even overlay images and text (e.g. watermarking, branding).

To get your configuration, use the Abraia console and download the variants configuration from the bulk tool. Then, just use the donwloaded configuration to update your waching folder.

gulp watch

Remember that Abraia only works with short videos (up to 5 minutes) with an initial maximum size of 100MB. We are focus on ecommerce, marketing, social media video formats.