https://github.com/vickvasquez/get-media-duration
Get the duration of an media file (audio, video) from local storage or URL
https://github.com/vickvasquez/get-media-duration
audio ffmpeg ffprobe get-media-duration
Last synced: about 1 month ago
JSON representation
Get the duration of an media file (audio, video) from local storage or URL
- Host: GitHub
- URL: https://github.com/vickvasquez/get-media-duration
- Owner: vickvasquez
- License: mit
- Created: 2023-03-08T04:55:58.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-09T04:48:41.000Z (over 3 years ago)
- Last Synced: 2025-10-22T04:38:48.708Z (8 months ago)
- Topics: audio, ffmpeg, ffprobe, get-media-duration
- Language: TypeScript
- Homepage:
- Size: 315 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# get-media-duration
## Install
```bash
pnpm add get-media-duration
```
## Usage
```js
import { getDuration, getDurationInMinutes } from 'get-media-duration'
getDuration('./audio.mp3')
.then(duration => console.log(duration))
.catch(console.log)
getDuration('https://samplelib.com/lib/preview/mp3/sample-3s.mp3')
.then(duration => console.log(duration))
.catch(console.log)
getDurationInMinutes('./audio.mp3')
.then(duration => console.log(duration))
.catch(console.log)
getDurationInMinutes('https://samplelib.com/lib/preview/mp3/sample-3s.mp3')
.then(duration => console.log(duration))
.catch(console.log)
```