Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jon/tauri nuxt UI #56

Open
wants to merge 108 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
832e90c
proof of concept FastAPI app
jonmatthis Jan 10, 2024
d840c2c
proof of concept FastAPI app
jonmatthis Jan 10, 2024
73f99ee
add dummy `camera/detect` route
jonmatthis Jan 10, 2024
2a7d8ff
customize Swagger UI
jonmatthis Jan 10, 2024
b48256d
add TODO questions
jonmatthis Jan 10, 2024
75c3ed0
refactoring - backend runs nicely
jonmatthis Jan 12, 2024
5ec4c1e
refactoring
jonmatthis Jan 12, 2024
fee22cf
detect cameras route works w router
jonmatthis Jan 12, 2024
e61d1b5
detect cameras route works via controller
jonmatthis Jan 12, 2024
c2f168f
add new route
jonmatthis Jan 12, 2024
fdd53a8
prepping AppState & Manager
jonmatthis Jan 12, 2024
57cc2d9
`black` format
jonmatthis Jan 12, 2024
3543a0a
building api client
jonmatthis Jan 12, 2024
41ac398
fix print
jonmatthis Jan 12, 2024
09d17fa
refactor incoming frame wrangler
jonmatthis Jan 12, 2024
73516c0
switch to using async.sleep instead of time.sleep
jonmatthis Jan 12, 2024
8d1bd44
optimize imports
jonmatthis Jan 12, 2024
85da9d8
setting up websocket to send frames to frontend
jonmatthis Jan 13, 2024
b20c596
getting there
jonmatthis Jan 13, 2024
e00b8bc
websocket runs, but brokenly
jonmatthis Jan 13, 2024
438970a
f a websocket
jonmatthis Jan 13, 2024
e56669e
f a websocket
jonmatthis Jan 16, 2024
11ae385
basic connection exists, fails on get latest frame
jonmatthis Jan 16, 2024
8412c69
its trying to something lol
jonmatthis Jan 16, 2024
6293651
retrying websockets lol
jonmatthis Jan 17, 2024
ed437f5
starting implement ping/pong health checks for ws
jonmatthis Jan 17, 2024
c6f83a3
getting there
jonmatthis Jan 17, 2024
ed3a09d
Rm unused
jonmatthis Jan 18, 2024
4733bee
jeez how long has it been since I committed?
jonmatthis Feb 11, 2024
8b1bc6d
cleaning up websocket connection
jonmatthis Feb 11, 2024
b5041c7
establishing ws
jonmatthis Feb 11, 2024
a13146e
made a simple ws test
jonmatthis Feb 11, 2024
144562d
log api routes
jonmatthis Feb 11, 2024
db007c6
ws pocs
jonmatthis Feb 11, 2024
6f74f79
ws timer
jonmatthis Feb 11, 2024
93a21fa
that's a ws connection!
jonmatthis Feb 11, 2024
24d9f4b
ws seems working
jonmatthis Feb 11, 2024
910e996
into the gui bits
jonmatthis Feb 12, 2024
5dd0887
clean up logging
jonmatthis Feb 12, 2024
14a3e16
refactor folder
jonmatthis Feb 12, 2024
edcc1d1
refactor folder again
jonmatthis Feb 12, 2024
7ee6f5f
working, but frame requests don't seem to make it to backend
jonmatthis Feb 12, 2024
c9ecb8e
refactor folders
jonmatthis Feb 12, 2024
e757b34
cleaning main process management
jonmatthis Feb 13, 2024
8ce931b
Ran `optimize imports`
jonmatthis Feb 14, 2024
d7cefc3
Commit before futzing with Websocket stuff
jonmatthis Feb 14, 2024
d7611de
Websocket connection (seems to) works!
jonmatthis Feb 14, 2024
cf224c1
adding better error handling when camera port is blocked
jonmatthis Feb 15, 2024
c48b6a9
add better frontend handling when no cams detected, might make gui un…
jonmatthis Feb 15, 2024
5e6caa6
check camera availability in threadpool
jonmatthis Feb 21, 2024
58ed82a
f a ws, http get_latest_frames proof of concept working - next time k…
jonmatthis Feb 21, 2024
8a1dd4d
messing with middlware for logging, but ultimately commenting it out …
jonmatthis Feb 22, 2024
0b1f5da
Skellycam lives! Kinda!
jonmatthis Feb 22, 2024
b7d077b
clean up logging
jonmatthis Feb 23, 2024
24bcdc0
cleaning up some stuff
jonmatthis Feb 23, 2024
dd1e9e0
attach close/detect/connect buttons, but they don't clean up things c…
jonmatthis Feb 23, 2024
c20a3ab
update config endpoint (seems to) works!
jonmatthis Feb 23, 2024
8c00c9d
rm vestigial
jonmatthis Feb 23, 2024
23f4066
working on recording
jonmatthis Feb 23, 2024
d1a05a2
rec buttons connect and init, but don't save anything
jonmatthis Feb 23, 2024
6bab951
recording kinda working?
jonmatthis Feb 23, 2024
ed941e7
recording kinda working! (might not clean up properly)
jonmatthis Feb 23, 2024
72751ab
building tests
jonmatthis Feb 23, 2024
c7985cc
test-backend
jonmatthis Feb 23, 2024
b93d184
test-frontend
jonmatthis Feb 23, 2024
1dfc7a3
test-uvicorn
jonmatthis Feb 23, 2024
65f2062
remove websocket nonsense
jonmatthis Feb 23, 2024
29deb3e
auto-format
jonmatthis Feb 23, 2024
e1b5040
test-fastapi-app
jonmatthis Feb 23, 2024
353ea30
crameras
jonmatthis Feb 24, 2024
ec956d2
4x1080@30fps :D
jonmatthis Feb 24, 2024
2182620
refactor
jonmatthis Feb 24, 2024
b976609
save in process
jonmatthis Feb 24, 2024
b40c776
rec
jonmatthis Feb 24, 2024
61d8231
cleaning up rec lifecycle
jonmatthis Feb 24, 2024
abdd980
some bs with the timestamp logger
jonmatthis Feb 24, 2024
591b083
clean up timetamp logging
jonmatthis Feb 24, 2024
8b3cd52
test test test
jonmatthis Feb 24, 2024
cc47c85
threading the `exit_event` all the way through
jonmatthis Feb 24, 2024
b3f415c
refactor video recorder process
jonmatthis Feb 25, 2024
265fffc
refactor video recorder process
jonmatthis Feb 25, 2024
8cc4312
recorder working?
jonmatthis Feb 25, 2024
1c10e55
almost - something screwy when multi-cam?
jonmatthis Feb 25, 2024
3d3e6f3
fiddle with device grabber
jonmatthis Feb 25, 2024
82820e7
dev name
jonmatthis Feb 25, 2024
68e614d
refactor
jonmatthis Feb 26, 2024
1cb8bf8
1 cam per process
jonmatthis Feb 26, 2024
bfeb96d
change log message
jonmatthis Mar 14, 2024
f412a64
add react webcam experiment (jfc this bot lol)
jonmatthis Mar 14, 2024
09d783f
tauri nuxt vue app demo
jonmatthis Mar 20, 2024
0262163
proof of concept tauri-nuxt-webcam
jonmatthis Mar 20, 2024
498e9da
before 2x2
jonmatthis Mar 20, 2024
38d86e4
working webcam component
jonmatthis Mar 20, 2024
7a26fc7
thats a camera grid!
jonmatthis Mar 20, 2024
9bf8874
:elmo-fire:
jonmatthis Mar 26, 2024
2d66ae6
copy template frmo `https://github.com/viandwi24/nuxt3-awesome-starter`
jonmatthis Mar 26, 2024
8b58ce2
move into src-nuxt-ui folder
jonmatthis Mar 26, 2024
928393f
setting up
jonmatthis Mar 26, 2024
4e78437
basic setup working
jonmatthis Mar 26, 2024
93a13e8
basic 3d view working
jonmatthis Mar 27, 2024
f4843fb
add groundplane
jonmatthis Mar 27, 2024
f3f1613
not sure why this wasn't already committed?
jonmatthis Apr 4, 2024
28b69ba
remove the `/layouts` thing until we need it. just using `app.vue` fo…
jonmatthis Apr 4, 2024
4818a15
cameras show up in proper grid now
jonmatthis Apr 4, 2024
a1d045c
rm context menu stuf for now
jonmatthis Apr 4, 2024
e26f725
nice lookin camera grid!
jonmatthis Apr 4, 2024
1fa1bce
rec buttn
jonmatthis Apr 4, 2024
7806f9a
still figuring out grid stuff
jonmatthis Apr 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

