nazaruka / gym-http-api

NSGA2-based Sonic agent + experimental code
MIT License
1 stars 1 forks source link

Compress Sonic's Video Stream #19

Open schrum2 opened 5 years ago

schrum2 commented 5 years ago

I have the seed of an unusual idea, but before we can do it we need a way to take the stream of video output by the Sonic game during play and compress it using some standard video compression method. I'm sure there are some open-source codecs out there we can use. The tricky thing here is that I want to take the video stream and compress it, then measure the size of the compressed representation, all without bothering to save any files to disk.

This is another issue to potentially explore.

schrum2 commented 5 years ago

Here are some ideas to work with. We want the frame to basically be the game observation. However, the trick will be in determining the size of the stream. I think the best way to test it is to compress while plying the game as a human ... staying still should be highly compressible (low file size), but moving around should be larger.

Here are some links: https://github.com/jeremyfix/udp_video_streaming/blob/master/udp_socket/video_grabber.py https://github.com/yushuhuang/webcam/blob/master/send.py https://github.com/Razbotics/PythonUDPstreamer-tool/blob/master/sender_server.py https://github.com/divyenduz/python-generator-video-stream/blob/master/camera.py

That's all raw code though. This tutorial might be more helpful: http://www.chioka.in/python-live-video-streaming-example/