Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using filters #2

Open
davthedev opened this issue Apr 27, 2022 · 0 comments
Open

Error when using filters #2

davthedev opened this issue Apr 27, 2022 · 0 comments

Comments

@davthedev
Copy link

Attempting a simple filter to convert pixel format, there is an error when calling the filter method on the filterer.

Unexpected N-API status not OK in file ../src/beamcoder_util.cc at line 149 value 10

Simultaneously, the JS code receives a TypeError: Cannot convert undefined or null to object error.

Can be fixed by updating beamcoder C++ sources by a newer version. I replaced all C++ files from the src directory by those from beamcoder 0.6.3 and the situation was resolved.
I was not sure about using newer versions due to FFmpeg dependency version upgrades, which would require rebuilding the static libraries.

Source code of the situation leading to the error:

    // dm is an already instantiated demuxer
    let packet = await dm.read()

    let dec = beamcoder.decoder({ demuxer: dm, stream_index: 0 })
    let decResult = await dec.decode(packet)
    if (decResult.frames.length === 0)
        decResult = await dec.flush()

    let v_filterer = await beamcoder.filterer({
        filterType: 'video',
        inputParams: [
            {
                width: dec.width,
                height: dec.height,
                pixelFormat: dec.pix_fmt,
                timeBase: dec.time_base,
                pixelAspect: dec.sample_aspect_ratio,
            }
        ],
        outputParams: [
            {
                pixelFormat: 'rgb24'
            }
        ],
        filterSpec: 'null', // we only want to convert pixel format
    })
    
    // This call triggers the error
    let filtered = await v_filterer.filter(decResult.frames)`

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant