Vanilagy / mp4-muxer

MP4 multiplexer in pure TypeScript with support for WebCodecs API, video & audio.
https://vanilagy.github.io/mp4-muxer/demo
MIT License
419 stars 32 forks source link

latest version of mp4 muxer is broken #48

Closed RavikumarTulugu closed 4 months ago

RavikumarTulugu commented 4 months ago

Latest version of mp4 muxer is broken, the onData callback never gets invoked, when the mp4-muxer.js is reverted to a previous version ( commit b295e920d776a3a44cc8a12771f0a3f7a0aed468) , things started working. please check.

Vanilagy commented 4 months ago

The streaming demo uses the latest version of mp4-muxer and uses the onData callback, and it works. Could you check that you're using the library correctly?

Vanilagy commented 4 months ago

Bumping the library's major version (from 3 to 4) means breaking changes can happen and you are expected to adjust your code accordingly. In version 3, the API of StreamTarget was:

constructor(
    onData: (data: Uint8Array, position: number) => void,
    onDone?: () => void,
    options?: { chunked?: boolean, chunkSize?: number }
);

In version 4, it now is:

constructor(options: {
    onData?: (data: Uint8Array, position: number) => void,
    chunked?: boolean,
    chunkSize?: number
});

Perhaps you forgot to update your usage of StreamTarget in your code. If you are using TypeScript, then this should show up as a type error in your code.

RavikumarTulugu commented 4 months ago

ok , got it !!! thank you for the reply.