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

Decode : RangeError: offset is out of bounds #217

Open
dezmou opened this issue Apr 26, 2020 · 1 comment
Open

Decode : RangeError: offset is out of bounds #217

dezmou opened this issue Apr 26, 2020 · 1 comment

Comments

@dezmou
Copy link

dezmou commented Apr 26, 2020

Hello :)

I wants to get all frames from the fox.mp4 as pixels array for each frames, I don't want to display it in any canvas.

When looking in the code of Decode.js I may have figured out that decode() accept Uint8Array as parameters so I've made this code :

(async () => {

    const decoder = new Decoder({
        // rgb: true
    })
    const arrayBuf = await (await fetch("/fox.mp4")).arrayBuffer()
    let uint8 = new Uint8Array(arrayBuf)
    decoder.decode(uint8)
    decoder.onPictureDecoded = (a, b, c, d) => {
        console.log(a, b, c, d);
    }

})()

But I've got an error :

Decoder.js:371 Uncaught (in promise) RangeError: offset is out of bounds
    at Uint8Array.set (<anonymous>)
    at Broadway.decode (Decoder.js:371)
    at index.js:8

Is that a bug from Broadway or my implementation is wrong ?

Thanks a lot !

@soliton4
Copy link
Collaborator

you have to feed single nal units to the decoder.
use the mp4 parser but dont instanciate a player, instead feed the nal units to the decode function of your decoder instance

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

2 participants