Taking stream screenshot fails

I have made a command for a bot of mine where it will take a screenshot of the stream and send this to Discord.

However, when trying on different channels, I see that in some channels it doesn’t work as intended, but instead I see a “Preparing your stream” Twitch generated image. (Using twitch-m3u8 to get the m3u8 source and then ffmpeg to capture the frame)

It happens in some channels consistently, while not in some others.

What causes this, and is there anything the streamer can do so this is not an issue?

The only supported way to access the Twitch stream is through the Twitch Player (such as on Twitch itself, an embed, or through one of the Twitch apps). You’re trying to access the stream through unsupported methods, and as such are getting unexpected results, and likely wont get any help or support here as you’re doing something you shouldn’t be doing.

A more appropriate way would be to take a screenshot from the source itself, such as OBS on the broadcasters machine capturing the frame and relaying that back to your app.

Take the screenshot from OBS instead as it has a relevant command via Websocket.

Or Use the Thumnail from Get Streams.

Either way theres a “accuracy/timing” problem so you probably want from Stream Software instead of whatever you are trying to do?

Thats not documented or supported

Thanks for the answers. I thought that maybe using OBS was the way, but then it would mean me having to set up a way for them to run this while also having access to the Discord bot that will send the captured screenshot to Discord. (Will be looking into this, thanks)

I remember a streamer having this setup from the source itself, but it had a flaw, and it’s that when OBS was switched to a BRB scene, the command would still take a screenshot from the source (Not good for when he was BRB on a bathroom break)

This screenshot of exactly what’s on the stream was almost like the ideal solution, but I see it’s not officially supported.

GetSourceScreenshot with the source of a scene (the active scene) as a scene is a source.

So sourceName is the scene in question likely with a call to GetSourceScreenshot first

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.