birdgen/src/checkResolution.js
hazy 0a01583f56 Various improvements
Make CLI arguments use flags, support webm output encoding, allow running from any working directory, add optional profiles, add audio to spliced-in clips, various small fixes
2022-06-28 17:45:21 -05:00

13 lines
454 B
JavaScript

import fs from 'fs'
import exec from './exec.js'
export default async function checkResolution(filename) {
const {stdout, stderr} = await exec(`ffprobe -v error -select_streams v -show_entries stream=width,height -of csv=p=0:s=x "${filename}"`)
let currentDimensions = ((arr) => {
return {
width: parseInt(arr[0]),
height: parseInt(arr[1])
}
})(stdout.trim().split('x'))
return currentDimensions
}