ktnrg45 / pyremoteplay

Python API for using PlayStation Remote Play
https://pyremoteplay.readthedocs.io/
GNU General Public License v3.0
29 stars 11 forks source link

Apple Silicon stops rendering after first frame (seemingly) #8

Closed L422Y closed 2 years ago

L422Y commented 2 years ago

Everything almost works and then it spits this out, and video stream stops rendering after one (or a few?) frames, I can control it for a while and then an error pops up: "Decoder could not keep up. Try lowering the framerate / resolution"

I imagine it is because of an incompatibility with arm64 / Apple Silicon, but strange how the first frame works.. is it sent as a static image?

WARNING:libav.swscaler:No accelerated colorspace conversion found from yuv420p to rgb24. WARNING:pyremoteplay.av:AV Handler max queue size exceeded

ktnrg45 commented 2 years ago

This is probably an issue with pyav/FFMPEG. You may need a custom build of FFMPEG. One thing that you could try is to enable the 'Use OpenGL' option. This should let OpenGL handle the yuv420p to rgb conversion instead of pyav.

ktnrg45 commented 2 years ago

The video stream is a raw h264 or hevc bitstream.

Looking at libswscale, it seems that there is no optimized conversion written for ARM64. So the conversion will be using the generic unoptimized code which is slower. The error about the decoder not keeping up also points to this. Bottom line is that the stream cannot be decoded fast enough.

Will be closing this soon since this seems to be a pyav/FFMPEG issue, but would be interested to hear if enabling OpenGl will resolve this.

L422Y commented 2 years ago

Check out this thread on ffmpeg's trac, where a patch for h264 decoding on m1 has been posted (3 weeks ago)