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()
|
||||
|
||||
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>'
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class _FFmpegProcess:
|
|||
return subprocess.Popen(
|
||||
args, stdin=subprocess.PIPE, bufsize=bufsize, **kwargs
|
||||
)
|
||||
except FileNotFoundError as e:
|
||||
except FileNotFoundError:
|
||||
raise MissingFFmpegError()
|
||||
|
||||
def _generate_args(self) -> List[str]:
|
||||
|
|
@ -261,7 +261,10 @@ class FFplayOutput(PipeOutput):
|
|||
p1 = ffmpeg.popen(["-"], self.bufsize, stdout=subprocess.PIPE)
|
||||
|
||||
ffplay = shlex.split("ffplay -autoexit -") + FFMPEG_QUIET
|
||||
p2 = subprocess.Popen(ffplay, stdin=p1.stdout)
|
||||
try:
|
||||
p2 = subprocess.Popen(ffplay, stdin=p1.stdout)
|
||||
except FileNotFoundError:
|
||||
raise MissingFFmpegError()
|
||||
|
||||
p1.stdout.close()
|
||||
# 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()
|
||||
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:
|
||||
message += f"Download ffmpeg from {ffmpeg_url}."
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue