Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
112.36k stars 10.74k forks source link

[server] ERROR: Encoding error: java.lang.IllegalStateException: releaseOutputBuffer() is valid only at Executing states; currently at Released state #5502

Open zhjyz2 opened 19 hours ago

zhjyz2 commented 19 hours ago

Environment

Describe the bug

When running scrcpy for a random time(several minutes to hours), the mirror get stuck, shut down and give error logs like this, I've used the command scrcpy --turn-screen-off --stay-awake --no-audio -m2768 --print-fps --display-buffer=50 --video-codec=h265 --video-encoder="c2.qti.hevc.encoder"

[server] ERROR: Encoding error: java.lang.IllegalStateException: releaseOutputBuffer() is valid only at Executing states; currently at Released state

[server] INFO: Retrying...
INFO: 63 fps
INFO: 51 fps (+3 frames skipped)
INFO: 64 fps
INFO: 59 fps
INFO: 58 fps (+7 frames skipped)
INFO: 52 fps (+1 frames skipped)
INFO: 61 fps (+1 frames skipped)
INFO: 57 fps
INFO: 64 fps
INFO: 58 fps
INFO: 57 fps (+1 frames skipped)
INFO: 50 fps
ERROR: [FFmpeg] Could not find ref with POC 396
ERROR: [FFmpeg] Invalid number of merging MVP candidates: 6.
WARN: [FFmpeg] Error parsing NAL unit #1.
ERROR: Decoder 'video': could not send video packet: -1094995529
ERROR: Demuxer error

I've also tried the default encoder with the command scrcpy --turn-screen-off --stay-awake --no-audio -m2768 --print-fps --display-buffer=50 , it gets stuck as the same, but it can resume after several retries with the logs like:

[server] ERROR: Encoding error: java.lang.IllegalStateException: releaseOutputBuffer() is valid only at Executing states; currently at Released state

[server] INFO: Retrying...
INFO: 72 fps
INFO: 64 fps
INFO: 76 fps
INFO: 77 fps
INFO: 76 fps
INFO: 76 fps
INFO: 75 fps
INFO: 80 fps
INFO: 75 fps
INFO: 71 fps
INFO: 79 fps
INFO: 75 fps
INFO: 77 fps
ERROR: [FFmpeg] Could not find ref with POC 503
INFO: 42 fps
INFO: 60 fps (+16 frames skipped)
INFO: 77 fps (+5 frames skipped)
INFO: 58 fps
[server] ERROR: Encoding error: java.lang.IllegalStateException: releaseOutputBuffer() is valid only at Executing states; currently at Released state

IN[server] INFO: Retrying...
FO: 61 fps
INFO: 52 fps (+6 frames skipped)
INFO: 52 fps
INFO: 54 fps
INFO: 62 fps
INFO: 66 fps
INFO: 59 fps
ERROR: [FFmpeg] Could not find ref with POC 87
INFO: 47 fps
INFO: 23 fps (+2 frames skipped)
INFO: 90 fps (+17 frames skipped)
INFO: 62 fps
INFO: 105 fps (+4 frames skipped)
INFO: 158 fps (+10 frames skipped)
INFO: 77 fps (+67 frames skipped)
INFO: 77 fps (+93 frames skipped)
INFO: 166 fps (+4 frames skipped)
INFO: 140 fps (+4 frames skipped)
ERROR: [FFmpeg] Could not find ref with POC 562
INFO: 85 fps (+15 frames skipped)
INFO: 179 fps (+5 frames skipped)
INFO: 140 fps (+2 frames skipped)
INFO: 171 fps
INFO: 152 fps
INFO: 152 fps
INFO: 168 fps
INFO: 168 fps
INFO: 133 fps
INFO: 103 fps (+2 frames skipped)
INFO: 67 fps (+33 frames skipped)
INFO: 78 fps (+12 frames skipped)
INFO: 76 fps (+11 frames skipped)
INFO: 173 fps
INFO: 183 fps
INFO: 78 fps
INFO: 60 fps (+1 frames skipped)
INFO: 94 fps
INFO: 35 fps
INFO: 14 fps
INFO: 35 fps
rom1v commented 19 hours ago

Looks like a bug in the encoder on your device :/