{"action":"created","issue":{"url":"https://api.github.com/repos/waveform80/pistreaming/issues/26","repository_url":"https://api.github.com/repos/waveform80/pistreaming","labels_url":"https://api.github.com/repos/waveform80/pistreaming/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/waveform80/pistreaming/issues/26/comments","events_url":"https://api.github.com/repos/waveform80/pistreaming/issues/26/events","html_url":"https://github.com/waveform80/pistreaming/issues/26","id":251388733,"number":26,"title":"python websocket code to grab stream","user":{"login":"crosofg","id":7271799,"avatar_url":"https://avatars1.githubusercontent.com/u/7271799?v=4","gravatar_id":"","url":"https://api.github.com/users/crosofg","html_url":"https://github.com/crosofg","followers_url":"https://api.github.com/users/crosofg/followers","following_url":"https://api.github.com/users/crosofg/following{/other_user}","gists_url":"https://api.github.com/users/crosofg/gists{/gist_id}","starred_url":"https://api.github.com/users/crosofg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crosofg/subscriptions","organizations_url":"https://api.github.com/users/crosofg/orgs","repos_url":"https://api.github.com/users/crosofg/repos","events_url":"https://api.github.com/users/crosofg/events{/privacy}","received_events_url":"https://api.github.com/users/crosofg/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-08-19T00:49:17Z","updated_at":"2018-03-01T12:49:09Z","closed_at":"2018-03-01T12:49:09Z","author_association":"NONE","body":"I need to grab the video stream from the url to process the video. What should be the accompanying code to retrieve the image from the websocket? I am trying something like this. But it is not workigng\r\n```\r\nfrom PIL import Image\r\nimport websocket\r\nimport cStringIO\r\nimport base64\r\nimport cv2\r\n\r\nclass WSClient():\r\n    def __init__(self):\r\n        websocket.enableTrace(False)\r\n        self.ws = websocket.WebSocketApp(\"ws://192.168.0.105:8084\",\r\n                                         on_message=self.on_message,\r\n                                         on_error=self.on_error,\r\n                                         on_close=self.on_close)\r\n        self.ws.on_open = self.on_open\r\n        self.ws.run_forever()\r\n\r\n    def on_message(self, ws, message):\r\n        print \"here\"\r\n        # image_string = cStringIO.StringIO(base64.b64decode(message))\r\n        image = Image.open(message)\r\n        image.show()\r\n        cv2.imshow(\"asd\",image)\r\n        # print 'a'+image_string\r\n\r\n    def on_error(self, ws, error):\r\n        print error\r\n\r\n    def on_close(self, ws):\r\n        print \"connection closed\"\r\n\r\n    def on_open(self, ws):\r\n        print \"connected\"\r\n\r\n\r\nif __name__ == \"__main__\":\r\n    client = WSClient()\r\n```"},"comment":{"url":"https://api.github.com/repos/waveform80/pistreaming/issues/comments/369581409","html_url":"https://github.com/waveform80/pistreaming/issues/26#issuecomment-369581409","issue_url":"https://api.github.com/repos/waveform80/pistreaming/issues/26","id":369581409,"user":{"login":"waveform80","id":1076190,"avatar_url":"https://avatars1.githubusercontent.com/u/1076190?v=4","gravatar_id":"","url":"https://api.github.com/users/waveform80","html_url":"https://github.com/waveform80","followers_url":"https://api.github.com/users/waveform80/followers","following_url":"https://api.github.com/users/waveform80/following{/other_user}","gists_url":"https://api.github.com/users/waveform80/gists{/gist_id}","starred_url":"https://api.github.com/users/waveform80/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waveform80/subscriptions","organizations_url":"https://api.github.com/users/waveform80/orgs","repos_url":"https://api.github.com/users/waveform80/repos","events_url":"https://api.github.com/users/waveform80/events{/privacy}","received_events_url":"https://api.github.com/users/waveform80/received_events","type":"User","site_admin":false},"created_at":"2018-03-01T12:49:09Z","updated_at":"2018-03-01T12:49:09Z","author_association":"OWNER","body":"Closing as answered - do feel free to re-open if you need more detail!"}}
{"actor":{"display_login":"waveform80"}}