I’m using WebRTC to send video from a server to client browser (using the native WebRTC API and an MCU WebRTC server like Kurento).
Some options I thought about:
- Sending the data by WebRTC DataChannel. But I don’t know how to ensure the data is synchronized on a per-frame basis. But I couldn’t find a way to ensure the data sent by the data channel and the video channel is synchronize (again, I hope to get precision level of single frame).
timeupdateevent, but I don’t konw if it will work for precision level of frame, and I’m not sure what it means in a live video as in WebRTC.
- Sending the data manually and attach it to the video applicatively as another
TextTrack. Then use the
onexitto read it synchronizely: http://www.html5rocks.com/en/tutorials/track/basics/. It still requires precise timestamps, and I’m not sure how to know what are the timestamps and if Kurento pass them as-is.
- Using the statistics API of WebRTC to manually count frames (using
getstats), and hope that the information provided by this API is precise.
What is the best way to do that, and how to solve the problems I mentioned in either way?