Skip to content

iOS: MediaRecorder produces videos with frozen frames and extended duration in release builds #1905

@VerioN1

Description

@VerioN1

Describe the bug
In iOS release mode, video recordings contain frozen frames at the end. The MediaRecorder creates videos with incorrect timestamps where the last frame is held/repeated for an extended duration. For example, a 3-second recording appears as 12-13 seconds with the video being the last frame frozen from the 3rd seconds until the end of the webRTC session. This issue only occurs in release mode - debug builds work correctly.
To Reproduce
Build Flutter app in release mode on iOS device
Use flutter_webrtc MediaRecorder to record video from a WebRTC stream
Record multiple short videos (e.g., two 3-second recordings)
Stop recording and wait couple of seconds before ending the session
check the video file duration with videoController
The output will show frozen frames
Expected behavior
Videos should maintain correct duration (3 seconds recorded = 3 seconds in file)
No frozen frames should appear at the end of recordings
Platform information
Flutter version: 3.32.5
Plugin version: flutter_webrtc 1.0.0
OS: iOS
Xcode - develop for iOS and macOS (Xcode 16.4)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions