We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
objective write text to video, e.g. using cv2.putText
code
from imageio_ffmpeg import read_frames, write_frames import cv2 input_file = 'http://195.196.36.242/mjpg/video.mjpg' output_file = 'rtsp.mp4' reader = read_frames(input_file) meta = reader.__next__() writer = write_frames(output_file, size = meta['size'], fps = meta['fps'], input_params = ['-y', ], output_params = ['-vf', 'scale = 720 : -2', ] ) writer.send(None) i = 0 text = 'stifix' font = cv2.FONT_HERSHEY_SIMPLEX org = (00, 185) fontScale = 1 color = (0, 0, 128) thickness = 2 for frame in reader: img = np.frombuffer(frame, np.uint8).reshape(meta['size'][1], meta['size'][0], -1) #put_text = cv2.putText(img, text, org, font, fontScale, color, thickness, cv2.LINE_AA, False) # not work put_text = np.ascontiguousarray(cv2.putText(img, text, org, font, fontScale, color, thickness, cv2.LINE_AA, False) ) # not work writer.send(put_text) if i == 9: # 100 = 6 secs break i += 1 writer.close()
result no error occured but output video have no text written
expected result video output have text written
best regards
The text was updated successfully, but these errors were encountered:
I'd write the frames to image files using imageio and see if the text is visible there. If not, it's likely related to the putText cal.
putText
Sorry, something went wrong.
No branches or pull requests
objective
write text to video, e.g. using cv2.putText
code
result
no error occured
but output video have no text written
expected result
video output have text written
best regards
The text was updated successfully, but these errors were encountered: