9 Antworten
+ 1
cv2.putText(frame,text,location,font,font size,font color, font weight, line)
0
Jason Edelson and how can I save it?
0
cv2.VideoWriter(filename, fourcc, fps, frameSize)
Example-
out = cv2.VideoWriter('output.avi', -1, 20.0, (1920,1080))
out.write(frame)
make sure you write the frame after editing it not before
remember to release after your done writing
out.release()
0
Jason Edelson thanks a lot😉
my last question is why my output video has no sound?
how can I solve it?
0
opencv doesn't support audio,
you'll have to use a separate library like ffpyplayer
from ffpyplayer.player import MediaPlayer
player= MediaPlayer(video path)
audioframe, val = player.get_frame()
0
Jason Edelson Do you know any library wich support video and audio and put text on that?
0
Not that I know of, if you find one let me know
0
Jason Edelson ok
yYou helped me a lot😉
Thanks😉☺
0
Jason Edelson I find a way.
converting text to image using PIL then put it on video using moviepy.
it is too slow😔
Do you have an idea for speed up?