ffmpegwasm / ffmpeg.wasm

FFmpeg for browser, powered by WebAssembly
https://ffmpegwasm.netlify.app
MIT License
14.43k stars 849 forks source link

How to obtain audio and video information, such as duration, width and height #371

Open dayday6668 opened 2 years ago

dayday6668 commented 2 years ago

How to obtain audio and video information, such as duration, width and height

dayday6668 commented 2 years ago

How to obtain audio and video information, such as duration, width and height

Using ffmpegJs

brackson commented 2 years ago

This can be done with ffprobe-wasm.

swissspidy commented 2 years ago

https://github.com/buzz/mediainfo.js works well for this

sovrgn commented 1 year ago

How to obtain audio and video information, such as duration, width and height

A non-concise and slightly messy approach (but working) is to get them from the DOM video, image, audio tags and pass them to your ffmpeg function.

Make sure to preload='metadata' on the elements, and/or make sure all of them are inside the viewport when calling document.getElementWhatever.