To do this I obviously need access to the video stream from the Sumo. The video UDP packets are the same format as the rest of the response data, but for some reason I was not receiving them using Python's UDPServer.
After much flailing around on Google I fired up Wireshark and discovered those packets were being sent still, so it was definitely a problem with my UDP server. Digging deeper (thanks, stack overflow) I discovered that the maximum packet size in UDPServer was hard-coded to less than the size of the video packets.
The size of the video packets sent by the Sumo is established in the reply during the initialisation handshake to TCP port 44444, in the 'arstream_fragment_size' field (65000 in this instance):
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"status": 0, | |
"c2d_port": 54321, | |
"arstream_fragment_size": 65000, | |
"arstream_fragment_maximum_number": 4, | |
"arstream_max_ack_interval": -1, | |
"c2d_update_port": 51, | |
"c2d_user_port": 21 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SocketServer | |
if __name__ == '__main__': | |
server = SocketServer.UDPServer((HOST, PORT), UDPHandler) | |
server.max_packet_size = 65000 |