From 0e335ad554d74018bdcc8e1187f31ab62ba0c935 Mon Sep 17 00:00:00 2001 From: hzwer <598460606@163.com> Date: Wed, 18 Nov 2020 11:28:14 +0800 Subject: [PATCH] Fix round fps --- inference_video.py | 2 +- inference_video_parallel.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inference_video.py b/inference_video.py index 7cd55cc..ad2f21a 100644 --- a/inference_video.py +++ b/inference_video.py @@ -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): diff --git a/inference_video_parallel.py b/inference_video_parallel.py index 45d4036..6af2a64 100644 --- a/inference_video_parallel.py +++ b/inference_video_parallel.py @@ -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