Skip to content

Audio/Video pipeline waiting state during compression on Flutter #319

@shinesoftware

Description

@shinesoftware

While compressing a video using video_compress: ^3.1.4 in my Flutter project, I noticed that the audio and video pipelines sometimes enter a waiting state. The compression does not fail completely but seems stalled at the reader step for both audio and video streams.

Steps to Reproduce
1. Use video_compress: ^3.1.4 in a Flutter project.
2. Attempt to compress a video with audio.
3. Observe the logs during compression.

Expected Behavior
The video should compress without the reader entering a persistent waiting state.

Actual Behavior / Logs

V/Pipeline(Audio)(25613): execute(): starting. head=0 steps=6 remaining=6
V/MediaMetadataRetriever(25613): extractMetadata(9)
I/Decoder(AUDIO,4)(25613): buffer() failed. dequeuedInputs=0 dequeuedOutputs=5
V/Reader (25613): Returning State.Wait because buffer is null.
V/Pipeline(Audio)(25613): execute(): step Reader (#0/6) is waiting. headState=State.Ok(kotlin.Unit) headIndex=0
V/Pipeline(Video)(25613): execute(): starting. head=0 steps=7 remaining=7
V/MediaMetadataRetriever(25613): extractMetadata(9)
I/Reader (25613): Returning State.Wait because source can't read VIDEO right now.
V/Pipeline(Video)(25613): execute(): step Reader (#0/7) is waiting. headState=State.Ok(kotlin.Unit) headIndex=0
V/Segment(VIDEO,0)(25613): canAdvance(): state=State.Wait
V/Segments(25613): hasNext(VIDEO): segment=com.otaliastudios.transcoder.internal.Segment@f2a8767 lastIndex=0 canAdvance=true

Environment:
• Flutter version: 3.27.1 ([user-branch] channel)
• Dart version: 3.1.1
• video_compress: ^3.1.4
• Platform: Android (logs provided are from Android)
• Device: macOS 14.5, darwin-arm64

Additional Notes
• Audio pipeline shows buffer() failed with dequeuedInputs=0, dequeuedOutputs=5.
• Video pipeline reader returns State.Wait because source cannot read video immediately.
• This seems related to media metadata retrieval or reading segments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions