Scrcpy: Frame lag

Created on 13 Dec 2019  路  20Comments  路  Source: Genymobile/scrcpy

When i cast my screen i got some frame lag .. without any reason ...my GPU is using 30 percent while mirroring through usb

performance question

All 20 comments

What do you mean by "frame lag"?

Is it "low fps" (stuttering), or a delay between what you see on the device and what you see in scrcpy?

When this happen, press Ctrl+i in scrcpy and look at the FPS in the console.

Also, record a video (scrcpy --record file.mkv). Does the recorded video suffer from the same problem?

Also see #798.

I face fps issue iy decreases subsiquently 50-40-25-27-29. This issue only via usb cable working fine via wifi.

I face fps issue iy decreases subsiquently 50-40-25-27-29.

Note that it is normal to get low fps when the device screen does not change a lot (the device sends a frame only on a change).

But when it lags, is it only in scrcpy (or also on the device)?
If you record, and play the file, does it still lags? (is the lag recorded?)

Hey, I also have the same issue via USB.
I tried playing COD Mobile, on the phone it's buttery smooth, but on scrcpy it drops to 30-40 quite regularly (monitored via Fraps). Bitrate is set to 20m, max size is 1680. No latency, just random framedrops.
Also tried recording, the output video crashes VLC and in Win10 default video program it's just an artifact mess.
Snapdragon 855, Android 10

Also tried recording, the output video crashes VLC and in Win10 default video program it's just an artifact mess.

How did you stop the recording? You close the scrcpy window? (not the terminal)

Could you share your recorded file?

it drops to 30-40 quite regularly (monitored via Fraps)

Did you measure the framerate on the device? Are you sure it's not also at 30-40? You can get the framerate in the window by pressing Ctrl+i in the scrcpy window. But in itself, the framerate does not give a lot of information, since there is a new frame only when the screen content changes.

How did you stop the recording? You close the scrcpy window? (not the terminal)

I closed the scrcpy window.

Could you share your recorded file?

Will upload once I get home.

Did you measure the framerate on the device? Are you sure it's not also at 30-40?

I didn't measure the framerate but I'm 100% sure it was stable 60 fps. I was playing while looking at the phone screen, I would have noticed the frame drop.

I also tried --render-expired-frames but it didn't help, didn't notice any change. Bitrate increase did help, but it just lowered the frequency of the frame drops and the minimum fps it drops to.

Mega link to the recorded video: link

my issue is mirroring is not smooth so in 60 fps .. i faced it

hey @rom1v plzz smooth the mirroring of scrcpy . my issue is not with the recording .. i am getting constant 60 fps in cmd but its laggy mirroring ..

my issue is not with the recording

So ig you record and play with vlc, it's not laggy?

The framerate shown by Ctrl+i is the number of frames per second provided by the device (so it's also the framerate of the recorded video).

If it lags, the device is not performant enough to render a game and encode its stream at the same time without performance impact.

only way i have found to minimize this problem is by using maximum cpu/gpu frequency on your mobile device. (tested on oneplus7)
It also depends on the host cpu/gpu performance specially with --render-expired-frames you will get hiccups if host cpu/gpu can't keep up with client/mobile device.

For those who get laggy recording, please make sure you have the correct video driver is installed on your PC. I had same problem I was struggling to find a solution. I tried on 3 different PC then realize that only PC with graphics driver installed record buttery smooth video. Even my 12 year core2duo laptop record 60fps smooth video of pubg mobile when i install graphics driver.

Device: oneplus 7

Faced with similar issue.

Launch with command: scrcpy --bit-rate 2M --max-size 800

Swipe on home screen of physical devices performs well, in the mirroring screen it is not smooth, ~1-2 seconds delay and slow movement

I recorded video -- video doesn't have this issue, movement is as expected.

Environment:
Nexus 5, Android 6.0, Windows 7, scrcpy v1.16

@rom1v, do you have any suggestion on this? I find this tool great, but what I see now doesn't meet my expectations.

I recorded video -- video doesn't have this issue, movement is as expected.

Then the problem is on your computer side, not able to decode or render fast enough.

What is the output in the console if you enable fps counting (when you press Alt+i in the scrcpy window)?

Can not get this information: ctrl+I in scrcpy window doesn't change behaviour of console nor scrcpy window.

On v1.16, it's Alt+i, not Ctrl+i.

1,2,3,13,9 FPS

What could be the issue behind it?

OK, so if the recording is ok, it's definitely a decoding issue on the computer side.

Your computer probably don't have a hardware decoder.

Btw, if you can play the recorded file on the same computer without problem, then it's not a missing hardware decoder, but the fact that ffmpeg/SDL used by scrcpy could not use hardware acceleration (driver issue?).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

YurieCo picture YurieCo  路  4Comments

BloodPHamtOm picture BloodPHamtOm  路  3Comments

SamuelBlickle picture SamuelBlickle  路  3Comments

behzadpooldar picture behzadpooldar  路  4Comments

fernandofreamunde picture fernandofreamunde  路  4Comments