packages/docs/docs/webcodecs/web-fs-writer.mdx
:::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.
This writer is only available in browsers that support the File System Access API. Use canUseWebFsWriter() to check if it's available.
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();
A function that returns a Promise<boolean> indicating whether the webFsWriter can be used in the current environment.
import {canUseWebFsWriter, webFsWriter} from '@remotion/webcodecs/web-fs';
const canUse = await canUseWebFsWriter();
if (canUse) {
// Use webFsWriter
} else {
// Fall back to bufferWriter or another writer
}
bufferWriter - Alternative in-memory writerconvertMedia()