Genymobile / Genymobile/scrcpy

Scrcpy image freezes after some frames

Open
#2,964 17 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
150k
Forks
13.7k
Avg merge
4d 13h
Merged PRs (30d)
2

Description

- [x] I have read the [FAQ](https://github.com/Genymobile/scrcpy/blob/master/FAQ.md).
- [x] I have searched in existing [issues](https://github.com/Genymobile/scrcpy/issues).

**Environment**
- OS: Windows 7
- scrcpy version: 1.21 (1.20 same issue)
- installation method: windows release
- device model: Xiaomi Redmi Note 10 Pro
- Android version: 12 (ArrowOs [aosp] custom rom)

**Describe the bug**
First i should say that i have to use the windows 7 fix from #2840
and i also need to use --encoder `OMX.google.h264.encoder` or `c2.qti.avc.encoder`, otherwise i get errors.
Using a different framerate, resolution or switching to the opengl renderer doesnt fix it.

Scrcpy opens up and everything works, till i touch my phone or use scrcpy to swipe or click. As soon as something happens on the display, scrcpy works for a few more frames and then the image (not the software) freezes. I can still input swipes in the software and they get executed on my phone but video is not transmitted anymore. It just stays at whatever frame froze.

`scrcpy --record file.mp4` records untill the point where everything freezes, the ends and no further recording is saved.
`adb shell screenrecord sdcard/test.mp4` records for how long i need it but its all black
The phone/android has an inbuild recording function which works perfectly fine

```
C:\Users\calvin\Desktop\scrcpy_new>scrcpy -m 1024 --encoder OMX.google.h264.encoder
scrcpy 1.21
C:\Users\calvin\Desktop\scrcpy_new\scrcpy-server: 1 file pushed, 0 skipped. 25.2 MB/s (40067 bytes in 0.002s)
[server] INFO: Device: Xiaomi M2101K6G (Android 12)
INFO: Renderer: direct3d
INFO: Initial texture: 464x1024
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce with scrcpy 1.21 on Windows 7, the Xiaomi Redmi Note 10 Pro running Android 12, and the OMX.google.h264.encoder or c2.qti.avc.encoder options shown in the report. Exercise the device by touching or swiping, then compare the live image and --record file.mp4 behavior with the working Android recording function. Done means video continues after display input and recording does not stop at the frozen frame.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, c
Domain
audio-video-rtc, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.