问题
So I have a stream going on in KVS.
I am trying to save it (in chunks of 1 min for example)
However, when saving the botocore.response.StreamingBody
, I am getting only 1 sec video.
Here is the code I am using:
client = boto3.client('kinesis-video-media', endpoint_url=url)
response = client.get_media(
StreamARN=MyARN,
StartSelector={
'StartSelectorType': 'EARLIEST',
})
with open('test.webm', 'w+') as f:
chunk = response['Payload'].read(1024*8)
while chunk:
f.write(chunk)
chunk = response['Payload'].read(1024*8)
How can I make it 1 minute video files?
Thank you!
来源:https://stackoverflow.com/questions/53516866/save-streamed-video-from-kinesisvideostream-using-boto3-to-a-local-file