Update update.js

This commit is contained in:
Aleksandr Statciuk 2022-06-09 03:52:11 +03:00
parent 82f1d9b276
commit 9f9cb8f636
1 changed files with 3 additions and 3 deletions

View File

@ -127,7 +127,7 @@ function parseMediaInfo(streams) {
streams = streams.filter(s => s.codec_type === 'video')
streams = streams.map(s => {
s.bitrate = s.tags && s.tags.variant_bitrate ? parseInt(s.tags.variant_bitrate) : 0
s.frame_rate = parseFrameRate(s.r_frame_rate)
s.frame_rate = parseFrameRate(s.avg_frame_rate)
return s
})
@ -136,8 +136,8 @@ function parseMediaInfo(streams) {
return _.head(streams) || {}
}
function parseFrameRate(r_frame_rate = '0/0') {
const parts = r_frame_rate.split('/')
function parseFrameRate(frame_rate = '0/0') {
const parts = frame_rate.split('/')
const number = parseInt(parts[0]) / parseInt(parts[1])
return Math.round(number * 100) / 100