S
S
shuzzixd2021-12-05 17:16:31
Python
shuzzixd, 2021-12-05 17:16:31

How to make it so that when saving a new frame, the _ character is added to the file?

I don't know how to explain well, but I hope you get it. I have a program. She divides the video into frames. I need to add _ to the title every time a frame is taken. Something like this:
1st frame - kadr_
2nd frame - kadr__
3rd frame - kadr___
And so on.

Code:

issue resolved

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kokapuk, 2021-12-05
@shuzzixd

fileName = 'kadr'
frameNumber = 23
fileName += "_"*frameNumber

print(fileName)

cadr_____________________
cv2.imwrite(f"frames/{s}/kadr%.png" % ("_"*i), frame)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question