From 259cb5dd32b77bb6da663e0a688901503089eb56 Mon Sep 17 00:00:00 2001 From: Feng Ni Date: Mon, 30 Aug 2021 14:05:13 +0800 Subject: [PATCH] [cherry-pick]fix ffmpeg (#4079) --- deploy/python/mot_jde_infer.py | 2 +- deploy/python/mot_keypoint_unite_infer.py | 2 +- deploy/python/mot_sde_infer.py | 2 +- ppdet/engine/tracker.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deploy/python/mot_jde_infer.py b/deploy/python/mot_jde_infer.py index 8e37d1b7a..de73ca077 100644 --- a/deploy/python/mot_jde_infer.py +++ b/deploy/python/mot_jde_infer.py @@ -267,7 +267,7 @@ def predict_video(detector, camera_id): if FLAGS.save_images: save_dir = os.path.join(FLAGS.output_dir, video_name.split('.')[-2]) - cmd_str = 'ffmpeg -f image2 -i {}/%05d.jpg -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" {}'.format( + cmd_str = 'ffmpeg -f image2 -i {}/%05d.jpg {}'.format( save_dir, out_path) os.system(cmd_str) print('Save video in {}.'.format(out_path)) diff --git a/deploy/python/mot_keypoint_unite_infer.py b/deploy/python/mot_keypoint_unite_infer.py index 706b61127..6969cb31e 100644 --- a/deploy/python/mot_keypoint_unite_infer.py +++ b/deploy/python/mot_keypoint_unite_infer.py @@ -216,7 +216,7 @@ def mot_keypoint_unite_predict_video(mot_model, if FLAGS.save_images: save_dir = os.path.join(FLAGS.output_dir, video_name.split('.')[-2]) - cmd_str = 'ffmpeg -f image2 -i {}/%05d.jpg -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" {}'.format( + cmd_str = 'ffmpeg -f image2 -i {}/%05d.jpg {}'.format( save_dir, out_path) os.system(cmd_str) print('Save video in {}.'.format(out_path)) diff --git a/deploy/python/mot_sde_infer.py b/deploy/python/mot_sde_infer.py index 6e1a4036f..45419dc53 100644 --- a/deploy/python/mot_sde_infer.py +++ b/deploy/python/mot_sde_infer.py @@ -408,7 +408,7 @@ def predict_video(detector, reid_model, camera_id): if FLAGS.save_images: save_dir = os.path.join(FLAGS.output_dir, video_name.split('.')[-2]) - cmd_str = 'ffmpeg -f image2 -i {}/%05d.jpg -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" {}'.format( + cmd_str = 'ffmpeg -f image2 -i {}/%05d.jpg {}'.format( save_dir, out_path) os.system(cmd_str) print('Save video in {}.'.format(out_path)) diff --git a/ppdet/engine/tracker.py b/ppdet/engine/tracker.py index 15f93427b..0d4f98b68 100644 --- a/ppdet/engine/tracker.py +++ b/ppdet/engine/tracker.py @@ -331,7 +331,7 @@ class Tracker(object): if save_videos: output_video_path = os.path.join(save_dir, '..', '{}_vis.mp4'.format(seq)) - cmd_str = 'ffmpeg -f image2 -i {}/%05d.jpg -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" {}'.format( + cmd_str = 'ffmpeg -f image2 -i {}/%05d.jpg {}'.format( save_dir, output_video_path) os.system(cmd_str) logger.info('Save video in {}.'.format(output_video_path)) @@ -449,7 +449,7 @@ class Tracker(object): if save_videos: output_video_path = os.path.join(save_dir, '..', '{}_vis.mp4'.format(seq)) - cmd_str = 'ffmpeg -f image2 -i {}/%05d.jpg "scale=trunc(iw/2)*2:trunc(ih/2)*2" {}'.format( + cmd_str = 'ffmpeg -f image2 -i {}/%05d.jpg {}'.format( save_dir, output_video_path) os.system(cmd_str) logger.info('Save video in {}'.format(output_video_path)) -- GitLab