[英]python video b'\x1aE\xdf\xa3\x01\x00\x00\x00\x00\x00\x00\
i receive from websockets this video stream b'\x1aE\xdf\xa3\x01\x00\x00\x00\x00\x00\x00.... i save the strea to file我从 websockets 收到这个视频 stream b'\x1aE\xdf\xa3\x01\x00\x00\x00\x00\x00\x00.... 我将 strea 保存到文件
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....来自_web.mp4 的文件包含 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我尝试打开 from_web.mp4 cap = cv2.VideoCapture("da_email.mp4") 但出现错误
[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()我已经解决了,这部分代码 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") cap = cv2.VideoCapture("da_email.mp4")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.