in mapillary_tools/ffmpeg.py [0:0]
def run_ffprobe_json(cmd: T.List[str]) -> T.Dict:
full_cmd = [MAPILLARY_FFPROBE_PATH, "-print_format", "json", *cmd]
LOG.info(f"Extracting video information: {' '.join(full_cmd)}")
try:
output = subprocess.check_output(full_cmd)
except FileNotFoundError:
raise exceptions.MapillaryFFmpegNotFoundError(
f'The ffprobe command "{MAPILLARY_FFPROBE_PATH}" not found. Make sure it is installed in your $PATH or it is available in $MAPILLARY_FFPROBE_PATH. See https://github.com/mapillary/mapillary_tools#video-support for instructions'
)
try:
return json.loads(output)
except json.JSONDecodeError:
raise RuntimeError(
f"Error JSON decoding ffprobe output: {output.decode('utf-8')}"
)