clippiti-player 0.1.3.post0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. clippiti_player-0.1.3.post0/.coveragerc +10 -0
  2. clippiti_player-0.1.3.post0/.editorconfig +13 -0
  3. clippiti_player-0.1.3.post0/.env +1 -0
  4. clippiti_player-0.1.3.post0/.github/workflows/publish.yml +63 -0
  5. clippiti_player-0.1.3.post0/.gitignore +46 -0
  6. clippiti_player-0.1.3.post0/LICENSE +21 -0
  7. clippiti_player-0.1.3.post0/MANIFEST.in +12 -0
  8. clippiti_player-0.1.3.post0/PKG-INFO +152 -0
  9. clippiti_player-0.1.3.post0/README.md +138 -0
  10. clippiti_player-0.1.3.post0/bump_version.sh +68 -0
  11. clippiti_player-0.1.3.post0/doc/README.md +17 -0
  12. clippiti_player-0.1.3.post0/doc/architecture-overview.md +60 -0
  13. clippiti_player-0.1.3.post0/doc/configuration-and-cli.md +55 -0
  14. clippiti_player-0.1.3.post0/doc/media/clip-dialog.png +0 -0
  15. clippiti_player-0.1.3.post0/doc/media/film.jpg +0 -0
  16. clippiti_player-0.1.3.post0/doc/media/icon.png +0 -0
  17. clippiti_player-0.1.3.post0/doc/media/logo-concept.jpg +0 -0
  18. clippiti_player-0.1.3.post0/doc/media/main-window.png +0 -0
  19. clippiti_player-0.1.3.post0/doc/media/scissors.jpg +0 -0
  20. clippiti_player-0.1.3.post0/doc/media/settings-dialog.png +0 -0
  21. clippiti_player-0.1.3.post0/doc/module-reference.md +62 -0
  22. clippiti_player-0.1.3.post0/doc/operations-and-troubleshooting.md +48 -0
  23. clippiti_player-0.1.3.post0/doc/runtime-workflows.md +72 -0
  24. clippiti_player-0.1.3.post0/pyproject.toml +36 -0
  25. clippiti_player-0.1.3.post0/requirements.txt +10 -0
  26. clippiti_player-0.1.3.post0/setup.cfg +4 -0
  27. clippiti_player-0.1.3.post0/src/clippiti/__init__.py +5 -0
  28. clippiti_player-0.1.3.post0/src/clippiti/__main__.py +253 -0
  29. clippiti_player-0.1.3.post0/src/clippiti/_version.py +24 -0
  30. clippiti_player-0.1.3.post0/src/clippiti/model/__init__.py +1 -0
  31. clippiti_player-0.1.3.post0/src/clippiti/model/config.py +136 -0
  32. clippiti_player-0.1.3.post0/src/clippiti/resources/icons/app-icon.png +0 -0
  33. clippiti_player-0.1.3.post0/src/clippiti/services/__init__.py +1 -0
  34. clippiti_player-0.1.3.post0/src/clippiti/services/buffer_engine.py +366 -0
  35. clippiti_player-0.1.3.post0/src/clippiti/services/clipper.py +269 -0
  36. clippiti_player-0.1.3.post0/src/clippiti/services/mpv_args.py +193 -0
  37. clippiti_player-0.1.3.post0/src/clippiti/services/recording.py +300 -0
  38. clippiti_player-0.1.3.post0/src/clippiti/services/remux_queue.py +135 -0
  39. clippiti_player-0.1.3.post0/src/clippiti/services/streamlink_args.py +90 -0
  40. clippiti_player-0.1.3.post0/src/clippiti/ui/__init__.py +1 -0
  41. clippiti_player-0.1.3.post0/src/clippiti/ui/app.py +672 -0
  42. clippiti_player-0.1.3.post0/src/clippiti/ui/clip_dialog.py +510 -0
  43. clippiti_player-0.1.3.post0/src/clippiti/ui/control_strip.py +373 -0
  44. clippiti_player-0.1.3.post0/src/clippiti/ui/osd.py +154 -0
  45. clippiti_player-0.1.3.post0/src/clippiti/ui/settings_dialog.py +312 -0
  46. clippiti_player-0.1.3.post0/src/clippiti/ui/video_surface.py +205 -0
  47. clippiti_player-0.1.3.post0/src/clippiti_player.egg-info/PKG-INFO +152 -0
  48. clippiti_player-0.1.3.post0/src/clippiti_player.egg-info/SOURCES.txt +59 -0
  49. clippiti_player-0.1.3.post0/src/clippiti_player.egg-info/dependency_links.txt +1 -0
  50. clippiti_player-0.1.3.post0/src/clippiti_player.egg-info/entry_points.txt +2 -0
  51. clippiti_player-0.1.3.post0/src/clippiti_player.egg-info/requires.txt +4 -0
  52. clippiti_player-0.1.3.post0/src/clippiti_player.egg-info/scm_file_list.json +55 -0
  53. clippiti_player-0.1.3.post0/src/clippiti_player.egg-info/scm_version.json +8 -0
  54. clippiti_player-0.1.3.post0/src/clippiti_player.egg-info/top_level.txt +1 -0
  55. clippiti_player-0.1.3.post0/tests/test_buffer_engine.py +396 -0
  56. clippiti_player-0.1.3.post0/tests/test_clipper.py +249 -0
  57. clippiti_player-0.1.3.post0/tests/test_config.py +121 -0
  58. clippiti_player-0.1.3.post0/tests/test_mpv_args.py +57 -0
  59. clippiti_player-0.1.3.post0/tests/test_recording.py +382 -0
  60. clippiti_player-0.1.3.post0/tests/test_remux_queue.py +127 -0
  61. clippiti_player-0.1.3.post0/tests/test_streamlink_args.py +78 -0
