Skip to content

oscnord/get-video-resolution

Repository files navigation

Get video resolution

Get the dimensions (width and height) of a video. Can be a local video or a video stream.

Requirements

ffprobe

To be able to extract the video dimensions ffmpeg/ffprobe needs to be installed.

MacOS:

brew install ffmpeg

Ubuntu:

sudo apt-get install ffmpeg

Usage

import { getVideoResolution } from "@oscnord/get-video-resolution";

const resolution = await getVideoResolution('https://www.example-stream/manifest.m3u8');
console.log(resolution); // { width: 1920, height: 1080 }