Skip to content

No way to change the duration when use transmuxer to generate mp4 #210

Open
@shellvon

Description

@shellvon

When I try to generate the mp4 file by use mux.js, I got wrong duration time in generated mp4 file, the result time is aways 0xffffffff => 13:15:24。 It's a default value:

track.duration = track.duration || 0xffffffff;

How to calculate the correct duration according the MPEG2-TS packets by use mux.js? Or How I change the correct duration before call the method mp4.initSegment(this.pendingTracks); in lib/mp4/transmuxer.js#L835-L842 or earlier

i added an event listener with some code like this:

transmuxer.on('data', (event) => {
    if (!remuxedInitSegment) {
      remuxedInitSegment = event.initSegment;
      // I also want to change the duration time by use remuxedInitSegment.set([xxxx], index)
      // But i don't know how to find the right index....   :'(
    }
})

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions