async function getVideoFileFPS (path: string) {
const videoStream = await getVideoFileStream(path)
- for (const key of [ 'r_frame_rate' , 'avg_frame_rate' ]) {
+ for (const key of [ 'avg_frame_rate', 'r_frame_rate' ]) {
const valuesText: string = videoStream[key]
if (!valuesText) continue
if (err) return rej(err)
const videoStream = metadata.streams.find(s => s.codec_type === 'video')
- if (!videoStream) throw new Error('Cannot find video stream of ' + path)
+ if (!videoStream) return rej(new Error('Cannot find video stream of ' + path))
return res(videoStream)
})