Fix round fps

This commit is contained in:
hzwer
2020-11-18 11:28:14 +08:00
parent 308c047f2f
commit 0e335ad554
2 changed files with 2 additions and 2 deletions

View File

@@ -42,7 +42,7 @@ if args.png:
os.mkdir('output')
else:
video_path_wo_ext, ext = os.path.splitext(args.video)
output = cv2.VideoWriter('{}_{}X_{}fps.{}'.format(video_path_wo_ext, args.times, args.fps, args.ext), fourcc, args.fps, (w, h))
output = cv2.VideoWriter('{}_{}X_{}fps.{}'.format(video_path_wo_ext, args.times, int(np.round(args.fps)), args.ext), fourcc, args.fps, (w, h))
cnt = 0
def writeframe(frame):

View File

@@ -41,7 +41,7 @@ if args.png:
os.mkdir('output')
else:
video_path_wo_ext, ext = os.path.splitext(args.video)
output = cv2.VideoWriter('{}_{}X_{}fps.{}'.format(video_path_wo_ext, args.times, args.fps, args.ext), fourcc, args.fps, (w, h))
output = cv2.VideoWriter('{}_{}X_{}fps.{}'.format(video_path_wo_ext, args.times, int(np.round(args.fps)), args.ext), fourcc, args.fps, (w, h))
cnt = 0
skip_frame = 1