Get the dimensions (width and height) of a video. Can be a local video or a video stream.
To be able to extract the video dimensions ffmpeg/ffprobe
needs to be installed.
MacOS:
brew install ffmpeg
Ubuntu:
sudo apt-get install ffmpeg
import { getVideoResolution } from "@oscnord/get-video-resolution";
const resolution = await getVideoResolution('https://www.example-stream/manifest.m3u8');
console.log(resolution); // { width: 1920, height: 1080 }