126 changes: 17 additions & 109 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,116 +1,24 @@
# macOS
.DS_Store
.AppleDouble
.LSOverride

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
dist

# Translations
*.mo
*.pot
# Node dependencies
node_modules

# Django stuff:
# Logs
logs
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py
# Misc
.DS_Store
.fleet
.idea

# dotenv
# Local env files
.env

# virtualenv
.venv*
venv*
ENV/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# IDE settings
.vscode/
.idea/

# mkdocs build dir
site/

pip*
.env.*
!.env.example
60 changes: 0 additions & 60 deletions CONTRIBUTING.md

This file was deleted.

141 changes: 3 additions & 138 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,141 +1,6 @@
# SkellyCam

<p align="center">
<img src="https://github.com/freemocap/skellycam/blob/main/skellycam/assets/logo/skelly-cam-logo.svg" height="128" alt="Project Logo">
</p>
<h3 align="center">SkellyCam</h3>
<p align="center"> An easy and efficient way to connect to one or more cameras and record synchronized videos 💀📸</p>
<p align="center">
<a href="https://github.com/freemocap/fast-camera-capture/releases/latest">
<img src="https://img.shields.io/github/release/freemocap/fast-camera-capture.svg" alt="Latest Release">
</a>
<a href="https://github.com/freemocap/fast-camera-capture/blob/main/LICENSE">
<img src="https://img.shields.io/badge/license-AGPLv3+-blue.svg" alt="AGPLv3+">
</a>
<a href="https://github.com/freemocap/fast-camera-capture/issues">
<img src="https://img.shields.io/badge/contributions-almost-ff69b4.svg" alt="Contributions Welcome">
</a>
<a href="https://github.com/psf/black">
<img alt="https://img.shields.io/badge/code%20style-black-000000.svg" src="https://img.shields.io/badge/code%20style-black-000000.svg">
</a>
</p>


---
## Motivation

Connecting to cameras on multiple platforms in a way that is not slow is a difficult challenge, especially for new developers.

There are a bunch of tools out there (e.g. OpenCV) and other open source libraries that give just enough to support hardware manipulation,
but they need to be use in concert in order to be useful.

This library attempts to string those things together, and provide an interface for everyone to use in python with a simple `pip install`.

The primary focus is to provide an easy method to connect to one or more cameras and provide methods for streaming/recordig synchronized frames from the connected cameras.



> **NOTE** - The SkellyCam package is the primary camera backend for the `freemocap` markeless motion capture software 💀✨
>
> [https:github.com/freemocap/freemocap](https:github.com/freemocap/freemocap)
>
>[https://freemocap.org](https://freemocap.org)

---
## Installation and Usage

### 0. Open a terminal (ideally with a `python` virtual environment activate)

### 1. Install from Pip
Enter the command below and press 'Enter'
```bash
pip install skellycam
```

### 2. Launch SkellyCam GUI
Enter the command below and press 'Enter'
```bash
skellycam
npm install
npm run tauri-dev
```


### 3. Success! 💀📸✨
Hopefully a bunch of text scrolled by and a GUI popped up!

If not, please [open an issue on the github repo](https://github.com/freemocap/skellycam/issues) and we'll try to help you out :)


## Limitation (aka TO DO) -
- Currently uses `opencv` to connect to cameras, so it won't recognize hardware that can't be connected with `cv2.VideoCapture` - Support for other camera hardware (e.g. FLIR) coming soon
- Camera streams are not synchronized at run time, but are saved and synchronized after the fact. This is time-consuming process that requres frames be saved in RAM until the recording is done. Both of these weaknesses have solutions in the works.

### New Python developers

1) Install Python 3.10
2) Create Virtual Environment
3) Install `skellycam`

#### To install Python 3.10

[Windows Python3 Installation Guide](https://realpython.com/installing-python/#how-to-install-from-the-full-installer)

[MacOSX Python3 Installation Guide](https://realpython.com/installing-python/#step-1-download-the-official-installer)

[Linux Python3 Installation Guide](https://computingforgeeks.com/how-to-install-python-on-ubuntu-linux-system/)

### How to use

#### RECOMMENDED - Use the GUI!

Launch the GUI by running `skellycam` in a terminal.

This is currently the most tested method for interacting with the cameras.


#### Example 1 - Connecting to a single Camera and showing the video feed

[Example 1 Python Fle](skellycam/experiments/examples/example1_single_camera_connection.py)

In this example, we connect a camera at index 0. Calling `show` allows us to view the cameras frames allowing us
to see video.

> NOTE - Work in progress, no clean way to kill this window yet

```python
from skellycam.models.cameras.camera_config import CameraConfig
, Camera

if __name__ == "__main__":
cam1 = Camera(CameraConfig(cam_id=0))
cam1.connect()
cam1.show()
```


#### Example 2 - Connect to all available cameras and record synchronized videos

> NOTE - Experimental and under development, might be unstable

[Example 2 Python Fle](skellycam/experiments/examples/example1_single_camera_connection.py)
```python
from skellycam.experiments import MultiCameraVideoRecorder

if __name__ == "__main__":

synchronized_video_recorder = MultiCameraVideoRecorder()
synchronized_video_recorder.run()

```

### Contribution Guidelines

Please read our contribution doc: [CONTRIBUTING.md](CONTRIBUTING.md)

## Maintainers

* [Jon Matthis](https://github.com/jonmatthis)
* [Endurance Idehen](https://github.com/endurance)

## License
This project is licensed under the APGL License - see the [LICENSE](LICENSE) file for details.

If the AGPL does not work for your needs, we are happy to discuss terms to license this software to you with a different agreement at a price point that increases exponentially as you move [spiritually](https://www.gnu.org/philosophy/open-source-misses-the-point.en.html) away from the `AGPL`
Loading