DecodeFrame failed
Environment
- OS: Fedora KDE 40
- scrcpy version: 2.4
- installation method: apt
- device model: OnePlus 7 Pro
- Android version: 14 (Custom ROM YAAP)
INFO: Renderer: opengl INFO: OpenGL version: 4.6.0 NVIDIA 550.78 INFO: Trilinear filtering enabled INFO: Texture: 888x1920
Describe the bug Hello, I'm facing a problem, scrcpy crashes approximately every 2-3 minutes with the log below, I tried other codecs, but they all work very slowly, only launching with these parameters meets my requirements for responsiveness, but leads to the error "scrcpy - -turn-screen-off --keyboard=uhid -e -b30M --max-size 1920 --video-bit-rate=24M ". In this regard, I would like to know how to solve the problem, because it is almost impossible to use with other codecs. I run it with adb over Wi-Fi. And all the time the same packet with a number -1313558101 in error log.
WARN: [FFmpeg] [OpenH264] this = 0x0x7ff7d40020f0, Warning:DecodeCurrentAccessUnit() failed (459800) in frame: 0 uiDId: 0 uiQId: 0
ERROR: [FFmpeg] DecodeFrame failed
ERROR: Decoder 'video': could not send video packet: -1313558101
ERROR: Demuxer error
ERROR: Decoder 'video': could not send video packet: -1313558101
$ printf '%x' 1313558101 | xxd -r -p | rev
UNKN
It's AVERROR_UNKNOWN.
It's either a bug in the encoder or the decoder.
To determine which one is the culprit, you could try to record a capture with the same parameters, but without playback:
scrcpy --turn-screen-off -e -b30M --max-size 1920 --video-bit-rate=24M --no-playback --record=file.mp4
After a few minutes, stop the capture and play the file with a media player (like VLC). Does it decode successfully?
If you record to .mkv, you should even be able to play the file while it is recorded.
scrcpy --turn-screen-off -e -b30M --max-size 1920 --video-bit-rate=24M --no-playback --record=file.mkv
# in parallel, a few seconds later
vlc file.mkv