Fix build issues on macos
This commit is contained in:
52
chroma-previewer.spec
Normal file
52
chroma-previewer.spec
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# -*- mode: python ; coding: utf-8 -*-
|
||||||
|
import sys
|
||||||
|
from PyInstaller.utils.hooks import collect_submodules
|
||||||
|
|
||||||
|
# Project name and entry script
|
||||||
|
app_name = "ChromaPreviewer"
|
||||||
|
entry_script = "main.py"
|
||||||
|
|
||||||
|
# Gather hidden imports for PyQt6 and OpenCV
|
||||||
|
hidden_imports = collect_submodules("cv2") + collect_submodules("PyQt6")
|
||||||
|
|
||||||
|
a = Analysis(
|
||||||
|
[entry_script],
|
||||||
|
pathex=["."], # Current directory
|
||||||
|
binaries=[],
|
||||||
|
datas=[],
|
||||||
|
hiddenimports=hidden_imports,
|
||||||
|
hookspath=[],
|
||||||
|
runtime_hooks=[],
|
||||||
|
excludes=[],
|
||||||
|
win_no_prefer_redirects=False,
|
||||||
|
win_private_assemblies=False,
|
||||||
|
cipher=None,
|
||||||
|
noarchive=False,
|
||||||
|
)
|
||||||
|
|
||||||
|
pyz = PYZ(a.pure, a.zipped_data, cipher=None)
|
||||||
|
|
||||||
|
exe = EXE(
|
||||||
|
pyz,
|
||||||
|
a.scripts,
|
||||||
|
a.binaries,
|
||||||
|
a.zipfiles,
|
||||||
|
a.datas,
|
||||||
|
[],
|
||||||
|
name=app_name,
|
||||||
|
debug=False,
|
||||||
|
bootloader_ignore_signals=False,
|
||||||
|
strip=False,
|
||||||
|
upx=True,
|
||||||
|
console=False
|
||||||
|
)
|
||||||
|
|
||||||
|
app = BUNDLE(
|
||||||
|
exe,
|
||||||
|
name=app_name + ".app",
|
||||||
|
bundle_identifier="com.1060studios.chromapreviewer",
|
||||||
|
info_plist={
|
||||||
|
"NSCameraUsageDescription": "This app requires access to the camera for live chroma keying."
|
||||||
|
},
|
||||||
|
entitlements="entitlements.plist"
|
||||||
|
)
|
||||||
8
entitlements.plist
Normal file
8
entitlements.plist
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>com.apple.security.device.camera</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
3
main.py
3
main.py
@@ -93,9 +93,12 @@ class ChromaPreviewer(QWidget):
|
|||||||
], dtype=np.uint8)
|
], dtype=np.uint8)
|
||||||
|
|
||||||
def update_frame(self):
|
def update_frame(self):
|
||||||
|
try:
|
||||||
ret, frame = self.cap.read()
|
ret, frame = self.cap.read()
|
||||||
if not ret:
|
if not ret:
|
||||||
return
|
return
|
||||||
|
except AttributeError:
|
||||||
|
return
|
||||||
|
|
||||||
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
||||||
self.current_frame = frame.copy()
|
self.current_frame = frame.copy()
|
||||||
|
|||||||
Reference in New Issue
Block a user