Fix Windows non-UTF source filenames (#4524)
Co-authored-by: Kayzwer <68285002+Kayzwer@users.noreply.github.com>
This commit is contained in:
parent
a7419617a6
commit
1db9afc2e5
16 changed files with 129 additions and 95 deletions
|
|
@ -343,8 +343,7 @@ class BasePredictor:
|
|||
h = int(vid_cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
|
||||
else: # stream
|
||||
fps, w, h = 30, im0.shape[1], im0.shape[0]
|
||||
suffix = '.mp4' if MACOS else '.avi' if WINDOWS else '.avi'
|
||||
fourcc = 'avc1' if MACOS else 'WMV2' if WINDOWS else 'MJPG'
|
||||
suffix, fourcc = ('.mp4', 'avc1') if MACOS else ('.avi', 'WMV2') if WINDOWS else ('.avi', 'MJPG')
|
||||
save_path = str(Path(save_path).with_suffix(suffix))
|
||||
self.vid_writer[idx] = cv2.VideoWriter(save_path, cv2.VideoWriter_fourcc(*fourcc), fps, (w, h))
|
||||
self.vid_writer[idx].write(im0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue