Client-side video stream lag reduction

Submitted by Francois Gouget on June 17, 2019, 5:31 p.m.

Details

Reviewer None
Submitted June 17, 2019, 5:31 p.m.
Last Updated July 26, 2019, 9:52 a.m.
Revision 2

Cover Letter(s)

Revision 1
      The first few patches in this series are the same as those I sent 
previously. But the series main goal is to reduce the video stream lag.

Currently the server sets the client's mmtime offset which is the source 
of the video stream lag. But as was discussed before this offset is 
entangled with the available network bandwidth estimations as well as 
with the actual video bitrate which makes it tricky (although mostly 
doable) to reduce it. Furthermore the server is 5 frame intervals and a 
network roundtrip away which delays any action it can take.

In contrast the client knows immediately when a frame is late and has 
all the information it needs to figure out how much buffering is needed. 
So this is the approach taken in this patchset. See patch 7 and up for 
more details.


Francois Gouget (12):
  gstreamer: Avoid a couple of forward function declarations
  gstreamer: Fix the spice_gst_decoder_queue_frame() documentation
  gstreamer: Improve the statistics collection
  gstreamer: Add the encoded frame's rank to the statistics
  channel-display: The video latency is in fact a margin
  channel-display: Rename the frame mmtime variables
  channel-display: Minimize the stream lag by ignoring the server one
  playback: Use the audio timestamps for the global mmtime conversion
  channel-display: No need to rechedule on mmtime offset changes
  channel-display: Remove playback_sync_drops_seq_len
  spice-session: Keep track of the global streams lag
  mjpeg: Take the decoding time into account to display frames

 src/channel-display-gst.c   | 304 +++++++++++++++++++-----------------
 src/channel-display-mjpeg.c |  40 +++--
 src/channel-display-priv.h  |  27 +++-
 src/channel-display.c       | 304 ++++++++++++++++++++++++------------
 src/channel-display.h       |   2 +
 src/channel-playback-priv.h |   4 +-
 src/channel-playback.c      |  32 ++--
 src/spice-session-priv.h    |   8 +-
 src/spice-session.c         | 103 ++++++++++--
 9 files changed, 525 insertions(+), 299 deletions(-)
    
Revision 2
      Just rebased on master. Original comment from the author (Francois
Gouget):

The series main goal is to reduce the video stream lag.

Currently the server sets the client's mmtime offset which is the source
of the video stream lag. But as was discussed before this offset is
entangled with the available network bandwidth estimations as well as
with the actual video bitrate which makes it tricky (although mostly
doable) to reduce it. Furthermore the server is 5 frame intervals and a
network roundtrip away which delays any action it can take.

In contrast the client knows immediately when a frame is late and has
all the information it needs to figure out how much buffering is needed.
So this is the approach taken in this patchset. See patch 7 and up for
more details.

Francois Gouget (6):
  channel-display: Minimize the stream lag by ignoring the server one
  playback: Use the audio timestamps for the global mmtime conversion
  channel-display: No need to rechedule on mmtime offset changes
  channel-display: Remove playback_sync_drops_seq_len
  spice-session: Keep track of the global streams lag
  mjpeg: Take the decoding time into account to display frames

 src/channel-display-gst.c   |  50 +++----
 src/channel-display-mjpeg.c |  36 +++--
 src/channel-display-priv.h  |  33 ++++-
 src/channel-display.c       | 278 +++++++++++++++++++++++++-----------
 src/channel-display.h       |   2 +
 src/channel-playback-priv.h |   4 +-
 src/channel-playback.c      |  32 +++--
 src/spice-session-priv.h    |   8 +-
 src/spice-session.c         | 103 ++++++++++---
 9 files changed, 371 insertions(+), 175 deletions(-)
    

Revisions