RTSP not working well with Tapo cameras

I have three security cameras that I use with Zoneminder. One is a Reolink E1 Outdoor PoE, the other two are Tapo C111. The Reolink works well in Channels, but the two Tapo cameras take a very long time to appear (1 - 2 minutes) and produce a lot of errors in the log such as:

2025/10/22 09:18:33.213289 [HLS] ffmpeg: rtsp-BackDoor:  [mpegts @ 0x3646ad80] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
2025/10/22 09:18:33.213475 [HLS] ffmpeg: rtsp-BackDoor:  [mpegts @ 0x3646ad80] Stream 1, codec pcm_alaw, is muxed as a private data stream and may not be recognized upon reading.
2025/10/22 09:18:51.016367 [HLS] ffmpeg: rtsp-BackDoor:  [mpegts @ 0x3646ad80] Non-monotonous DTS in output stream 0:0; previous: 1751537, current: 1749090; changing to 1751538. This may result in incorrect timestamps in the output file.
2025/10/22 09:19:16.169920 [HLS] ffmpeg: rtsp-BackDoor:  [mpegts @ 0x3646ad80] Non-monotonous DTS in output stream 0:0; previous: 4004689, current: 4002267; changing to 4004690. This may result in incorrect timestamps in the output file.
2025/10/22 09:19:23.377426 [SNR] Buffer statistics for 192.168.3.147 (Naboo) for ch9039 Back Door: buf=0% drop=0%
2025/10/22 09:19:23.377473 [ERR] Error during stream M3U-nbc ch9039 Back Door: read |0: file already closed
2025/10/22 09:19:23.377482 [TNR] Closed connection to M3U-nbc for ch9039 Back Door
2025/10/22 09:19:23.466095 [HLS] ffmpeg: rtsp-BackDoor:  av_interleaved_write_frame(): Broken pipe
2025/10/22 09:19:23.466109 [HLS] ffmpeg: rtsp-BackDoor:  [out#0/mpegts @ 0x36471700] Error muxing a packet
2025/10/22 09:19:23.552765 [HLS] ffmpeg: rtsp-BackDoor:  [out#0/mpegts @ 0x36471700] Error writing trailer: Broken pipe

Both of the Tapo cameras are wireless, but they don't seem to have any issues in Zomeminder, nor when displayed with VLC.

Faced this issue as well, following

I think the first few errors about Timestamsp are just warnings. Codec pcm_alaw might be a sound codec that isn't converted very well. Anyway to change that to aac? You may not have another option to change the sound codec used. Also seems to be many firmware updates for it. I think I had the same issue with one of my Amcrest cameras to where I was able to change it to AAC instead of pcm_alaw G.711a for sound. This was causing a delay in my camera showing up.

Seems to be the latest firmware if I am looking at this right.
Tapo C111(US)_V2.60_1.4.7 Build 250625

An older firmware talks about time synchronization.
10-25-2023
Improved time synchronization accuracy.

Update:
A test on the sound codec would be to see if you can disable it and if the speed improves on the loading of the video then you know its the sound codec causing it.

That's the firmware that I have installed.

Meanwhile, I found a workaround. It turns out that Zoneminder can serve rtsp streams. So I configured it to do so, and pointed my source definition to it, et voila!

Here's how it's done:

  1. In Zoneminder enable the rtsp server for each camera on its Misc tab and give each one a unique rtsp stream name
  2. Set the rtsp port to 20000 on the Options/Network page
  3. Set the url in the source definition to rtsp://zoneminder_ip:20000/camera_rtsp_stream_name

For example:
#EXTINF:-1 channel-id="FrontDoor", FrontDoor
rtsp://192.168.3.139:20000/FrontDoorStream

Nice. I am betting Zoneminder is converting your sound to aac maybe? Do you get sound?

Yes, which is fascinating because Zoneminder records audio if it is enabled, but it doesn't provide it in a live stream.

Is that on all of your cameras or just Tapo C111 where it doesn't play sound live? If just the Tapo then it is converting to a codec it can play back. Drives you nuts that it can do that but not play original content :wink:

1 Like

They are all like that. All of them play video and audio though their respective native apps, and with VLC.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.