Back to Remotion

webFsWriter

packages/docs/docs/webcodecs/web-fs-writer.mdx

4.0.4631.9 KB
Original Source

:::warning We are phasing out Remotion WebCodecs and are moving to Mediabunny! :::

import {LicenseDisclaimer} from './LicenseDisclaimer'; import {UnstableDisclaimer} from './UnstableDisclaimer';

<details> <summary>💼 Important License Disclaimer</summary> <LicenseDisclaimer /> </details>

:::warning Unstable API: The writer interface is experimental. The API may change in the future. :::

A writer for @remotion/webcodecs that writes to the browser's file system using the File System Access API.

Can be used for convertMedia() to write the converted output directly to a temporary file in the browser's origin-private file system.

Availability

This writer is only available in browsers that support the File System Access API. Use canUseWebFsWriter() to check if it's available.

Example

tsx
import {convertMedia} from '@remotion/webcodecs';
import {webFsWriter} from '@remotion/webcodecs/web-fs';

const result = await convertMedia({
  src: 'https://remotion.media/BigBuckBunny.mp4',
  container: 'webm',
  writer: webFsWriter,
});

const blob = await result.save();

canUseWebFsWriter()

A function that returns a Promise<boolean> indicating whether the webFsWriter can be used in the current environment.

tsx
import {canUseWebFsWriter, webFsWriter} from '@remotion/webcodecs/web-fs';

const canUse = await canUseWebFsWriter();
if (canUse) {
  // Use webFsWriter
} else {
  // Fall back to bufferWriter or another writer
}

See also