如何在浏览器上流式窗口
我有一款正在训练神经网络的游戏游戏。我想在Web应用程序上显示此过程,而无需用户 /客户端与游戏之间的任何互动。是否可以检索Pygame视频数据并将其流式传输到HTML帆布或类似的东西?
- 目前正在使用烧瓶作为后端来服务HTML页面
I have a pygame game that is training a Neural Network. I would like to show this process on a web app without any interaction between the user / client and the game. Is it possible to retrieve the pygame video data and stream it to a html canvas or something similar?
- am currently using flask as a back-end to serve the html pages
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一般而言,您可以在
窗口
对象中使用pygame.image.image.save
。然后,您可以将图像流传输到各种端以创建或流视频。该视频可以在网页中显示出延迟。当然,您的过程也会比平时慢得多。
Generally speaking you can use
pygame.image.save
on yourwindow
object inside the loop.Then you can stream the images to various ends to create or stream video. That video can be shown in a web page with a delay. Also your process will be much slower than usual, of course.