i want to read a specific frame from the byte array. i found that byte array by reading the video file in read binary mode. i know that i can read a specific frame with the help of cv2 module. but i want to read it from byte array and want to save that frame as an image.
I have tried to read it like a text file but failed to read the full frame.
f1=open('video,mp4','rb')
f2=open('image.jpg','wb')
frame_count=0
for frame in f1:
frame_count+=1
if frame_count==50:
f2.write(frame)
f2.close()
break
f1.close()
i got a byte string using that method but it did not work exactly.