buzz/mediainfo.js

Question. Query specific data.

Closed this issue · 5 comments

Im trying to come up with a way to extract specific data.

For example. Frame rate.

Im thinking the syntax should be something like this with result.frameRate

`

        mediainfo
               .analyzeData(getSize, readChunk)
                .then((result) => {
                    consoleLog("Frame: "+ result.frameRate)
                    //output.value = result
                })
                .catch((error) => {
                    output.value = `An error occured:\n${error.stack}`
                })`

but I cant figure out the exact syntax. Can you help point me in the right direction?

buzz commented

I'm able to access the property using result.media.track[0].FrameRate.

Best refer to the original project for available fields and structure.

Thanks buzz. Ill give your suggestion a try. Much appreciated.

When I try to use result.media.track[0].FrameRate I get an error:
TypeError: Cannot read property 'track' of undefined

Here is how I used frame rate.

`mediainfo

        .analyzeData(getSize, readChunk)
            .then((result) => {
                console.log("Frame: "+ result..media.track[0].FrameRate`)
                //output.value = result
            })
            .catch((error) => {
                output.value = `An error occured:\n${error.stack}`
            })

`

Im not sure of the proper use of result.media.track[0].FrameRate and not sure of how it should be defined. Any advice is appreciated.

buzz commented

The repository includes examples that do work. Just try them. If you need further assistance please check SO.

Thank you

Ive got an example to work just fine. Having trouble understanding how all the hooks and snags work so running a few simple experiments to get acquainted with your creation. Ive been through SO from top to bottom and found only vague references to figuring out how to query a frame rate. I couldn't find any thing on SO that provided enough of a well rounded explanation to help me learn.

How can I query frame rate data from your your javascript? seems like I should be able to call result.framerate and get the result.