From 78a08269a1ec6957b53a054048cccc20bdaefb91 Mon Sep 17 00:00:00 2001 From: JunHo Kim Date: Wed, 22 Dec 2021 12:09:16 +0900 Subject: [PATCH] Fix fps arg missing --- pillar_detection_core.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pillar_detection_core.py b/pillar_detection_core.py index e86430b..57650ab 100644 --- a/pillar_detection_core.py +++ b/pillar_detection_core.py @@ -224,8 +224,10 @@ def ffmpegEncoding(args, vid_index, vid_num, cropPos, vid_name, fpath, ffmpeg_pr else : sharpen_arg = '' + fps_arg = "" if fps > 0 : output_name_args.append(f"fps{fps}") + fps_arg = f"-r {fps}" elif fps == 0 : print(f"[!!! ERROR !!!] invalid option. fps = {fps}") @@ -246,13 +248,15 @@ def ffmpegEncoding(args, vid_index, vid_num, cropPos, vid_name, fpath, ffmpeg_pr info : defualt ''' loglevel = 'quiet' - ffmpeg_command = f"ffmpeg {debug_shortOutput} -i \"{fpath}\" -r 29.97 -vf \"{crop_arg}{scale_arg}{pad_arg}{sharpen_arg}\"\ + ffmpeg_command = f"ffmpeg {debug_shortOutput} -i \"{fpath}\" {fps_arg} -vf \"{crop_arg}{scale_arg}{pad_arg}{sharpen_arg}\"\ -y -pix_fmt yuv420p -c:v libx264 -crf {crf} -c:a copy -preset medium -loglevel {loglevel}\ {uhd_output_args} \"{output_path}\"" vid_duration = getVideDuration(fpath) vid_hour = vid_duration[0] vid_min = vid_duration[1] vid_sec = vid_duration[2] + + print(ffmpeg_command) # print("====================================================================") print("[INFO]\t Encoding start \"%s\" ..." % vid_name) print("[INFO]\t CRF : %d" % int(crf)) @@ -270,6 +274,8 @@ def ffmpegEncoding(args, vid_index, vid_num, cropPos, vid_name, fpath, ffmpeg_pr print("[INFO]\t Output Resolution : %dx%d" %(output_width, output_height)) if add_sharpening : print("[INFO]\t Sharpening arg : %s" %sharpen_arg[1:]) + if fps > 0 : + print("[INFO]\t Frame Rate : %.2f" %fps) print("[INFO]\t Output File Name : %s" %output_file_name) print("====================================================================")