Skip to content

MP4Box.js crashes with uncompressed audio. #467

Open

Description

@louderspace

MP4Box attempts to create a javascript per audio sample when it references uncompressed PCM sample data. This is also quite common with Quicktime .mov files.

To reproduce the problem:

  1. Download this file: https://www.dropbox.com/scl/fi/2n9ewhxeo4r1h813abn59/500x500_30FPS_600s_HEVC_PCM.mp4?rlkey=9vyzx3s80ydsiwvbypgzrk0i6&dl=0
  2. Using the test page, https://gpac.github.io/mp4box.js/test/filereader.html hit the "Choose File" button, select the downloaded file, and when uploading finishes, select the "Load" button.
  3. If it doesn't crash the tab, just hit "Load" again and again.

Result: In Chrome: "Aw Snap!" Error code 5.

This is due to the buildTrakSampleLists creating a javascript object for each audio sample! MP4Box.js should detect uncompressed audio formats and allow the client to access those samples, without allocating excessive javascript memory.

Activity

  1. louderspace commented on Oct 24, 2025

    @louderspace
    Author

    Any updates on this issue? I think a good starting point here would be to just simply ignore the uncompressed samples, as opposed to creating a JavaScript object per sample, since that will crash my browser tab if the duration of the file is > 5m.

  2. kstreeter commented on Jan 27, 2026

    @kstreeter

    Following up on this with some additional thoughts. As the bug report describes, we encounter this issue when there is uncompressed audio in the container. We don't actually want to access the audio information, just the video. We are considering just setting ISOFile.sampleListBuilt to true before parsing, in order to suppress building of the sample lists. We can then just build lists for video via ISOFile.buildTrakSampleLists. This feels like manipulating implementation details though, so we wanted to get your feedback. Is this a valid approach?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions