fix ffprobe on device (#30286)

* fix ffprobe on device

* use FileReader

* no more requests
old-commit-hash: 59e947dc6c
testing-closet
Greg Hogan 2 years ago committed by GitHub
parent 414d4cd8d0
commit 99d094a006
  1. 10
      tools/lib/framereader.py

@ -61,16 +61,14 @@ def fingerprint_video(fn):
def ffprobe(fn, fmt=None):
fn = resolve_name(fn)
cmd = ["ffprobe",
"-v", "quiet",
"-print_format", "json",
"-show_format", "-show_streams"]
cmd = ["ffprobe", "-v", "quiet", "-print_format", "json", "-show_format", "-show_streams"]
if fmt:
cmd += ["-f", fmt]
cmd += [fn]
cmd += ["-i", "-"]
try:
ffprobe_output = subprocess.check_output(cmd)
with FileReader(fn) as f:
ffprobe_output = subprocess.check_output(cmd, input=f.read(4096))
except subprocess.CalledProcessError as e:
raise DataUnreadableError(fn) from e

Loading…
Cancel
Save