https://stackoverflow.com/questions/3844430/how-to-get-the-duration-of-a-video-in-python
(self, filename)
| 134 | return True |
| 135 | |
| 136 | def get_length(self, filename): |
| 137 | """ |
| 138 | https://stackoverflow.com/questions/3844430/how-to-get-the-duration-of-a-video-in-python |
| 139 | |
| 140 | """ |
| 141 | try: |
| 142 | duration_in_seconds = subprocess.run([ |
| 143 | "ffprobe", "-v", "error", "-show_entries", |
| 144 | "format=duration", "-of", |
| 145 | "default=noprint_wrappers=1:nokey=1", |
| 146 | filename], |
| 147 | stdout = subprocess.PIPE, |
| 148 | stderr = subprocess.STDOUT) |
| 149 | |
| 150 | # print("get_length", float(duration_in_seconds.stdout)) |
| 151 | |
| 152 | return float(duration_in_seconds.stdout) |
| 153 | |
| 154 | except Exception as exception: |
| 155 | print("get_length exception ", exception) |
| 156 | return None |
| 157 | |
| 158 | def split(self, i: int): |
| 159 | """ |