kopia lustrzana https://github.com/corrscope/corrscope
Show error message if ffplay missing (not just ffmpeg) (#168)
rodzic
2318a33560
commit
7ed59496eb
|
|
@ -984,7 +984,7 @@ class DownloadFFmpegActivity:
|
||||||
path_uri = qc.QUrl.fromLocalFile(paths.PATH_dir).toString()
|
path_uri = qc.QUrl.fromLocalFile(paths.PATH_dir).toString()
|
||||||
|
|
||||||
required = (
|
required = (
|
||||||
f"FFmpeg must be in PATH or "
|
f"FFmpeg+FFplay must be in PATH or "
|
||||||
f'<a href="{path_uri}">corrscope folder</a> in order to use corrscope.<br>'
|
f'<a href="{path_uri}">corrscope folder</a> in order to use corrscope.<br>'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ class _FFmpegProcess:
|
||||||
return subprocess.Popen(
|
return subprocess.Popen(
|
||||||
args, stdin=subprocess.PIPE, bufsize=bufsize, **kwargs
|
args, stdin=subprocess.PIPE, bufsize=bufsize, **kwargs
|
||||||
)
|
)
|
||||||
except FileNotFoundError as e:
|
except FileNotFoundError:
|
||||||
raise MissingFFmpegError()
|
raise MissingFFmpegError()
|
||||||
|
|
||||||
def _generate_args(self) -> List[str]:
|
def _generate_args(self) -> List[str]:
|
||||||
|
|
@ -261,7 +261,10 @@ class FFplayOutput(PipeOutput):
|
||||||
p1 = ffmpeg.popen(["-"], self.bufsize, stdout=subprocess.PIPE)
|
p1 = ffmpeg.popen(["-"], self.bufsize, stdout=subprocess.PIPE)
|
||||||
|
|
||||||
ffplay = shlex.split("ffplay -autoexit -") + FFMPEG_QUIET
|
ffplay = shlex.split("ffplay -autoexit -") + FFMPEG_QUIET
|
||||||
|
try:
|
||||||
p2 = subprocess.Popen(ffplay, stdin=p1.stdout)
|
p2 = subprocess.Popen(ffplay, stdin=p1.stdout)
|
||||||
|
except FileNotFoundError:
|
||||||
|
raise MissingFFmpegError()
|
||||||
|
|
||||||
p1.stdout.close()
|
p1.stdout.close()
|
||||||
# assert p2.stdin is None # True unless Popen is being mocked (test_output).
|
# assert p2.stdin is None # True unless Popen is being mocked (test_output).
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,9 @@ class MissingFFmpegError(CorrError):
|
||||||
ffmpeg_url = get_ffmpeg_url()
|
ffmpeg_url = get_ffmpeg_url()
|
||||||
can_download = bool(ffmpeg_url)
|
can_download = bool(ffmpeg_url)
|
||||||
|
|
||||||
message = f'FFmpeg must be in PATH or "{PATH_dir}" in order to use corrscope.\n'
|
message = (
|
||||||
|
f'FFmpeg+FFplay must be in PATH or "{PATH_dir}" in order to use corrscope.\n'
|
||||||
|
)
|
||||||
|
|
||||||
if can_download:
|
if can_download:
|
||||||
message += f"Download ffmpeg from {ffmpeg_url}."
|
message += f"Download ffmpeg from {ffmpeg_url}."
|
||||||
|
|
|
||||||
Ładowanie…
Reference in New Issue