Check for ffmpeg
(cls)
| 94 | |
| 95 | @classmethod |
| 96 | def find(cls): |
| 97 | """ |
| 98 | Check for ffmpeg |
| 99 | """ |
| 100 | if cls.CMD is not None: |
| 101 | return True |
| 102 | |
| 103 | try: |
| 104 | if os.name == "nt": |
| 105 | ffmpeg = os.path.join(pypath, "ffmpeg.exe") if isexecutable(os.path.join(pypath, "ffmpeg.exe")) \ |
| 106 | else "ffmpeg.exe" |
| 107 | |
| 108 | else: |
| 109 | ffmpeg = "ffmpeg" |
| 110 | |
| 111 | cmd = which(ffmpeg) or ffmpeg |
| 112 | |
| 113 | p = Popen([cmd, "-version"], |
| 114 | stdout=subprocess.PIPE, |
| 115 | stderr=subprocess.PIPE) |
| 116 | out, err = (_r.strip() if _r else "" for _r in p.communicate()) |
| 117 | except OSError: |
| 118 | return False |
| 119 | |
| 120 | m = cls._RE_VERSION.search(out) |
| 121 | if m is not None: |
| 122 | cls.VERSION = m.group(1) |
| 123 | |
| 124 | cls.CMD = cmd |
| 125 | |
| 126 | return True |
| 127 | |
| 128 | @property |
| 129 | def found(self): |
no test coverage detected