@@ -0,0 +1,10 @@
1
+ [run]
2
+ branch = True
3
+ omit =
4
+ */__init__.py
5
+ tests/*
6
+
7
+ [report]
8
+ omit =
9
+ */__init__.py
10
+ tests/*
@@ -0,0 +1,13 @@
1
+ # Editor configuration, see https://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ charset = utf-8
6
+ indent_style = space
7
+ indent_size = 2
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
10
+
11
+ [*.md]
12
+ max_line_length = off
13
+ trim_trailing_whitespace = false
@@ -0,0 +1 @@
1
+ PYTHONPATH=src
@@ -0,0 +1,63 @@
1
+ name: Publish Python package
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+ workflow_dispatch: {}
8
+
9
+ jobs:
10
+ publish-testpypi:
11
+ name: Publish to TestPyPI
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ id-token: write
15
+ steps:
16
+ - name: Check out code
17
+ uses: actions/checkout@v4
18
+
19
+ - name: Set up Python
20
+ uses: actions/setup-python@v4
21
+ with:
22
+ python-version: '3.12'
23
+
24
+ - name: Install build dependencies
25
+ run: |
26
+ python -m pip install --upgrade pip build
27
+
28
+ - name: Build distributions
29
+ run: |
30
+ rm -rf build dist *.egg-info || true
31
+ python -m build
32
+
33
+ - name: Publish to TestPyPI
34
+ uses: pypa/gh-action-pypi-publish@release/v1
35
+ with:
36
+ repository-url: https://test.pypi.org/legacy/
37
+
38
+ publish-pypi:
39
+ name: Publish to PyPI
40
+ needs: publish-testpypi
41
+ runs-on: ubuntu-latest
42
+ permissions:
43
+ id-token: write
44
+ steps:
45
+ - name: Check out code
46
+ uses: actions/checkout@v4
47
+
48
+ - name: Set up Python
49
+ uses: actions/setup-python@v4
50
+ with:
51
+ python-version: '3.12'
52
+
53
+ - name: Install build dependencies
54
+ run: |
55
+ python -m pip install --upgrade pip build
56
+
57
+ - name: Build distributions
58
+ run: |
59
+ rm -rf build dist *.egg-info || true
60
+ python -m build
61
+
62
+ - name: Publish to PyPI
63
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,46 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.pyo
5
+ *.pyd
6
+ *.so
7
+ *.egg
8
+ *.egg-info/
9
+ dist/
10
+ build/
11
+ .eggs/
12
+
13
+ # Virtual environments
14
+ .venv/
15
+ venv/
16
+ env/
17
+
18
+ # Distribution / packaging
19
+ *.whl
20
+ *.tar.gz
21
+ MANIFEST
22
+
23
+ # Testing
24
+ .pytest_cache/
25
+ .coverage
26
+ htmlcov/
27
+ .tox/
28
+
29
+ # Type checkers / linters
30
+ .mypy_cache/
31
+ .ruff_cache/
32
+
33
+ # Editors
34
+ .vscode/
35
+ .idea/
36
+ *.swp
37
+ *.swo
38
+ *~
39
+
40
+ # Runtime / generated
41
+ /tmp/clippiti/
42
+ *.stderr.log
43
+
44
+ # OS
45
+ .DS_Store
46
+ Thumbs.db
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Tarzasai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,12 @@
1
+ # Include icons and resources in the package distribution
2
+ recursive-include src/clippiti/resources *.png *.svg *.ico *.jpg *.jpeg
3
+
4
+ # Include documentation
5
+ include README.md
6
+ include LICENSE
7
+ include requirements.txt
8
+
9
+ # Exclude unnecessary files
10
+ global-exclude __pycache__
11
+ global-exclude *.py[cod]
12
+ global-exclude .DS_Store
@@ -0,0 +1,152 @@
1
+ Metadata-Version: 2.4
2
+ Name: clippiti-player
3
+ Version: 0.1.3.post0
4
+ Summary: Single-stream live player with rolling buffer, clipping, and recording
5
+ License-Expression: MIT
6
+ Requires-Python: >=3.12
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: python-mpv>=1.0.7
10
+ Requires-Dist: PyQt6>=6.6.0
11
+ Requires-Dist: PyYAML>=6.0
12
+ Requires-Dist: streamlink>=6.0
13
+ Dynamic: license-file
14
+
15
+ # Clippiti
16
+ *Single-stream live player with rolling buffer, clipping, and recording.*
17
+
18
+ Clippiti is a PyQt6 desktop app that opens a live stream through Streamlink, keeps a rolling local buffer, and lets you export clips or recordings without leaving the player.
19
+
20
+ ## Features
21
+
22
+ - Live stream playback via Streamlink + mpv
23
+ - Rolling HLS buffer pipeline (Streamlink -> ffmpeg)
24
+ - Clip export from buffered timeline
25
+ - Recording with optional auto-remux to MP4
26
+ - Floating controls, keyboard shortcuts, and OSD feedback
27
+ - YAML config with runtime-editable settings dialog
28
+ - CLI overrides for Streamlink and mpv options
29
+
30
+ Supported OS: Linux, Windows, macOS
31
+
32
+ ## Requirements
33
+
34
+ - Python 3.12+
35
+ - `streamlink` installed and available in `PATH`
36
+ - `ffmpeg` installed and available in `PATH` (or configured path)
37
+ - Desktop environment that supports PyQt6 apps
38
+
39
+ ## Install
40
+
41
+ From source (recommended for now):
42
+
43
+ ```bash
44
+ git clone <your-repo-url>
45
+ cd clippiti
46
+ python3 -m venv .venv
47
+ source .venv/bin/activate
48
+ pip install -r requirements.txt
49
+ pip install -e .
50
+ ```
51
+
52
+ Run:
53
+
54
+ ```bash
55
+ clippiti <url> <quality>
56
+ ```
57
+
58
+ Alternative without editable install:
59
+
60
+ ```bash
61
+ PYTHONPATH=src ./.venv/bin/python -m clippiti <url> <quality>
62
+ ```
63
+
64
+ ## Command-line options
65
+
66
+ ```text
67
+ positional:
68
+ url Stream URL to open
69
+ quality Desired stream quality
70
+
71
+ optional:
72
+ --sl TEXT Pass-through Streamlink arguments string
73
+ --mpv TEXT Additional mpv options (YAML or key=value)
74
+ --config PATH Path to config YAML file
75
+ --workdir PATH Path to runtime working directory
76
+ --verbose Enable verbose startup logs
77
+ ```
78
+
79
+ Example:
80
+
81
+ ```bash
82
+ clippiti https://www.twitch.tv/example_channel best --sl "--retry-max 5" --mpv "vf=hflip"
83
+ ```
84
+
85
+ ## Configuration
86
+
87
+ Clippiti stores configuration in YAML.
88
+
89
+ Resolution order:
90
+
91
+ 1. `--config <path>` if provided
92
+ 2. User config location (`clippiti.yaml`) if it exists
93
+ 3. `<workdir>/config.yaml` if it exists
94
+ 4. Fallback to `<workdir>/config.yaml` (or `./clippiti.yaml` if no workdir)
95
+
96
+ User config location (`clippiti.yaml`) is typically:
97
+
98
+ - Linux: `~/.config/clippiti.yaml`
99
+ - Windows: `%APPDATA%\clippiti.yaml`
100
+ - macOS: `~/Library/Application Support/clippiti.yaml`
101
+
102
+ Default workdir is:
103
+
104
+ - `/tmp/clippiti`
105
+
106
+ ## Development
107
+
108
+ Install dev/test deps (already included in `requirements.txt`):
109
+
110
+ ```bash
111
+ source .venv/bin/activate
112
+ pip install -r requirements.txt
113
+ ```
114
+
115
+ Run tests:
116
+
117
+ ```bash
118
+ PYTHONPATH=src ./.venv/bin/python -m pytest -q
119
+ ```
120
+
121
+ ## Documentation
122
+
123
+ - [Technical documentation index](doc/README.md)
124
+
125
+ ## Troubleshooting
126
+
127
+ - Stream metadata probe fails:
128
+ - Verify URL is online/public
129
+ - Verify `streamlink` is installed and runnable
130
+ - Playback pipeline does not start:
131
+ - Verify `ffmpeg` is installed and reachable
132
+ - Use `--verbose` to inspect startup logs
133
+ - mpv/video issues:
134
+ - Verify `python-mpv` is installed
135
+ - Try with simpler `--mpv` options first
136
+
137
+ ## License
138
+
139
+ MIT License - see `LICENSE` if present in this repository.
140
+
141
+ ## Acknowledgments
142
+
143
+ - Streamlink
144
+ - ffmpeg
145
+ - PyQt6
146
+ - python-mpv
147
+
148
+ ## Screenshots
149
+
150
+ ![Main Window](https://raw.githubusercontent.com/tarzasai/Clippiti/main/doc/media/main-window.png)
151
+ ![Clip Dialog](https://raw.githubusercontent.com/tarzasai/Clippiti/main/doc/media/clip-dialog.png)
152
+ ![Settings Dialog](https://raw.githubusercontent.com/tarzasai/Clippiti/main/doc/media/settings-dialog.png)
@@ -0,0 +1,138 @@
1
+ # Clippiti
2
+ *Single-stream live player with rolling buffer, clipping, and recording.*
3
+
4
+ Clippiti is a PyQt6 desktop app that opens a live stream through Streamlink, keeps a rolling local buffer, and lets you export clips or recordings without leaving the player.
5
+
6
+ ## Features
7
+
8
+ - Live stream playback via Streamlink + mpv
9
+ - Rolling HLS buffer pipeline (Streamlink -> ffmpeg)
10
+ - Clip export from buffered timeline
11
+ - Recording with optional auto-remux to MP4
12
+ - Floating controls, keyboard shortcuts, and OSD feedback
13
+ - YAML config with runtime-editable settings dialog
14
+ - CLI overrides for Streamlink and mpv options
15
+
16
+ Supported OS: Linux, Windows, macOS
17
+
18
+ ## Requirements
19
+
20
+ - Python 3.12+
21
+ - `streamlink` installed and available in `PATH`
22
+ - `ffmpeg` installed and available in `PATH` (or configured path)
23
+ - Desktop environment that supports PyQt6 apps
24
+
25
+ ## Install
26
+
27
+ From source (recommended for now):
28
+
29
+ ```bash
30
+ git clone <your-repo-url>
31
+ cd clippiti
32
+ python3 -m venv .venv
33
+ source .venv/bin/activate
34
+ pip install -r requirements.txt
35
+ pip install -e .
36
+ ```
37
+
38
+ Run:
39
+
40
+ ```bash
41
+ clippiti <url> <quality>
42
+ ```
43
+
44
+ Alternative without editable install:
45
+
46
+ ```bash
47
+ PYTHONPATH=src ./.venv/bin/python -m clippiti <url> <quality>
48
+ ```
49
+
50
+ ## Command-line options
51
+
52
+ ```text
53
+ positional:
54
+ url Stream URL to open
55
+ quality Desired stream quality
56
+
57
+ optional:
58
+ --sl TEXT Pass-through Streamlink arguments string
59
+ --mpv TEXT Additional mpv options (YAML or key=value)
60
+ --config PATH Path to config YAML file
61
+ --workdir PATH Path to runtime working directory
62
+ --verbose Enable verbose startup logs
63
+ ```
64
+
65
+ Example:
66
+
67
+ ```bash
68
+ clippiti https://www.twitch.tv/example_channel best --sl "--retry-max 5" --mpv "vf=hflip"
69
+ ```
70
+
71
+ ## Configuration
72
+
73
+ Clippiti stores configuration in YAML.
74
+
75
+ Resolution order:
76
+
77
+ 1. `--config <path>` if provided
78
+ 2. User config location (`clippiti.yaml`) if it exists
79
+ 3. `<workdir>/config.yaml` if it exists
80
+ 4. Fallback to `<workdir>/config.yaml` (or `./clippiti.yaml` if no workdir)
81
+
82
+ User config location (`clippiti.yaml`) is typically:
83
+
84
+ - Linux: `~/.config/clippiti.yaml`
85
+ - Windows: `%APPDATA%\clippiti.yaml`
86
+ - macOS: `~/Library/Application Support/clippiti.yaml`
87
+
88
+ Default workdir is:
89
+
90
+ - `/tmp/clippiti`
91
+
92
+ ## Development
93
+
94
+ Install dev/test deps (already included in `requirements.txt`):
95
+
96
+ ```bash
97
+ source .venv/bin/activate
98
+ pip install -r requirements.txt
99
+ ```
100
+
101
+ Run tests:
102
+
103
+ ```bash
104
+ PYTHONPATH=src ./.venv/bin/python -m pytest -q
105
+ ```
106
+
107
+ ## Documentation
108
+
109
+ - [Technical documentation index](doc/README.md)
110
+
111
+ ## Troubleshooting
112
+
113
+ - Stream metadata probe fails:
114
+ - Verify URL is online/public
115
+ - Verify `streamlink` is installed and runnable
116
+ - Playback pipeline does not start:
117
+ - Verify `ffmpeg` is installed and reachable
118
+ - Use `--verbose` to inspect startup logs
119
+ - mpv/video issues:
120
+ - Verify `python-mpv` is installed
121
+ - Try with simpler `--mpv` options first
122
+
123
+ ## License
124
+
125
+ MIT License - see `LICENSE` if present in this repository.
126
+
127
+ ## Acknowledgments
128
+
129
+ - Streamlink
130
+ - ffmpeg
131
+ - PyQt6
132
+ - python-mpv
133
+
134
+ ## Screenshots
135
+
136
+ ![Main Window](https://raw.githubusercontent.com/tarzasai/Clippiti/main/doc/media/main-window.png)
137
+ ![Clip Dialog](https://raw.githubusercontent.com/tarzasai/Clippiti/main/doc/media/clip-dialog.png)
138
+ ![Settings Dialog](https://raw.githubusercontent.com/tarzasai/Clippiti/main/doc/media/settings-dialog.png)
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env bash
2
+ set -e
3
+
4
+ # Get the latest tag
5
+ LATEST_TAG=$(git tag --list 'v*' --sort=-version:refname | head -1)
6
+
7
+ if [ -z "$LATEST_TAG" ]; then
8
+ echo "No existing version tags found. Starting with v1.0.0"
9
+ LATEST_TAG="v0.0.0"
10
+ fi
11
+
12
+ echo "Current version: $LATEST_TAG"
13
+
14
+ # Parse version components (remove 'v' prefix)
15
+ VERSION="${LATEST_TAG#v}"
16
+ IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
17
+
18
+ # Default bump type
19
+ BUMP_TYPE="${1:-patch}"
20
+
21
+ case "$BUMP_TYPE" in
22
+ major)
23
+ MAJOR=$((MAJOR + 1))
24
+ MINOR=0
25
+ PATCH=0
26
+ ;;
27
+ minor)
28
+ MINOR=$((MINOR + 1))
29
+ PATCH=0
30
+ ;;
31
+ patch)
32
+ PATCH=$((PATCH + 1))
33
+ ;;
34
+ *)
35
+ echo "Usage: $0 [major|minor|patch]"
36
+ echo " major: bump major version (X.0.0)"
37
+ echo " minor: bump minor version (x.Y.0)"
38
+ echo " patch: bump patch version (x.y.Z) [default]"
39
+ exit 1
40
+ ;;
41
+ esac
42
+
43
+ NEW_VERSION="v${MAJOR}.${MINOR}.${PATCH}"
44
+
45
+ echo "New version: $NEW_VERSION"
46
+ echo ""
47
+ read -p "Create tag $NEW_VERSION? [y/N] " -n 1 -r
48
+ echo
49
+
50
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
51
+ # Check if there are uncommitted changes
52
+ if ! git diff-index --quiet HEAD --; then
53
+ echo "Warning: You have uncommitted changes. Please commit them first."
54
+ exit 1
55
+ fi
56
+
57
+ # Create annotated tag
58
+ git tag -a "$NEW_VERSION" -m "Release $NEW_VERSION"
59
+ echo "✓ Created tag $NEW_VERSION"
60
+
61
+ # Push the tag to remote
62
+ echo "Pushing tag to remote..."
63
+ git push origin "$NEW_VERSION"
64
+ echo "✓ Pushed tag $NEW_VERSION to remote"
65
+ else
66
+ echo "Cancelled."
67
+ exit 1
68
+ fi
@@ -0,0 +1,17 @@
1
+ # Clippiti Documentation
2
+
3
+ This folder contains the technical documentation for the current Clippiti architecture and runtime behavior.
4
+
5
+ ## Documents
6
+
7
+ - [Architecture Overview](architecture-overview.md)
8
+ - [Runtime Workflows](runtime-workflows.md)
9
+ - [Module Reference](module-reference.md)
10
+ - [Configuration and CLI](configuration-and-cli.md)
11
+ - [Operations and Troubleshooting](operations-and-troubleshooting.md)
12
+
13
+ ## Scope
14
+
15
+ These documents describe the current app behavior and code layout under `src/clippiti`.
16
+
17
+ Examples use neutral stream URLs or Twitch/YouTube only.
@@ -0,0 +1,60 @@
1
+ # Architecture Overview
2
+
3
+ Clippiti is a desktop application built with PyQt6 and python-mpv.
4
+ It uses Streamlink and ffmpeg to build a local rolling HLS buffer, then plays the local playlist through mpv.
5
+
6
+ ## High-Level Structure
7
+
8
+ ```mermaid
9
+ flowchart TD
10
+ U[User] --> UI[PyQt UI]
11
+ UI --> APP[App Controller]
12
+ APP --> BE[Buffer Engine]
13
+ APP --> CLIP[Clip Service]
14
+ APP --> REC[Recording Service]
15
+ APP --> RQ[Remux Queue]
16
+
17
+ BE --> SL[Streamlink]
18
+ SL --> FF[ffmpeg]
19
+ FF --> HLS[/local live.m3u8 + segments/]
20
+ HLS --> MPV[mpv via python-mpv]
21
+
22
+ CLIP --> HLS
23
+ CLIP --> FF
24
+ REC --> HLS
25
+ REC --> FF
26
+ RQ --> FF
27
+ ```
28
+
29
+ ## C4-Style Container View
30
+
31
+ ```mermaid
32
+ C4Context
33
+ title Clippiti Container Diagram
34
+ Person(user, "User", "Watches, clips, records live streams")
35
+ System(clippiti, "Clippiti Desktop App", "PyQt6 application")
36
+ System_Ext(streamlink, "Streamlink", "Resolves and fetches stream data")
37
+ System_Ext(ffmpeg, "ffmpeg", "Builds HLS buffer and handles remux/export")
38
+ System_Ext(mpv, "mpv", "Playback engine via python-mpv")
39
+
40
+ Rel(user, clippiti, "Uses")
41
+ Rel(clippiti, streamlink, "Requests metadata + stream bytes")
42
+ Rel(clippiti, ffmpeg, "Runs for buffering/recording/clipping")
43
+ Rel(clippiti, mpv, "Controls playback")
44
+
45
+ UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")
46
+ ```
47
+
48
+ ## Key Design Choices
49
+
50
+ - Startup is asynchronous so the window can open while pipeline initialization is in progress.
51
+ - The stream processing path is explicit: Streamlink stdout -> ffmpeg HLS output -> local playlist.
52
+ - Clipping and recording are service-driven and isolated from UI widgets.
53
+ - Post-processing (remux/export) uses a queue service to avoid overlapping ffmpeg process control.
54
+
55
+ ## Core Runtime Artifacts
56
+
57
+ - Session directory: `<workdir>/sessions/<session_id>/`
58
+ - Live playlist: `<session_dir>/live.m3u8`
59
+ - HLS segments: `<session_dir>/seg_*.ts`
60
+ - Optional stderr logs per process when debug logging is enabled.
@@ -0,0 +1,55 @@
1
+ # Configuration and CLI
2
+
3
+ ## CLI Interface
4
+
5
+ `clippiti <url> <quality> [options]`
6
+
7
+ Options:
8
+
9
+ - `--sl`: additional Streamlink arguments
10
+ - `--mpv`: additional mpv options (YAML mapping or key=value pairs)
11
+ - `--config`: explicit config file path
12
+ - `--workdir`: explicit runtime workdir path
13
+ - `--verbose`: debug logging
14
+
15
+ Example (Twitch):
16
+
17
+ ```bash
18
+ clippiti https://www.twitch.tv/example_channel best --sl "--retry-max 5" --mpv "vf=hflip"
19
+ ```
20
+
21
+ Example (YouTube):
22
+
23
+ ```bash
24
+ clippiti https://www.youtube.com/watch?v=dQw4w9WgXcQ best
25
+ ```
26
+
27
+ ## Config Resolution Order
28
+
29
+ 1. `--config <path>`
30
+ 2. user config location (`clippiti.yaml`) if it already exists
31
+ 3. `<workdir>/config.yaml` if it already exists
32
+ 4. fallback to `<workdir>/config.yaml` (or `./clippiti.yaml` when no workdir)
33
+
34
+ Typical user config locations:
35
+
36
+ - Linux: `~/.config/clippiti.yaml`
37
+ - Windows: `%APPDATA%\clippiti.yaml`
38
+ - macOS: `~/Library/Application Support/clippiti.yaml`
39
+
40
+ Default workdir:
41
+
42
+ - `/tmp/clippiti`
43
+
44
+ ## Main Config Sections
45
+
46
+ - `general`
47
+ - `ffmpeg_path`, `segment_seconds`, `window_segments`, `controls_area`, `controls_resize_debounce_ms`, `mpv_options`
48
+ - `streamlink`
49
+ - `default_args`
50
+ - `clip`
51
+ - `dir`, `default_duration`
52
+ - `recording`
53
+ - `dir`, `filename_format`, `auto_remux_to_mp4`
54
+ - `snapshot`
55
+ - `dir`, `filename_format`