check-video-codec

1.1.1 • Public • Published

check-video-codec

JavaScript library that use both mediainfo.js and mp4box for detect video codec

Example

const fs = require('fs')
const CheckMp4Codec = require('check-video-codec')

const filePath = './video/android_open_vpn.mp4' // path to video
const fileStream = fs.createReadStream(filePath)

const checkMp4Codec = new CheckMp4Codec()
// waiting when mediainfo.js will be init
checkMp4Codec.init().then( () => {
    let buf = Buffer.alloc(0)
    fileStream.on('data', async (chunk) => {
        buf = Buffer.concat([chunk])
        // get information about video codec
        const res = await checkMp4Codec.check(buf)
        if (res) {
            console.log(res)
            fileStream.destroy()
        }
    })
})

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.1.12latest

Version History

VersionDownloads (Last 7 Days)Published
1.1.12
1.1.00
1.0.50
1.0.40
1.0.30
1.0.20
1.0.10
1.0.01

Package Sidebar

Install

npm i check-video-codec

Weekly Downloads

3

Version

1.1.1

License

MIT

Unpacked Size

8.72 kB

Total Files

5

Last publish

Collaborators

  • vladimir.shapovalov.nimbusweb.co