Chapter 739: Getting the frame rate of a video
Core Idea
Videos can have one of two types of frame rates:
Key Concepts
- Getting the frame rate using Mediabunny
- Matching a Remotion composition to the frame rate
- Usage example
- See also
Code Examples
const getFrameRate = async (videoTrack: InputVideoTrack) => {
const metrics = await videoTrack.computeFrameRateMetrics();
// ^?
if (metrics.probedPacketCount < 2) {
return null;
}
return metrics.bestGuessFrameRate;
};
- What it demonstrates: Usage pattern for Getting the frame rate of a video from the official docs.
Key Takeaways
- Understand getting the frame rate using mediabunny when working with Getting the frame rate of a video.
- Understand matching a remotion composition to the frame rate when working with Getting the frame rate of a video.
- Understand usage example when working with Getting the frame rate of a video.
- Understand see also when working with Getting the frame rate of a video.
Connects To
- can Decode: related page in the Mediabunny (@remotion/mediabunny) section.
- Extract Frames: related page in the Mediabunny (@remotion/mediabunny) section.
- Extract Thumbnail: related page in the Mediabunny (@remotion/mediabunny) section.