diff --git a/mmcv/utils/misc.py b/mmcv/utils/misc.py index 7957ea89b7..1313c74197 100644 --- a/mmcv/utils/misc.py +++ b/mmcv/utils/misc.py @@ -8,6 +8,7 @@ from importlib import import_module from inspect import getfullargspec from itertools import repeat +import platform # From PyTorch internals @@ -251,10 +252,16 @@ def _check_py_package(package): def _check_executable(cmd): - if subprocess.call(f'which {cmd}', shell=True) != 0: - return False - else: - return True + if platform.system() == 'Linux': + if subprocess.call(f'which {cmd}', shell=True) != 0: + return False + else: + return True + if platform.system() == 'Windows': + if subprocess.call(f'where {cmd}', shell=True) != 0: + return False + else: + return True def requires_package(prerequisites): diff --git a/mmcv/video/processing.py b/mmcv/video/processing.py index 90e2a4c022..88d0b0e34e 100644 --- a/mmcv/video/processing.py +++ b/mmcv/video/processing.py @@ -45,8 +45,8 @@ def convert_video(in_file: str, options.append(f'-loglevel {v}') else: options.append(f'-{k} {v}') - cmd = f'ffmpeg -y {pre_options} -i {in_file} {" ".join(options)} ' \ - f'{out_file}' + cmd = f'ffmpeg -y {pre_options} -i "{in_file}" {" ".join(options)} ' \ + f'"{out_file}"' if print_cmd: print(cmd) subprocess.call(cmd, shell=True)