Skip to content

Find the reason for the picture delay #16

@raozhihao

Description

@raozhihao
  1. when reading the frame length and the remaining frame data, you can use videostream Readasync method,
    And delete readtimeout

  2. the received frame data can be stored in the channel and parsed in other threads, so that the socket receives and parses the video frame data and draws the interface separately

Through this, I found the reason for the picture delay

Only on my laptop, when FPS is at 30, the screen does not delay, but when FPS is at 60, the delay is very serious

When the FPS is at 30, if the CPU occupation of my notebook is high, the delay will also occur

Through observation, it is found that the main reason for the delay is that the consumption time of data analysis exceeds the time of socket receiving data, resulting in more and more serious delay

This does not happen on high-performance desktop computers

However, when multiple instances are started, for example, when 6 instances are started, 2-3 mobile phone images will delay

But scrcpy can achieve 60 FPS on my laptop

It was observed that he used GPU to parse data

I tried AV_ HWDEVICE_ TYPE_ D3D11VA

But the situation is not ideal, even worse than the current soft decoding

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions