Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
109.64k stars 10.53k forks source link

Scrcpy lagging while streaming to OBS Studio #3977

Open vimalraj27 opened 1 year ago

vimalraj27 commented 1 year ago

Environment

Describe the bug I tried to stream my phone screen with SCRCPY using OBS Studio. I want it as a web cam so I open my Camera app (Open Camera) and streamed it via scrcpy. But after sometime it starts lagging. I think the right term for it would be "frame skipping", I don't really know. I have a pretty strong laptop specs and its not even consumed fully while streaming.

The settings I use in SCRCPY: scrcpy -m 1280 -b 8M --max-fps=30 --turn-screen-off --stay-awake

The lag doesn't seem to be on my phone or Laptops ends. Its either in OBS or Scrcpy. I also came across this another term "Encoder Overloading" which I felt like could be the culprit but I am using my GPU as my encoder.

My Laptop Specs: Lenovo Legion I5 10th Gen NVIDIA 1650 16GB RAM 1.5 GB SSD

Please help with a solution on what to do to avoid this issue.

rom1v commented 1 year ago

If you record with scrcpy --record=file.mkv while OBS is capturing, is the lag also "recorded"? (if you read the recorded file with any player, is it "laggy"?)

evilprimap1 commented 1 year ago

ugh i was using it for my game capturing and yah its a laggy on stream can you guys give me advice ?