import ffmpeg from 'fluent-ffmpeg'
import { ensureDir, pathExists } from 'fs-extra'
import { dirname } from 'path'
-import { buildAbsoluteFixturePath, getMaxBitrate } from '@shared/core-utils'
-import { getVideoStreamBitrate, getVideoStreamFPS, getVideoStreamDimensionsInfo } from '@shared/extra-utils'
+import { buildAbsoluteFixturePath, getMaxTheoreticalBitrate } from '@shared/core-utils'
+import { getVideoStreamBitrate, getVideoStreamDimensionsInfo, getVideoStreamFPS } from '@shared/ffmpeg'
async function ensureHasTooBigBitrate (fixturePath: string) {
const bitrate = await getVideoStreamBitrate(fixturePath)
const dataResolution = await getVideoStreamDimensionsInfo(fixturePath)
const fps = await getVideoStreamFPS(fixturePath)
- const maxBitrate = getMaxBitrate({ ...dataResolution, fps })
+ const maxBitrate = getMaxTheoreticalBitrate({ ...dataResolution, fps })
expect(bitrate).to.be.above(maxBitrate)
}