Skip to content

find_stream_info reads to the full probe budget chasing an unresolvable attached-picture (mjpeg cover) stream, slowing remote open #75

Closed

Description

What happened?

A remote MP4 carries an embedded cover-art stream (mjpeg, 0x0). avformat_find_stream_info can't
resolve its parameters, so it reads all the way to the probe ceiling trying — pulling tens of MB over the
network on every open before the (instantly-resolvable) H.264 + AAC streams can start. The video/audio
params are available almost immediately; the open is dominated by the dead-end cover stream.

[Demuxer]   stream[3] type=video codec=mjpeg 0x0
[warning] Could not find codec parameters for stream 3 (Video: mjpeg, none): unspecified size
Consider increasing the value for the 'analyzeduration' (60000000) and 'probesize' (52428800) options
[AVIOReader] detour fill … block=13 offset=54525952      ← ~54 MB pulled during the probe

Steps to reproduce

  1. Play a remote MP4/MKV that contains an attached-picture / cover-art stream (e.g. mjpeg at 0x0, the
    kind many remuxes embed as a poster).
  2. Watch the open: find_stream_info reads toward probesize/analyzeduration and the AVIO pulls tens
    of MB before first frame, with Could not find codec parameters for stream N (… mjpeg …).

AetherEngine version or commit SHA

4.2.1

Host app

Custom / my own integration

Platform

macOS

OS version

27 beta

Device / chip

m2 pro / 19 pro

Playback path

Native AVPlayer

Source media (for playback bugs)

MP4 (mov,mp4), H.264 1080p + AAC + EIA-608, with an embedded mjpeg 0x0 cover-art stream.

Error codes / log lines

[Demuxer] stream[3] type=video codec=mjpeg 0x0
[warning] Could not find codec parameters for stream 3 (Video: mjpeg, none): unspecified size
Consider increasing … 'analyzeduration' (60000000) and 'probesize' (52428800)

Anything else

Activity

  1. ghost added
    bug
    on Jun 26, 2026
  2. DrHurt commented on Jun 26, 2026

    @DrHurt
    Contributor

    I think this last comment was meant to go into the other thread.

    I’ll link it here!

    #74

  3. superuser404notfound commented on Jun 26, 2026

    @superuser404notfound
    Owner

    Fixed in 4.5.1.

    Confirmed the open was dominated by the dead-end cover stream: an mjpeg attached-picture reported as 0x0 keeps avformat_find_stream_info reading toward probesize trying to resolve codec parameters that never resolve, pulling tens of MB before the (instantly-resolvable) H.264 + AAC streams can start.

    Note that AVDISCARD_ALL alone does not help here: find_stream_info's termination loop breaks on any stream without codec parameters and does not consult discard, so the cover would still be chased to the budget. Instead, attached-picture streams are now reclassified to AVMEDIA_TYPE_ATTACHMENT before stream-info probing. find_stream_info syncs codecpar into its internal avctx at setup, and has_codec_parameters returns true for an ATTACHMENT stream with no width/pixfmt/decoder dependency, so the probe stops once the real streams resolve. Cover-art extraction is unaffected (it reads the attached picture plus the unchanged disposition; discard is deliberately left alone so the cover is still queued).

    If you can retest open time on 4.5.1 with your cover-art file, a confirmation would be appreciated. Thanks for the report.

  4. ghost closed this as completedon Jun 26, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions