Skip to content

Commit 987e026

Browse files
committed
(tweak) Update README, fix misc_utils.py
1 parent e8e5662 commit 987e026

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

BabbleApp/utils/misc_utils.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66
import platform
77
import cv2
88
import subprocess
9-
from pygrabber.dshow_graph import FilterGraph
10-
11-
is_nt = True if sys.platform.startswith('win') else False
12-
graph = FilterGraph()
139

10+
# Detect the operating system
11+
is_nt = os.name == "nt"
12+
os_type = platform.system()
1413

14+
if is_nt:
15+
from pygrabber.dshow_graph import FilterGraph
16+
graph = FilterGraph()
17+
18+
1519
def list_camera_names():
1620
cam_list = graph.get_input_devices()
1721
cam_names = []
@@ -20,14 +24,6 @@ def list_camera_names():
2024
cam_names = cam_names + list_serial_ports()
2125
return cam_names
2226

23-
# Detect the operating system
24-
is_nt = True if os.name == "nt" else False
25-
os_type = platform.system()
26-
27-
if is_nt:
28-
from pygrabber.dshow_graph import FilterGraph
29-
graph = FilterGraph()
30-
3127

3228
def list_cameras_opencv():
3329
""" Use OpenCV to check available cameras by index (fallback for Linux/macOS) """

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
![Babble Logo](https://github.com/SummerSigh/ProjectBabble/blob/SummerSigh-patch-4/Babble.png?raw=true)
32

43
<h3 align="center">
@@ -32,8 +31,15 @@ Once it's finished installing, you can update and run the Babble app by typing `
3231

3332
*You should also be able to run the Windows executable through Wine!*
3433

35-
#### Note:
36-
If you recieve a `ModuleNotFoundError: No module named 'tkinter'` error message on run, you'll need to install `tkinter` for your distro.
34+
#### Notes:
35+
If you receive a `["Error listing UVC devices on Linux ... No such file or directory"]` when choosing/changing your camera, you'll need to install video4linux (`v4l-utils`) for your distro.
36+
37+
For Ubuntu or other distros with apt:
38+
```bash
39+
sudo apt-get install v4l-utils
40+
```
41+
42+
If you receive a `ModuleNotFoundError: No module named 'tkinter'` error message on run, you'll need to install `tkinter` for your distro.
3743

3844
For Ubuntu or other distros with apt:
3945
```bash

0 commit comments

Comments
 (0)