未验证 提交 259cb5dd 编写于 作者: F Feng Ni 提交者: GitHub

[cherry-pick]fix ffmpeg (#4079)

上级 43626835
...@@ -267,7 +267,7 @@ def predict_video(detector, camera_id): ...@@ -267,7 +267,7 @@ def predict_video(detector, camera_id):
if FLAGS.save_images: if FLAGS.save_images:
save_dir = os.path.join(FLAGS.output_dir, video_name.split('.')[-2]) 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) save_dir, out_path)
os.system(cmd_str) os.system(cmd_str)
print('Save video in {}.'.format(out_path)) print('Save video in {}.'.format(out_path))
......
...@@ -216,7 +216,7 @@ def mot_keypoint_unite_predict_video(mot_model, ...@@ -216,7 +216,7 @@ def mot_keypoint_unite_predict_video(mot_model,
if FLAGS.save_images: if FLAGS.save_images:
save_dir = os.path.join(FLAGS.output_dir, video_name.split('.')[-2]) 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) save_dir, out_path)
os.system(cmd_str) os.system(cmd_str)
print('Save video in {}.'.format(out_path)) print('Save video in {}.'.format(out_path))
......
...@@ -408,7 +408,7 @@ def predict_video(detector, reid_model, camera_id): ...@@ -408,7 +408,7 @@ def predict_video(detector, reid_model, camera_id):
if FLAGS.save_images: if FLAGS.save_images:
save_dir = os.path.join(FLAGS.output_dir, video_name.split('.')[-2]) 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) save_dir, out_path)
os.system(cmd_str) os.system(cmd_str)
print('Save video in {}.'.format(out_path)) print('Save video in {}.'.format(out_path))
......
...@@ -331,7 +331,7 @@ class Tracker(object): ...@@ -331,7 +331,7 @@ class Tracker(object):
if save_videos: if save_videos:
output_video_path = os.path.join(save_dir, '..', output_video_path = os.path.join(save_dir, '..',
'{}_vis.mp4'.format(seq)) '{}_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) save_dir, output_video_path)
os.system(cmd_str) os.system(cmd_str)
logger.info('Save video in {}.'.format(output_video_path)) logger.info('Save video in {}.'.format(output_video_path))
...@@ -449,7 +449,7 @@ class Tracker(object): ...@@ -449,7 +449,7 @@ class Tracker(object):
if save_videos: if save_videos:
output_video_path = os.path.join(save_dir, '..', output_video_path = os.path.join(save_dir, '..',
'{}_vis.mp4'.format(seq)) '{}_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) save_dir, output_video_path)
os.system(cmd_str) os.system(cmd_str)
logger.info('Save video in {}'.format(output_video_path)) logger.info('Save video in {}'.format(output_video_path))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册