Capítulo 728 de 988
:::warning We are phasing out Remotion WebCodecs and are moving to Mediabunny!
const output = await convertMedia({
src: 'https://example.com/input.mp4',
container: 'wav',
onAudioTrack: async ({track}) => {
if (
await canReencodeAudioTrack({
audioCodec: 'wav',
track,
// Ignore this, bitrate is not used for WAV files
bitrate: 128000,
sampleRate: 16000,
})
) {
return {
type: 'reencode',
audioCodec: 'wav',
bitrate: 128000,
sampleRate: 16000,
};
}
// If this conversion is not supported, return an error
return {
type: 'fail',
};
},
});
const blob = await output.save(); // returns a `Blob`