i receive from websockets this video stream b'\x1aE\xdf\xa3\x01\x00\x00\x00\x00\x00\x00.... i save the strea to file
Blockquote
frame = await websocket.recv()
dataImg64 = str(frame)
with open("from_web.mp4", "wb") as f:
f.write(stream)
f.flush()
Blockquote
the file from_web.mp4 contains b'\x1aE\xdf\xa3\x01\x00\x00\x00\x00\x00\x00....
i try to open the from_web.mp4 cap = cv2.VideoCapture("da_email.mp4") but i have the error
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x27cd9e0] moov atom not found
VIDIOC_REQBUFS: Inappropriate ioctl for device
any suggestions? Peter
i re-write the part of code
frame = await websocket.recv()
stream= str(frame)##i made a cast to string, is right?
with open("from_web.mp4", "wb") as f:
f.write(stream)
f.flush()
cap = cv2.VideoCapture("da_email.mp4")
i have resolve, with this part of code frame = await websocket.recv()
with open("from_web.mp4", "wb") as f:
f.write(frame[0:len(frame)])
f.flush()
cap = cv2.VideoCapture("da_email.mp4")
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.