rzeldent / esp32cam-rtsp

Simple RTSP (streaming image) server for the ESP32CAM. Easy configuration and monitoring through the web interface.
663 stars 121 forks source link

Feature request, clock overlay #116

Open rubin110 opened 8 months ago

rubin110 commented 8 months ago

It would be great if there was a clock overlay on the video stream, though I'm pretty sure that's impossible due to how limited the platform is. Also I imagine you'll need to include some NTP client to grab the time. Anyhow, figured it couldn't hurt to ask. Thanks!

rzeldent commented 8 months ago

Hi Rubin,

Sure does not hurt to ask!

RTSP has the provision to include a timestamp in the stream. See CStreamer.cpp

    RtpBuf[8] = (m_Timestamp & 0xFF000000) >> 24; // each image gets a timestamp
    RtpBuf[9] = (m_Timestamp & 0x00FF0000) >> 16;
    RtpBuf[10] = (m_Timestamp & 0x0000FF00) >> 8;
    RtpBuf[11] = (m_Timestamp & 0x000000FF);

Not exactly clear how this is used right now. Seems to start at 0 and updated based on the fps.

This could be used to generate some overlay (lateron) but will require a dependency on NTP...

An overlay is really out of scope because the esp32 is already at the max of CPU power for processing and sending images. However, will take a look at the possibility to include a valid/NTP timestamp!