When I first was researching scrcpy, I found a thread (probably under “issues” on the GitHub repository for scrcpy) where someone else requested the same. They then went on to create a prototype using Java that the author of scrcpy seemed impressed with, but that was as far as it went. The prototype was based on a very old version (1.x) of scrcpy, so I never bothered trying it. Might be usable for this purpose, however.
Tomorrow never comes.