camtasio 2025.0.5__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.
- camtasio-2025.0.5/.gitignore +87 -0
- camtasio-2025.0.5/LICENSE +7 -0
- camtasio-2025.0.5/PKG-INFO +227 -0
- camtasio-2025.0.5/README.md +186 -0
- camtasio-2025.0.5/pyproject.toml +134 -0
- camtasio-2025.0.5/src/camtasio/__init__.py +100 -0
- camtasio-2025.0.5/src/camtasio/_version.py +21 -0
- camtasio-2025.0.5/src/camtasio/annotations/__init__.py +21 -0
- camtasio-2025.0.5/src/camtasio/annotations/callouts.py +179 -0
- camtasio-2025.0.5/src/camtasio/annotations/types.py +99 -0
- camtasio-2025.0.5/src/camtasio/cli/__init__.py +6 -0
- camtasio-2025.0.5/src/camtasio/cli/app.py +784 -0
- camtasio-2025.0.5/src/camtasio/cli.py +258 -0
- camtasio-2025.0.5/src/camtasio/effects/__init__.py +7 -0
- camtasio-2025.0.5/src/camtasio/effects/base.py +48 -0
- camtasio-2025.0.5/src/camtasio/effects/chroma_key.py +192 -0
- camtasio-2025.0.5/src/camtasio/legacy/__init__.py +0 -0
- camtasio-2025.0.5/src/camtasio/models/__init__.py +37 -0
- camtasio-2025.0.5/src/camtasio/models/canvas.py +101 -0
- camtasio-2025.0.5/src/camtasio/models/factory.py +110 -0
- camtasio-2025.0.5/src/camtasio/models/media.py +402 -0
- camtasio-2025.0.5/src/camtasio/models/project.py +185 -0
- camtasio-2025.0.5/src/camtasio/models/source.py +225 -0
- camtasio-2025.0.5/src/camtasio/models/timeline.py +252 -0
- camtasio-2025.0.5/src/camtasio/operations/__init__.py +21 -0
- camtasio-2025.0.5/src/camtasio/operations/media_operations.py +170 -0
- camtasio-2025.0.5/src/camtasio/project.py +0 -0
- camtasio-2025.0.5/src/camtasio/scaler.py +251 -0
- camtasio-2025.0.5/src/camtasio/serialization/__init__.py +22 -0
- camtasio-2025.0.5/src/camtasio/serialization/json_encoder.py +48 -0
- camtasio-2025.0.5/src/camtasio/serialization/json_handler.py +113 -0
- camtasio-2025.0.5/src/camtasio/serialization/loader.py +128 -0
- camtasio-2025.0.5/src/camtasio/serialization/saver.py +86 -0
- camtasio-2025.0.5/src/camtasio/serialization/version.py +117 -0
- camtasio-2025.0.5/src/camtasio/transforms/__init__.py +6 -0
- camtasio-2025.0.5/src/camtasio/transforms/engine.py +236 -0
- camtasio-2025.0.5/src/camtasio/utils/__init__.py +7 -0
- camtasio-2025.0.5/src/camtasio/utils/color.py +116 -0
- camtasio-2025.0.5/src/camtasio/utils/timing.py +177 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
|
|
2
|
+
__pycache__/
|
|
3
|
+
.cache
|
|
4
|
+
.coverage
|
|
5
|
+
.coverage.*
|
|
6
|
+
.DS_Store
|
|
7
|
+
.eggs/
|
|
8
|
+
.env
|
|
9
|
+
.hatch/
|
|
10
|
+
.hypothesis/
|
|
11
|
+
.idea_modules/
|
|
12
|
+
.idea/**/dataSources.ids
|
|
13
|
+
.idea/**/dataSources.local.xml
|
|
14
|
+
.idea/**/dataSources.xml
|
|
15
|
+
.idea/**/dataSources/
|
|
16
|
+
.idea/**/dynamic.xml
|
|
17
|
+
.idea/**/gradle.xml
|
|
18
|
+
.idea/**/libraries
|
|
19
|
+
.idea/**/mongoSettings.xml
|
|
20
|
+
.idea/**/sqlDataSources.xml
|
|
21
|
+
.idea/**/tasks.xml
|
|
22
|
+
.idea/**/uiDesigner.xml
|
|
23
|
+
.idea/**/workspace.xml
|
|
24
|
+
.idea/dictionaries
|
|
25
|
+
.idea/replstate.xml
|
|
26
|
+
.idea/sonarlint
|
|
27
|
+
.installed.cfg
|
|
28
|
+
.nox/
|
|
29
|
+
.pytest_cache/
|
|
30
|
+
.Python
|
|
31
|
+
.tox/
|
|
32
|
+
.venv
|
|
33
|
+
.vscode/
|
|
34
|
+
*.backup
|
|
35
|
+
*.cover
|
|
36
|
+
*.egg
|
|
37
|
+
*.egg-info/
|
|
38
|
+
*.iws
|
|
39
|
+
*.py,cover
|
|
40
|
+
*.py[cod]
|
|
41
|
+
*.so
|
|
42
|
+
*.swo
|
|
43
|
+
*.swp
|
|
44
|
+
*.temp
|
|
45
|
+
*.tmp
|
|
46
|
+
*.tscproj.backup
|
|
47
|
+
*~
|
|
48
|
+
*$py.class
|
|
49
|
+
/.idea/
|
|
50
|
+
/.rakeTasks
|
|
51
|
+
/out/
|
|
52
|
+
~*
|
|
53
|
+
atlassian-ide-plugin.xml
|
|
54
|
+
build/
|
|
55
|
+
cmake-build-debug/
|
|
56
|
+
com_crashlytics_export_strings.xml
|
|
57
|
+
coverage.xml
|
|
58
|
+
crashlytics-build.properties
|
|
59
|
+
crashlytics.properties
|
|
60
|
+
develop-eggs/
|
|
61
|
+
dist/
|
|
62
|
+
docs/site
|
|
63
|
+
downloads/
|
|
64
|
+
eggs/
|
|
65
|
+
env.bak/
|
|
66
|
+
env/
|
|
67
|
+
ENV/
|
|
68
|
+
fabric.properties
|
|
69
|
+
htmlcov/
|
|
70
|
+
lib/
|
|
71
|
+
lib64/
|
|
72
|
+
llms.txt
|
|
73
|
+
MANIFEST
|
|
74
|
+
nosetests.xml
|
|
75
|
+
parts/
|
|
76
|
+
pip-wheel-metadata/
|
|
77
|
+
sandbox/
|
|
78
|
+
sdist/
|
|
79
|
+
share/python-wheels/
|
|
80
|
+
site/
|
|
81
|
+
src/camtasio/_version.py
|
|
82
|
+
Thumbs.db
|
|
83
|
+
uv.lock
|
|
84
|
+
var/
|
|
85
|
+
venv.bak/
|
|
86
|
+
venv/
|
|
87
|
+
wheels/
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2019 Sixty North AS
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: camtasio
|
|
3
|
+
Version: 2025.0.5
|
|
4
|
+
Summary: Python toolkit for programmatically manipulating Camtasia project files
|
|
5
|
+
Project-URL: Changelog, https://github.com/twardoch/camtasio/blob/main/CHANGELOG.md
|
|
6
|
+
Project-URL: Documentation, https://github.com/twardoch/camtasio
|
|
7
|
+
Project-URL: Homepage, https://github.com/twardoch/camtasio
|
|
8
|
+
Project-URL: Issues, https://github.com/twardoch/camtasio/issues
|
|
9
|
+
Project-URL: Repository, https://github.com/twardoch/camtasio
|
|
10
|
+
Author-email: Adam Twardoch <adam+github@twardoch.com>
|
|
11
|
+
Maintainer-email: Adam Twardoch <adam+github@twardoch.com>
|
|
12
|
+
License: MIT
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Keywords: automation,camtasia,cmproj,editing,tscproj,video
|
|
15
|
+
Classifier: Development Status :: 4 - Beta
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
+
Classifier: Topic :: Multimedia :: Video
|
|
25
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
26
|
+
Requires-Python: >=3.11
|
|
27
|
+
Requires-Dist: fire>=0.7.0
|
|
28
|
+
Requires-Dist: loguru>=0.7.3
|
|
29
|
+
Requires-Dist: orjson>=3.10.0
|
|
30
|
+
Requires-Dist: pydantic>=2.0
|
|
31
|
+
Requires-Dist: rich>=13.0.0
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: build>=1.0.0; extra == 'dev'
|
|
34
|
+
Requires-Dist: hypothesis>=6.0.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: mypy>=1.0; extra == 'dev'
|
|
36
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
|
|
37
|
+
Requires-Dist: pytest>=7.4.0; extra == 'dev'
|
|
38
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
39
|
+
Requires-Dist: twine>=4.0.0; extra == 'dev'
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
|
|
42
|
+
# Camtasio
|
|
43
|
+
|
|
44
|
+
A modern Python API and CLI for programmatically working with Camtasia projects.
|
|
45
|
+
|
|
46
|
+
## Overview
|
|
47
|
+
|
|
48
|
+
Camtasio provides a comprehensive toolkit for manipulating Camtasia project files (`.cmproj` directories containing `.tscproj` JSON files). It combines high-level object-oriented APIs with powerful low-level JSON manipulation capabilities for complete control over Camtasia projects.
|
|
49
|
+
|
|
50
|
+
### Key Features
|
|
51
|
+
|
|
52
|
+
- **๐ Project Management**: Read, modify, and save Camtasia projects (.tscproj files)
|
|
53
|
+
- **๐ฌ Timeline Operations**: List tracks, analyze clips, and manage markers
|
|
54
|
+
- **๐ Spatial Scaling**: Resize projects to different resolutions (`xyscale`)
|
|
55
|
+
- **โฑ๏ธ Temporal Scaling**: Change playback speed with audio preservation (`timescale`)
|
|
56
|
+
- **๐ Media Management**: List, clean, and replace media files (`media-ls`, `media-rm`, `media-replace`)
|
|
57
|
+
- **๐ฏ Batch Processing**: Apply operations across multiple projects (`batch`)
|
|
58
|
+
- **๐ง Rich CLI Tools**: Command-line interface with beautiful terminal output
|
|
59
|
+
- **๐ Project Analysis**: Detailed statistics, complexity scoring, and recommendations
|
|
60
|
+
- **โ
Version Compatibility**: Support for Camtasia 2018-2025+ (v1.0-v9.0)
|
|
61
|
+
|
|
62
|
+
## Installation
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install camtasio
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
For development:
|
|
69
|
+
```bash
|
|
70
|
+
git clone https://github.com/yourusername/camtasio.git
|
|
71
|
+
cd camtasio
|
|
72
|
+
uv venv
|
|
73
|
+
uv sync
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Quick Start
|
|
77
|
+
|
|
78
|
+
### Command Line Interface
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Get project information
|
|
82
|
+
camtasio info my_project.tscproj --detailed
|
|
83
|
+
|
|
84
|
+
# Scale project spatially by 1.5x
|
|
85
|
+
camtasio xyscale my_project.tscproj 1.5 scaled_project.tscproj
|
|
86
|
+
|
|
87
|
+
# Scale timeline temporally (double speed)
|
|
88
|
+
camtasio timescale my_project.tscproj 2.0 fast_project.tscproj
|
|
89
|
+
|
|
90
|
+
# List and clean media
|
|
91
|
+
camtasio media_ls my_project.tscproj --detailed
|
|
92
|
+
camtasio media_rm my_project.tscproj # Remove unused media
|
|
93
|
+
|
|
94
|
+
# Batch process multiple projects
|
|
95
|
+
camtasio batch "projects/*.tscproj" info --detailed
|
|
96
|
+
|
|
97
|
+
# List timeline tracks and markers
|
|
98
|
+
camtasio track_ls my_project.tscproj --detailed
|
|
99
|
+
camtasio marker_ls my_project.tscproj
|
|
100
|
+
|
|
101
|
+
# Generate comprehensive analysis report
|
|
102
|
+
camtasio analyze my_project.tscproj
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Python API
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
from camtasio.serialization import ProjectLoader, ProjectSaver
|
|
109
|
+
from camtasio.transforms.engine import PropertyTransformer, TransformConfig, TransformType
|
|
110
|
+
|
|
111
|
+
# Load a project
|
|
112
|
+
loader = ProjectLoader()
|
|
113
|
+
project_data = loader.load("my_project.tscproj")
|
|
114
|
+
|
|
115
|
+
# Scale spatially using transform engine
|
|
116
|
+
config = TransformConfig(TransformType.SPATIAL, factor=1.5)
|
|
117
|
+
transformer = PropertyTransformer(config)
|
|
118
|
+
scaled_data = transformer.transform_dict(project_data)
|
|
119
|
+
|
|
120
|
+
# Save result
|
|
121
|
+
saver = ProjectSaver()
|
|
122
|
+
saver.save_dict(scaled_data, "scaled_project.tscproj")
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Available Commands
|
|
126
|
+
|
|
127
|
+
| Command | Description | Example |
|
|
128
|
+
|---------|-------------|---------|
|
|
129
|
+
| `info` | Show project information and statistics | `camtasio info project.tscproj --detailed` |
|
|
130
|
+
| `validate` | Check project integrity | `camtasio validate project.tscproj` |
|
|
131
|
+
| `xyscale` | Scale project dimensions | `camtasio xyscale project.tscproj 1.5` |
|
|
132
|
+
| `timescale` | Scale timeline duration | `camtasio timescale project.tscproj 0.5` |
|
|
133
|
+
| `media_ls` | List media bin contents | `camtasio media_ls project.tscproj --detailed` |
|
|
134
|
+
| `media_rm` | Remove unused media | `camtasio media_rm project.tscproj` |
|
|
135
|
+
| `media_replace` | Replace media paths | `camtasio media_replace project.tscproj old.mp4 new.mp4` |
|
|
136
|
+
| `track_ls` | List timeline tracks | `camtasio track_ls project.tscproj --detailed` |
|
|
137
|
+
| `marker_ls` | List timeline markers | `camtasio marker_ls project.tscproj` |
|
|
138
|
+
| `analyze` | Generate analysis report | `camtasio analyze project.tscproj` |
|
|
139
|
+
| `batch` | Process multiple files | `camtasio batch "*.tscproj" info` |
|
|
140
|
+
| `version` | Show version info | `camtasio version` |
|
|
141
|
+
|
|
142
|
+
## Project Structure
|
|
143
|
+
|
|
144
|
+
A Camtasia project (`.cmproj`) is a directory containing:
|
|
145
|
+
- `project.tscproj` - Main JSON project file
|
|
146
|
+
- `media/` - Imported media files
|
|
147
|
+
- macOS metadata files (bookmarks.plist, docPrefs)
|
|
148
|
+
|
|
149
|
+
The `.tscproj` file contains:
|
|
150
|
+
- Canvas dimensions and frame rate
|
|
151
|
+
- Source media bin with imported files
|
|
152
|
+
- Timeline with scenes, tracks, and clips
|
|
153
|
+
- Effects and annotations
|
|
154
|
+
|
|
155
|
+
## Advanced Usage
|
|
156
|
+
|
|
157
|
+
### Spatial Scaling
|
|
158
|
+
|
|
159
|
+
Resize projects while maintaining relative positions and proportions:
|
|
160
|
+
|
|
161
|
+
```python
|
|
162
|
+
from camtasio import Project
|
|
163
|
+
|
|
164
|
+
project = Project("tutorial.cmproj")
|
|
165
|
+
# Scale from 1080p to 4K
|
|
166
|
+
project.scale(3840, 2160, preserve_aspect_ratio=True)
|
|
167
|
+
project.save()
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Timeline Manipulation
|
|
171
|
+
|
|
172
|
+
```python
|
|
173
|
+
# Add a new marker
|
|
174
|
+
project.timeline.add_marker(time=5.0, value="Important Point")
|
|
175
|
+
|
|
176
|
+
# Find all video clips
|
|
177
|
+
for track in project.timeline.tracks:
|
|
178
|
+
for clip in track.clips:
|
|
179
|
+
if clip.media_type == "video":
|
|
180
|
+
print(f"Video: {clip.name} at {clip.start_time}")
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Media Management
|
|
184
|
+
|
|
185
|
+
```python
|
|
186
|
+
# List all media files
|
|
187
|
+
for media in project.media_bin:
|
|
188
|
+
print(f"{media.name}: {media.path}")
|
|
189
|
+
|
|
190
|
+
# Check for missing media
|
|
191
|
+
missing = project.find_missing_media()
|
|
192
|
+
if missing:
|
|
193
|
+
print(f"Warning: {len(missing)} files not found")
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Architecture
|
|
197
|
+
|
|
198
|
+
Camtasio provides both high-level and low-level APIs:
|
|
199
|
+
|
|
200
|
+
- **High-Level API**: Object-oriented interface with `Project`, `Timeline`, `Track`, and `Clip` classes
|
|
201
|
+
- **Low-Level API**: Direct JSON manipulation for advanced operations
|
|
202
|
+
- **Domain Models**: Structured representations of project components
|
|
203
|
+
- **Operations Engine**: Recursive traversal for complex transformations
|
|
204
|
+
|
|
205
|
+
## Compatibility
|
|
206
|
+
|
|
207
|
+
- โ
**Camtasia 2018-2025+**: Full support for v1.0-v9.0 formats
|
|
208
|
+
- โ
**Cross-platform**: Windows, macOS, Linux
|
|
209
|
+
- โ
**Python 3.11+**: Modern Python with type hints
|
|
210
|
+
- โ
**Format versions**: v1.0, v4.0, v9.0 and future versions
|
|
211
|
+
|
|
212
|
+
## Contributing
|
|
213
|
+
|
|
214
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
215
|
+
|
|
216
|
+
## License
|
|
217
|
+
|
|
218
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
219
|
+
|
|
220
|
+
## Acknowledgments
|
|
221
|
+
|
|
222
|
+
Built with modern Python tooling:
|
|
223
|
+
- ๐ฆ `uv` and `hatch` for packaging
|
|
224
|
+
- ๐ `ruff` for linting and formatting
|
|
225
|
+
- ๐งช `pytest` for testing
|
|
226
|
+
- ๐จ `rich` for beautiful CLI output
|
|
227
|
+
- ๐ `loguru` for structured logging
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# Camtasio
|
|
2
|
+
|
|
3
|
+
A modern Python API and CLI for programmatically working with Camtasia projects.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Camtasio provides a comprehensive toolkit for manipulating Camtasia project files (`.cmproj` directories containing `.tscproj` JSON files). It combines high-level object-oriented APIs with powerful low-level JSON manipulation capabilities for complete control over Camtasia projects.
|
|
8
|
+
|
|
9
|
+
### Key Features
|
|
10
|
+
|
|
11
|
+
- **๐ Project Management**: Read, modify, and save Camtasia projects (.tscproj files)
|
|
12
|
+
- **๐ฌ Timeline Operations**: List tracks, analyze clips, and manage markers
|
|
13
|
+
- **๐ Spatial Scaling**: Resize projects to different resolutions (`xyscale`)
|
|
14
|
+
- **โฑ๏ธ Temporal Scaling**: Change playback speed with audio preservation (`timescale`)
|
|
15
|
+
- **๐ Media Management**: List, clean, and replace media files (`media-ls`, `media-rm`, `media-replace`)
|
|
16
|
+
- **๐ฏ Batch Processing**: Apply operations across multiple projects (`batch`)
|
|
17
|
+
- **๐ง Rich CLI Tools**: Command-line interface with beautiful terminal output
|
|
18
|
+
- **๐ Project Analysis**: Detailed statistics, complexity scoring, and recommendations
|
|
19
|
+
- **โ
Version Compatibility**: Support for Camtasia 2018-2025+ (v1.0-v9.0)
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install camtasio
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
For development:
|
|
28
|
+
```bash
|
|
29
|
+
git clone https://github.com/yourusername/camtasio.git
|
|
30
|
+
cd camtasio
|
|
31
|
+
uv venv
|
|
32
|
+
uv sync
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
### Command Line Interface
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Get project information
|
|
41
|
+
camtasio info my_project.tscproj --detailed
|
|
42
|
+
|
|
43
|
+
# Scale project spatially by 1.5x
|
|
44
|
+
camtasio xyscale my_project.tscproj 1.5 scaled_project.tscproj
|
|
45
|
+
|
|
46
|
+
# Scale timeline temporally (double speed)
|
|
47
|
+
camtasio timescale my_project.tscproj 2.0 fast_project.tscproj
|
|
48
|
+
|
|
49
|
+
# List and clean media
|
|
50
|
+
camtasio media_ls my_project.tscproj --detailed
|
|
51
|
+
camtasio media_rm my_project.tscproj # Remove unused media
|
|
52
|
+
|
|
53
|
+
# Batch process multiple projects
|
|
54
|
+
camtasio batch "projects/*.tscproj" info --detailed
|
|
55
|
+
|
|
56
|
+
# List timeline tracks and markers
|
|
57
|
+
camtasio track_ls my_project.tscproj --detailed
|
|
58
|
+
camtasio marker_ls my_project.tscproj
|
|
59
|
+
|
|
60
|
+
# Generate comprehensive analysis report
|
|
61
|
+
camtasio analyze my_project.tscproj
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Python API
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
from camtasio.serialization import ProjectLoader, ProjectSaver
|
|
68
|
+
from camtasio.transforms.engine import PropertyTransformer, TransformConfig, TransformType
|
|
69
|
+
|
|
70
|
+
# Load a project
|
|
71
|
+
loader = ProjectLoader()
|
|
72
|
+
project_data = loader.load("my_project.tscproj")
|
|
73
|
+
|
|
74
|
+
# Scale spatially using transform engine
|
|
75
|
+
config = TransformConfig(TransformType.SPATIAL, factor=1.5)
|
|
76
|
+
transformer = PropertyTransformer(config)
|
|
77
|
+
scaled_data = transformer.transform_dict(project_data)
|
|
78
|
+
|
|
79
|
+
# Save result
|
|
80
|
+
saver = ProjectSaver()
|
|
81
|
+
saver.save_dict(scaled_data, "scaled_project.tscproj")
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Available Commands
|
|
85
|
+
|
|
86
|
+
| Command | Description | Example |
|
|
87
|
+
|---------|-------------|---------|
|
|
88
|
+
| `info` | Show project information and statistics | `camtasio info project.tscproj --detailed` |
|
|
89
|
+
| `validate` | Check project integrity | `camtasio validate project.tscproj` |
|
|
90
|
+
| `xyscale` | Scale project dimensions | `camtasio xyscale project.tscproj 1.5` |
|
|
91
|
+
| `timescale` | Scale timeline duration | `camtasio timescale project.tscproj 0.5` |
|
|
92
|
+
| `media_ls` | List media bin contents | `camtasio media_ls project.tscproj --detailed` |
|
|
93
|
+
| `media_rm` | Remove unused media | `camtasio media_rm project.tscproj` |
|
|
94
|
+
| `media_replace` | Replace media paths | `camtasio media_replace project.tscproj old.mp4 new.mp4` |
|
|
95
|
+
| `track_ls` | List timeline tracks | `camtasio track_ls project.tscproj --detailed` |
|
|
96
|
+
| `marker_ls` | List timeline markers | `camtasio marker_ls project.tscproj` |
|
|
97
|
+
| `analyze` | Generate analysis report | `camtasio analyze project.tscproj` |
|
|
98
|
+
| `batch` | Process multiple files | `camtasio batch "*.tscproj" info` |
|
|
99
|
+
| `version` | Show version info | `camtasio version` |
|
|
100
|
+
|
|
101
|
+
## Project Structure
|
|
102
|
+
|
|
103
|
+
A Camtasia project (`.cmproj`) is a directory containing:
|
|
104
|
+
- `project.tscproj` - Main JSON project file
|
|
105
|
+
- `media/` - Imported media files
|
|
106
|
+
- macOS metadata files (bookmarks.plist, docPrefs)
|
|
107
|
+
|
|
108
|
+
The `.tscproj` file contains:
|
|
109
|
+
- Canvas dimensions and frame rate
|
|
110
|
+
- Source media bin with imported files
|
|
111
|
+
- Timeline with scenes, tracks, and clips
|
|
112
|
+
- Effects and annotations
|
|
113
|
+
|
|
114
|
+
## Advanced Usage
|
|
115
|
+
|
|
116
|
+
### Spatial Scaling
|
|
117
|
+
|
|
118
|
+
Resize projects while maintaining relative positions and proportions:
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
from camtasio import Project
|
|
122
|
+
|
|
123
|
+
project = Project("tutorial.cmproj")
|
|
124
|
+
# Scale from 1080p to 4K
|
|
125
|
+
project.scale(3840, 2160, preserve_aspect_ratio=True)
|
|
126
|
+
project.save()
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Timeline Manipulation
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
# Add a new marker
|
|
133
|
+
project.timeline.add_marker(time=5.0, value="Important Point")
|
|
134
|
+
|
|
135
|
+
# Find all video clips
|
|
136
|
+
for track in project.timeline.tracks:
|
|
137
|
+
for clip in track.clips:
|
|
138
|
+
if clip.media_type == "video":
|
|
139
|
+
print(f"Video: {clip.name} at {clip.start_time}")
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Media Management
|
|
143
|
+
|
|
144
|
+
```python
|
|
145
|
+
# List all media files
|
|
146
|
+
for media in project.media_bin:
|
|
147
|
+
print(f"{media.name}: {media.path}")
|
|
148
|
+
|
|
149
|
+
# Check for missing media
|
|
150
|
+
missing = project.find_missing_media()
|
|
151
|
+
if missing:
|
|
152
|
+
print(f"Warning: {len(missing)} files not found")
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Architecture
|
|
156
|
+
|
|
157
|
+
Camtasio provides both high-level and low-level APIs:
|
|
158
|
+
|
|
159
|
+
- **High-Level API**: Object-oriented interface with `Project`, `Timeline`, `Track`, and `Clip` classes
|
|
160
|
+
- **Low-Level API**: Direct JSON manipulation for advanced operations
|
|
161
|
+
- **Domain Models**: Structured representations of project components
|
|
162
|
+
- **Operations Engine**: Recursive traversal for complex transformations
|
|
163
|
+
|
|
164
|
+
## Compatibility
|
|
165
|
+
|
|
166
|
+
- โ
**Camtasia 2018-2025+**: Full support for v1.0-v9.0 formats
|
|
167
|
+
- โ
**Cross-platform**: Windows, macOS, Linux
|
|
168
|
+
- โ
**Python 3.11+**: Modern Python with type hints
|
|
169
|
+
- โ
**Format versions**: v1.0, v4.0, v9.0 and future versions
|
|
170
|
+
|
|
171
|
+
## Contributing
|
|
172
|
+
|
|
173
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
174
|
+
|
|
175
|
+
## License
|
|
176
|
+
|
|
177
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
178
|
+
|
|
179
|
+
## Acknowledgments
|
|
180
|
+
|
|
181
|
+
Built with modern Python tooling:
|
|
182
|
+
- ๐ฆ `uv` and `hatch` for packaging
|
|
183
|
+
- ๐ `ruff` for linting and formatting
|
|
184
|
+
- ๐งช `pytest` for testing
|
|
185
|
+
- ๐จ `rich` for beautiful CLI output
|
|
186
|
+
- ๐ `loguru` for structured logging
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "camtasio"
|
|
3
|
+
description = "Python toolkit for programmatically manipulating Camtasia project files"
|
|
4
|
+
readme = "README.md"
|
|
5
|
+
requires-python = ">=3.11"
|
|
6
|
+
license = { text = "MIT" }
|
|
7
|
+
authors = [
|
|
8
|
+
{ name = "Adam Twardoch", email = "adam+github@twardoch.com" },
|
|
9
|
+
]
|
|
10
|
+
maintainers = [
|
|
11
|
+
{ name = "Adam Twardoch", email = "adam+github@twardoch.com" },
|
|
12
|
+
]
|
|
13
|
+
keywords = ["automation", "camtasia", "cmproj", "editing", "tscproj", "video"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"Intended Audience :: End Users/Desktop",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python :: 3.12",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Programming Language :: Python :: 3.14",
|
|
24
|
+
"Topic :: Multimedia :: Video",
|
|
25
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
26
|
+
]
|
|
27
|
+
dependencies = [
|
|
28
|
+
"fire>=0.7.0",
|
|
29
|
+
"loguru>=0.7.3",
|
|
30
|
+
"orjson>=3.10.0",
|
|
31
|
+
"pydantic>=2.0",
|
|
32
|
+
"rich>=13.0.0",
|
|
33
|
+
]
|
|
34
|
+
dynamic = ["version"]
|
|
35
|
+
|
|
36
|
+
[project.urls]
|
|
37
|
+
Changelog = "https://github.com/twardoch/camtasio/blob/main/CHANGELOG.md"
|
|
38
|
+
Documentation = "https://github.com/twardoch/camtasio"
|
|
39
|
+
Homepage = "https://github.com/twardoch/camtasio"
|
|
40
|
+
Issues = "https://github.com/twardoch/camtasio/issues"
|
|
41
|
+
Repository = "https://github.com/twardoch/camtasio"
|
|
42
|
+
|
|
43
|
+
[project.scripts]
|
|
44
|
+
camtasio = "camtasio.cli.app:main"
|
|
45
|
+
|
|
46
|
+
[project.optional-dependencies]
|
|
47
|
+
dev = [
|
|
48
|
+
"pytest>=7.4.0",
|
|
49
|
+
"pytest-cov>=4.1.0",
|
|
50
|
+
"ruff>=0.1.0",
|
|
51
|
+
"mypy>=1.0",
|
|
52
|
+
"twine>=4.0.0",
|
|
53
|
+
"build>=1.0.0",
|
|
54
|
+
"hypothesis>=6.0.0",
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
# this_file: camtasio/pyproject.toml
|
|
58
|
+
[build-system]
|
|
59
|
+
requires = ["hatch-vcs", "hatchling"]
|
|
60
|
+
build-backend = "hatchling.build"
|
|
61
|
+
|
|
62
|
+
[tool.coverage.run]
|
|
63
|
+
source_pkgs = ["camtasio"]
|
|
64
|
+
branch = true
|
|
65
|
+
parallel = true
|
|
66
|
+
|
|
67
|
+
[tool.coverage.paths]
|
|
68
|
+
camtasio = ["src/camtasio", "*/camtasio/src/camtasio"]
|
|
69
|
+
|
|
70
|
+
[tool.coverage.report]
|
|
71
|
+
exclude_lines = [
|
|
72
|
+
"no cov",
|
|
73
|
+
"if __name__ == .__main__.:",
|
|
74
|
+
"if TYPE_CHECKING:",
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
[tool.hatch.version]
|
|
78
|
+
source = "vcs"
|
|
79
|
+
|
|
80
|
+
[tool.hatch.build.hooks.vcs]
|
|
81
|
+
version-file = "src/camtasio/_version.py"
|
|
82
|
+
|
|
83
|
+
[tool.hatch.build.targets.sdist]
|
|
84
|
+
include = [
|
|
85
|
+
"/src",
|
|
86
|
+
]
|
|
87
|
+
|
|
88
|
+
[tool.hatch.build.targets.wheel]
|
|
89
|
+
packages = ["src/camtasio"]
|
|
90
|
+
|
|
91
|
+
[tool.mypy]
|
|
92
|
+
python_version = "3.11"
|
|
93
|
+
strict = true
|
|
94
|
+
warn_return_any = true
|
|
95
|
+
warn_unused_configs = true
|
|
96
|
+
show_error_codes = true
|
|
97
|
+
|
|
98
|
+
[tool.pytest.ini_options]
|
|
99
|
+
addopts = [
|
|
100
|
+
"-ra",
|
|
101
|
+
"--strict-markers",
|
|
102
|
+
"--cov=camtasio",
|
|
103
|
+
"--cov-report=term-missing",
|
|
104
|
+
"--cov-report=html",
|
|
105
|
+
]
|
|
106
|
+
pythonpath = ["src"]
|
|
107
|
+
testpaths = ["tests"]
|
|
108
|
+
|
|
109
|
+
[tool.ruff]
|
|
110
|
+
target-version = "py311"
|
|
111
|
+
line-length = 100
|
|
112
|
+
src = ["src", "tests"]
|
|
113
|
+
|
|
114
|
+
[tool.ruff.lint]
|
|
115
|
+
select = [
|
|
116
|
+
"E", # pycodestyle errors
|
|
117
|
+
"W", # pycodestyle warnings
|
|
118
|
+
"F", # pyflakes
|
|
119
|
+
"I", # isort
|
|
120
|
+
"B", # flake8-bugbear
|
|
121
|
+
"UP", # pyupgrade
|
|
122
|
+
"N", # pep8-naming
|
|
123
|
+
"RUF", # Ruff-specific rules
|
|
124
|
+
]
|
|
125
|
+
ignore = [
|
|
126
|
+
"E501", # line too long (handled by formatter)
|
|
127
|
+
]
|
|
128
|
+
|
|
129
|
+
[tool.ruff.lint.per-file-ignores]
|
|
130
|
+
"__init__.py" = ["F401"] # imported but unused
|
|
131
|
+
|
|
132
|
+
[tool.ruff.lint.isort]
|
|
133
|
+
known-first-party = ["camtasio"]
|
|
134
|
+
|