<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>Hi,<br><br></div>I have extensive experience with video streaming and display having worked on the xine video player.<br></div>Setting time stamps on a stream of video frames is not the entire solution.<br>
</div>The biggest problem with displaying video on computer displays is "frame rate adaption".<br></div>I.e. The frame rate of the video frames might not equal the frame rate of the display.<br></div>What is really needed is a predictor.<br>
</div>I.e. If I send this frame to the video hardware, what is the exact time it will be displayed.<br></div>A predictor might be difficult, so some callback after the frame is displayed giving the exact time the frame was displayed would also help.<br>
</div>The video player could then use this information to adjust the frame submission to ensure the frame was displayed closer to when it needs to be.<br><br></div>There are various artifacts that appear as a result of frame rate adaption. One of these is field dominance. This is where the top field is displayed for longer than the bottom field. This results in the appearance of flickering lines to the viewer.<br>
</div>If you could determine how long the top field was presented to the user, you could maybe make adjustments to make the bottom field appear for a similar amount of time.<br><br></div>So, I would propose the following.<br>
</div>1) sequence number the frames at the display rate.<br></div>2) provide an api for the application to predict the time of each frame number in the sequence. I.e The next 5 frames will display at time X1,X2,X3,X4,X5. Also provide a way to determine the "frame submited to frame displayed" latency. So the user application knows how many frames in advance it needs to do the submit.<br>
</div>3) provide an api for the application to ensure that a frame it submits will get displayed at display rate sequence number X.<br></div>4) If frame X has already past, only display it if there are now newer frames in the quene, otherwise drop it.<br>
<br><div><div>Summary:<br></div><div>For the best video streaming experience, timestamps on the frame are not very useful, what is useful is predicting exactly when the frame will actually be displayed to the user.<br><br>
</div><div>Kind Regards<br><br>James<br><br></div><div><br></div><div><div><div><div><div><br></div></div></div></div></div></div></div>