0
私は数日前にプログラミングを始めましたが、私はこの問題を抱えています:AttributeError: 'NoneType' object has no attribute 'tostring'
。私は何が間違っているのか分からない。AttributeError: 'NoneType'オブジェクトに 'tostring'属性がありません
#Reads through each frame, calculates the timestamp, places it on the frame and
#exports the frame to the output video.
while current_frame < total_frames:
success, image = video.read()
elapsed_time = video.get(cv2.CAP_PROP_POS_MSEC)
current_frame = video.get(cv2.CAP_PROP_POS_FRAMES)
timestamp = initial + dt.timedelta(microseconds = elapsed_time*1000)
cv2.putText(image, 'Date: ' + str(timestamp)[0:10], (50,int(height-150)), cv2.FONT_HERSHEY_COMPLEX_SMALL, 2, (255, 255, 255), 3)
cv2.putText(image, 'Time: ' + str(timestamp)[11:-4], (50,int(height-100)), cv2.FONT_HERSHEY_COMPLEX_SMALL, 2, (255, 255, 255), 3)
pipe.stdin.write(image.tostring())
これはコメントのように見えますが、質問に対する回答ではありません。 – LethalProgrammer