-
Hi everyone, I'm looking for a way to attach timestamps (like "2024-10-18 01:23:45.00 UTC") to each video frame sent from the sender side. Ideally, I want the receiver to retrieve this information and display it alongside the video stream. @Sean-Der previously suggested using insertable streams (link: https://stackoverflow.com/a/67830283). However, I'm unsure how to add this type of data to a track. The official insertable stream example focuses on manipulating video data itself, not sending additional text data alongside it. My question is: Is there a way to use WebRTC to transmit non-audio, non-video text data alongside the video stream, especially when the data is directly related to each frame? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @wjkoh You can use insertable streams for this! On the sender side insert your timestamp in each video frame. Have the last 8 bytes will always be a timestamp. Then on the receiver side extract (and remove) the last 8 bytes. If you don't remove the bytes the video will be corrupted. If you need help implementing I am happy to put up a jsfiddle. Best of luck! |
Beta Was this translation helpful? Give feedback.
Hey @wjkoh
You can use insertable streams for this! On the sender side insert your timestamp in each video frame.
Have the last 8 bytes will always be a timestamp. Then on the receiver side extract (and remove) the last 8 bytes. If you don't remove the bytes the video will be corrupted.
If you need help implementing I am happy to put up a jsfiddle. Best of luck!