video.filter

Run the rest of the branch only when the input matches format. Otherwise bytes pass through unchanged.

Config

type VideoFilterConfig = {
  format: 'mp4' | 'webm' | 'mov' | 'mkv'; // default 'mp4'
};

Example

// pipeline
{
  id: 'only-mp4',
  type: 'video.filter',
  config: { format: { value: 'mp4' } },
}

// queue
tk.runQueue(files, 'video')
  .filter({ format: 'mp4' })
  .maxSize(720)
  .convert({ format: 'webm' });

Place the filter before resize or convert on that branch.