Skip to content

...reader is too slow, discarding XX frames. On Raspberry Pi 4 and Zero 2 #5093

Description

@7789userxyz

Which version are you using?

v1.15.2

Which operating system are you using?

raspi-os bookworm arm64

Describe the issue

Fresh installed Raspbian Bullseye/Bookworm/Trixie arm64 on Pi Zero 2 W or Pi 4. I am setting up a minimal configuration to use the Pi camera (source: rpiCamera).
After starting mediamtx in commandline it says INF [path cam] [RPI Camera source] ready: 1 track (H264)
When starting watching the livestream via browser, phone, etc. the stream is running perfectly with alsmost zero delay. After a randome time ( sometimes 5 mins sometimes 20 mins) of watching the stream the picture starts to get buggy and the Pi terminal gives the following ...

2025/10/14 22:10:30 INF [WebRTC] [session a3f0d983] peer connection established, local candidate: host/udp/2a02:6d40:237d:8e01:aa15:f6a1:49d9:db0d/8189, remote candidate: prflx/udp/2a02:6d40:237d:8e01:316e:318d:b76:1c7c/48883
2025/10/14 22:10:30 INF [WebRTC] [session a3f0d983] is reading from path 'cam', 1 track (H264)
2025/10/14 22:10:32 WAR [WebRTC] [session a3f0d983] reader is too slow, discarding 10 frames
2025/10/14 22:10:33 WAR [WebRTC] [session a3f0d983] reader is too slow, discarding 440 frames
2025/10/14 22:10:34 WAR [WebRTC] [session a3f0d983] reader is too slow, discarding 446 frames
2025/10/14 22:10:35 WAR [WebRTC] [session a3f0d983] reader is too slow, discarding 450 frames
2025/10/14 22:10:36 WAR [WebRTC] [session a3f0d983] reader is too slow, discarding 447 frames
2025/10/14 22:10:37 WAR [WebRTC] [session a3f0d983] reader is too slow, discarding 147 frames
2025/10/14 22:10:42 WAR [WebRTC] [session a3f0d983] reader is too slow, discarding 126 frames

A few seconds later, WebRTC becomes unavailable and the Pi crashes completely, requiring a restart.
This was tested on two factory-new Pi Zero 2 (Bullseye, Bookworm and Trixie) with three different versions of PiCam (the original Raspberry Pi camera). Wifi connection and speed can be excluded.

Also tried to change the readTimeout but no difference.

I have no idea what else to try or how to fix for raspberry pi zero 2 W and Pi 4.

Describe how to replicate the issue

Just installing mediamtx on Raspberry pi Zero 2 with fresh Bookworm.
Run mediamtx and watching webrtc stream via Browser for some minutes.

MediaMTX configuration

###############################################

Only changes i made in mediamtx.yml

paths:
cam:
source: rpiCamera

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