Capítulo 708 de 988

Chapter 708: canReencodeAudioTrack()

Core Idea

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

Key Concepts

  • Examples
  • API
  • track
  • audioCodec
  • bitrate
  • sampleRate
  • Return value
  • See also

Code Examples

const {tracks} = await parseMedia({
  src: 'https://remotion.media/BigBuckBunny.mp4',
  fields: {
    tracks: true,
  },
});

const audioTracks = tracks.filter((t) => t.type === 'audio');

for (const track of audioTracks) {
  await canReencodeAudioTrack({
    track,
    audioCodec: 'opus',
    bitrate: 128000,
    sampleRate: null,
  });
}
  • What it demonstrates: Usage pattern for canReencodeAudioTrack() from the official docs.

Key Takeaways

  1. Understand examples when working with canReencodeAudioTrack().
  2. Understand api when working with canReencodeAudioTrack().
  3. Understand track when working with canReencodeAudioTrack().
  4. Understand audiocodec when working with canReencodeAudioTrack().
  5. Understand bitrate when working with canReencodeAudioTrack().

Connects To

  • Buffer Writer: related page in the WebCodecs (@remotion/webcodecs) section.
  • can Copy Audio Track: related page in the WebCodecs (@remotion/webcodecs) section.
  • can Copy Video Track: related page in the WebCodecs (@remotion/webcodecs) section.