从Twitch流创建屏幕截图/图像

I've messed around with FFmpeg some time ago and remember using it to fetch preview images for video files. My question is, is this the correct path to be going down for the purpose of getting images from a Twitch live stream? What I need to do is get a screenshot of the end of a Twitch stream (the final scoreboard in a video game) and save that screen shot.

I'm pretty sure I could get the code written, but I want to make sure there isn't a better way of accomplishing this task because it seems like it would have gotten easier over the years. If there are any other libraries/APIs that would be more efficient than executing FFMpeg all the time.

I hope there's been some improvement in PHP video handling, but I've searched around and can't find anything.

Since it's a live stream with a variable duration then the real problem is not getting the screenshot but rather finding out when you should take the screenshot aka the exact moment when the score is shown.

If you know it's always at the end and you if can guess the stream duration then you could record the last few minutes then get the duration of the recorded video, seek to end minus x seconds and grab your screenshot.

PHP video handling usually means building a wrapper class around a tool like ffmpeg that will create an argument list and execute the binary for you.