As a byte stream to convert in real time?

There is a camera Sony Action Camera HDR-AZ1.
It has API, support for which was stopped in September 2018.
When you run Live mode, when you request to URL: 192.168.122.1:8080/liveview/liveviewstream GET request get constantly socialwise file.
response = requests.post('http://192.168.122.1:8080/sony/camera' json={"method": "startLiveview","params": [],"id": 1,"version": "1.0" })
print(response.content)
with requests.get('http://192.168.122.1:8080/liveview/liveviewstream', stream=True) as r:
print(r.content)
response = requests.post('http://192.168.122.1:8080/sony/camera' json={"method": "setShootMode","params": ["movie"],"id": 1,"version": "1.0"})
print(response.content)
response = requests.post('http://192.168.122.1:8080/sony/camera' json={"method": "stopLiveview","params": [],"id": 1,"version": "1.0" })
print(response.content)

Question: I receive bytes from this site, they dekodery, get the image in JPEG format, glue them in a row, get a video, but I can't start decoding until the stop mode.
Picture this - get bytes in a binary file, decoder make a video.
Need to decode in real time.
March 19th 20 at 09:27
2 answers
March 19th 20 at 09:29
Solution
data = {"method": "startLiveview","params": [],"id": 1,"version": "1.0" }
with requests.post('http://192.168.122.1:8080/sony/camera', json=data, stream=True) as r:
 for chunk in r.iter_content(chunk_size=8192):
 # Do something with the piece 8KB
March 19th 20 at 09:31
two threads and the queue.
One stream connects to the camera, pumping information, puts it in a queue. The second stream takes data from the queue and does with them what he will say.

Find more questions by tags Python