tdxvcon 0.1.0__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 (38) hide show
  1. tdxvcon-0.1.0/PKG-INFO +216 -0
  2. tdxvcon-0.1.0/README.md +197 -0
  3. tdxvcon-0.1.0/pyproject.toml +57 -0
  4. tdxvcon-0.1.0/setup.cfg +4 -0
  5. tdxvcon-0.1.0/src/tdxvcon.egg-info/PKG-INFO +216 -0
  6. tdxvcon-0.1.0/src/tdxvcon.egg-info/SOURCES.txt +36 -0
  7. tdxvcon-0.1.0/src/tdxvcon.egg-info/dependency_links.txt +1 -0
  8. tdxvcon-0.1.0/src/tdxvcon.egg-info/entry_points.txt +2 -0
  9. tdxvcon-0.1.0/src/tdxvcon.egg-info/top_level.txt +1 -0
  10. tdxvcon-0.1.0/src/vcon/__init__.py +73 -0
  11. tdxvcon-0.1.0/src/vcon/__main__.py +283 -0
  12. tdxvcon-0.1.0/src/vcon/argparse_ff.py +343 -0
  13. tdxvcon-0.1.0/src/vcon/cli.py +242 -0
  14. tdxvcon-0.1.0/src/vcon/codec_meta.py +326 -0
  15. tdxvcon-0.1.0/src/vcon/codec_probe.py +259 -0
  16. tdxvcon-0.1.0/src/vcon/config.py +168 -0
  17. tdxvcon-0.1.0/src/vcon/data/transcoder.toe +0 -0
  18. tdxvcon-0.1.0/src/vcon/driver.py +96 -0
  19. tdxvcon-0.1.0/src/vcon/errors.py +55 -0
  20. tdxvcon-0.1.0/src/vcon/events.py +124 -0
  21. tdxvcon-0.1.0/src/vcon/mock_driver.py +125 -0
  22. tdxvcon-0.1.0/src/vcon/models.py +140 -0
  23. tdxvcon-0.1.0/src/vcon/protocol.py +112 -0
  24. tdxvcon-0.1.0/src/vcon/queue_manager.py +259 -0
  25. tdxvcon-0.1.0/src/vcon/registry.py +298 -0
  26. tdxvcon-0.1.0/src/vcon/td_driver.py +273 -0
  27. tdxvcon-0.1.0/src/vcon/transcoder.py +153 -0
  28. tdxvcon-0.1.0/tests/test_argparse.py +136 -0
  29. tdxvcon-0.1.0/tests/test_cli.py +317 -0
  30. tdxvcon-0.1.0/tests/test_codec_probe.py +196 -0
  31. tdxvcon-0.1.0/tests/test_events.py +71 -0
  32. tdxvcon-0.1.0/tests/test_mock_driver.py +115 -0
  33. tdxvcon-0.1.0/tests/test_models.py +70 -0
  34. tdxvcon-0.1.0/tests/test_protocol.py +82 -0
  35. tdxvcon-0.1.0/tests/test_queue_manager.py +178 -0
  36. tdxvcon-0.1.0/tests/test_registry.py +394 -0
  37. tdxvcon-0.1.0/tests/test_td_driver.py +258 -0
  38. tdxvcon-0.1.0/tests/test_transcoder.py +143 -0
tdxvcon-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,216 @@
1
+ Metadata-Version: 2.4
2
+ Name: tdxvcon
3
+ Version: 0.1.0
4
+ Summary: GPU video transcoder front-end driving TouchDesigner's Movie File Out TOP (NotchLC, Hap, ProRes, ...) — FFmpeg-style CLI.
5
+ Author: JP Kelly
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/jpkelly/TDXvCon
8
+ Keywords: touchdesigner,notchlc,hap,prores,video,transcode,codec,top,moviefileout,mediamanagement
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Environment :: Console
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: MacOS
13
+ Classifier: Operating System :: Microsoft :: Windows
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Multimedia :: Video :: Conversion
16
+ Classifier: Topic :: Multimedia :: Video :: Non-Linear Editor
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+
20
+ # vCon
21
+
22
+ **GPU video transcoding, FFmpeg-style, powered by TouchDesigner.**
23
+
24
+ `vcon` is a cross-platform (macOS / Windows) command-line transcoder that
25
+ drives [TouchDesigner](https://derivative.ca/)'s GPU-accelerated
26
+ `Movie File Out TOP` to encode video into **every codec TouchDesigner
27
+ supports** — NotchLC, Hap, Apple ProRes, GoPro CineForm, H.264/H.265/AV1,
28
+ and more.
29
+
30
+ > **Naming:** the package installs as **`tdxvcon`** but the command is
31
+ > **`vcon`**. (The PyPI name `vcon` was already taken by an unrelated
32
+ > project.)
33
+
34
+ ## Why
35
+
36
+ The NotchLC encoder is not available in FFmpeg or any open encoder — it lives
37
+ in TouchDesigner (and other licensed products). vCon wraps TouchDesigner in a
38
+ headless, self-driving pipeline and exposes it through a familiar CLI, so
39
+ converting footage becomes:
40
+
41
+ ```bash
42
+ vcon -i input.mov -c notchlc out.mov
43
+ ```
44
+
45
+ ## Install
46
+
47
+ **Requirements:** TouchDesigner (macOS or Windows) and Python 3.10+.
48
+
49
+ ```bash
50
+ pipx install tdxvcon
51
+ ```
52
+
53
+ `pipx` creates an isolated environment automatically and puts `vcon` on your
54
+ PATH — **no virtualenv to create or activate, ever**. It is also the least
55
+ friction option on both macOS and Windows, and avoids app-store packaging
56
+ entirely.
57
+
58
+ Then verify:
59
+
60
+ ```bash
61
+ vcon -doctor
62
+ ```
63
+
64
+ You should see ✔ for the TouchDesigner binary, the transcoder toe, the toe's
65
+ freshness, and the controller probe. If no controller is running, `vcon`
66
+ launches TouchDesigner for you.
67
+
68
+ ### If you don't have pipx
69
+
70
+ ```bash
71
+ # macOS
72
+ brew install pipx && pipx ensurepath
73
+
74
+ # Windows (PowerShell)
75
+ py -m pip install --user pipx
76
+ py -m pipx ensurepath
77
+
78
+ # any platform, if pip is available
79
+ python3 -m pip install --user pipx && python3 -m pipx ensurepath
80
+ ```
81
+
82
+ `pipx ensurepath` is the one step people miss — it adds `~/.local/bin`
83
+ (macOS/Linux) or `%USERPROFILE%\.local\bin` (Windows) to PATH so the `vcon`
84
+ command is found. Open a new terminal afterwards.
85
+
86
+ > **Windows note:** TouchDesigner must be added to the firewall allow-list, or
87
+ > the controller's TCP port will be blocked.
88
+
89
+ TouchDesigner binary resolution order: `-td-path` flag → `VCON_TDPATH`
90
+ environment variable → config file → standard install locations
91
+ (`/Applications/TouchDesigner.app/...` on macOS,
92
+ `C:\Program Files\Derivative\TouchDesigner\bin\...` on Windows).
93
+
94
+ ## Usage
95
+
96
+ A codec is **required** for every output — like ffmpeg's `-c:v`, but with no
97
+ sensible default (NotchLC and H.264 are for opposite ends of a pipeline).
98
+
99
+ ```bash
100
+ # NotchLC — GPU mezzanine (the usual choice)
101
+ vcon -i input.mov -c notchlc -q optimal output.mov
102
+
103
+ # ProRes 4444 XQ — for an edit suite
104
+ vcon -i input.mov -c prores -t 4444xq output.mov
105
+
106
+ # Hap Q — for a media server
107
+ vcon -i input.mov -c hap -t hapq output.mov
108
+
109
+ # H.264 delivery file
110
+ vcon -i input.mov -c h264 output.mp4
111
+
112
+ # Multiple outputs in one TouchDesigner pass
113
+ vcon -i input.mov -c notchlc a.nlc.mov -c hap -t hapq b.hapq.mov
114
+
115
+ # Force overwrite, quiet output
116
+ vcon -y -loglevel error -i input.mov -c notchlc output.mov
117
+ ```
118
+
119
+ Run `vcon -h` for the full option list and the recommended codecs with their
120
+ subtypes. Run `vcon -codecs` for **every** codec TouchDesigner can encode
121
+ (including legacy ones), with quality levels, pixel formats and speed notes.
122
+
123
+ Both the help and the codec list are generated from
124
+ [`src/vcon/codec_meta.py`](src/vcon/codec_meta.py) at runtime, so they can
125
+ never drift out of sync with what actually works.
126
+
127
+ ### Flags
128
+
129
+ ```
130
+ -i FILE input file
131
+ -c CODEC codec — REQUIRED (see vcon -codecs)
132
+ -t SUBTYPE codec variant (prores: 422proxy, 422lt, 422, 422hq, 4444, 4444xq;
133
+ hap: hap, hapq, hapr, haphdr)
134
+ -q QUALITY quality level (notchlc: good, very-good, excellent, optimal, best)
135
+ -f FPS override output frame rate
136
+ -no-alpha force alpha off even if the source has it
137
+ -y / -n allow / forbid overwriting existing files
138
+ -loglevel LVL quiet | error | warning | info | debug
139
+ -nostats disable the ffmpeg-style progress line
140
+ -codecs list every available codec
141
+ -doctor diagnose the TouchDesigner setup
142
+ ```
143
+
144
+ ### Notes
145
+
146
+ - **Subtypes and pixel formats vary by codec.** Alpha is only available where
147
+ a format carries it — ProRes needs `-t 4444` or `4444xq`; Hap HDR has none.
148
+ vcon tells you when a combination isn't possible rather than silently
149
+ producing something different.
150
+ - **Outputs are much larger than the source.** NotchLC and ProRes are
151
+ mezzanine codecs (~5:1 against *raw*, not against H.264). A 26 GB H.264
152
+ source can become a 45 GB NotchLC or ProRes file. Check free space first.
153
+ - **vcon verifies every output.** It reads the codec back out of the finished
154
+ file and fails the job if TouchDesigner produced something else — the
155
+ failure mode that motivated this check was a "successful" encode that was
156
+ silently in the wrong codec.
157
+
158
+ ## Architecture
159
+
160
+ ```
161
+ CLI (renderer) ──subscribes──▶ vcon.core (headless, event-emitting)
162
+ │ QueueManager · CodecRegistry · Driver
163
+
164
+ Driver backend (mock | touchdesigner)
165
+ │ spawn + TCP JSON-lines
166
+
167
+ transcoder.toe (TouchDesigner, GPU encode)
168
+ ```
169
+
170
+ - The core is an importable library that emits typed events and never prints —
171
+ a future GUI or daemon is a new subscriber, not a refactor.
172
+ - The TouchDesigner project ships inside the pip package; users never open the
173
+ TD editor.
174
+ - A `--mock` driver runs the entire pipeline without TouchDesigner (used by the
175
+ test suite and useful for development on machines without TD).
176
+
177
+ ## Development
178
+
179
+ Working on vcon itself (not just using it):
180
+
181
+ ```bash
182
+ git clone … && cd vCon
183
+ python3 -m venv .venv && .venv/bin/pip install -e . pytest
184
+ .venv/bin/python -m pytest # 134 tests, no TouchDesigner needed
185
+ ```
186
+
187
+ ### Rebuilding the toe
188
+
189
+ You only rebuild `transcoder.toe` when `toe/vcon_controller.py` changes. See
190
+ [toe/PROTOCOL.md](toe/PROTOCOL.md) for the wire contract it must satisfy.
191
+
192
+ ```python
193
+ # Run in TouchDesigner's TEXTPORT — NOT the Python console, and never `import`
194
+ # (TD does not inject its builtins like `op` into imported modules).
195
+ exec(open('/path/to/vCon/toe/build_network.py', encoding='utf-8').read())
196
+ ```
197
+
198
+ ### Using a global install while developing
199
+
200
+ If `vcon` is installed with pipx but you are rebuilding the toe, the installed
201
+ command would otherwise use a *stale packaged copy*. Point it at your repo:
202
+
203
+ ```bash
204
+ export VCON_TOE=/path/to/vCon/src/vcon/data/transcoder.toe
205
+ ```
206
+
207
+ Or re-sync the packaged copy after a rebuild:
208
+
209
+ ```bash
210
+ ./scripts/sync-toe.sh # copies toe → installed package + refreshes pipx
211
+ ```
212
+
213
+ ## Status
214
+
215
+ Phase 1 — core skeleton, protocol, queue, codec registry, mock driver,
216
+ FFmpeg-style CLI, and tests. TouchDesigner integration lands in phase 2+.
@@ -0,0 +1,197 @@
1
+ # vCon
2
+
3
+ **GPU video transcoding, FFmpeg-style, powered by TouchDesigner.**
4
+
5
+ `vcon` is a cross-platform (macOS / Windows) command-line transcoder that
6
+ drives [TouchDesigner](https://derivative.ca/)'s GPU-accelerated
7
+ `Movie File Out TOP` to encode video into **every codec TouchDesigner
8
+ supports** — NotchLC, Hap, Apple ProRes, GoPro CineForm, H.264/H.265/AV1,
9
+ and more.
10
+
11
+ > **Naming:** the package installs as **`tdxvcon`** but the command is
12
+ > **`vcon`**. (The PyPI name `vcon` was already taken by an unrelated
13
+ > project.)
14
+
15
+ ## Why
16
+
17
+ The NotchLC encoder is not available in FFmpeg or any open encoder — it lives
18
+ in TouchDesigner (and other licensed products). vCon wraps TouchDesigner in a
19
+ headless, self-driving pipeline and exposes it through a familiar CLI, so
20
+ converting footage becomes:
21
+
22
+ ```bash
23
+ vcon -i input.mov -c notchlc out.mov
24
+ ```
25
+
26
+ ## Install
27
+
28
+ **Requirements:** TouchDesigner (macOS or Windows) and Python 3.10+.
29
+
30
+ ```bash
31
+ pipx install tdxvcon
32
+ ```
33
+
34
+ `pipx` creates an isolated environment automatically and puts `vcon` on your
35
+ PATH — **no virtualenv to create or activate, ever**. It is also the least
36
+ friction option on both macOS and Windows, and avoids app-store packaging
37
+ entirely.
38
+
39
+ Then verify:
40
+
41
+ ```bash
42
+ vcon -doctor
43
+ ```
44
+
45
+ You should see ✔ for the TouchDesigner binary, the transcoder toe, the toe's
46
+ freshness, and the controller probe. If no controller is running, `vcon`
47
+ launches TouchDesigner for you.
48
+
49
+ ### If you don't have pipx
50
+
51
+ ```bash
52
+ # macOS
53
+ brew install pipx && pipx ensurepath
54
+
55
+ # Windows (PowerShell)
56
+ py -m pip install --user pipx
57
+ py -m pipx ensurepath
58
+
59
+ # any platform, if pip is available
60
+ python3 -m pip install --user pipx && python3 -m pipx ensurepath
61
+ ```
62
+
63
+ `pipx ensurepath` is the one step people miss — it adds `~/.local/bin`
64
+ (macOS/Linux) or `%USERPROFILE%\.local\bin` (Windows) to PATH so the `vcon`
65
+ command is found. Open a new terminal afterwards.
66
+
67
+ > **Windows note:** TouchDesigner must be added to the firewall allow-list, or
68
+ > the controller's TCP port will be blocked.
69
+
70
+ TouchDesigner binary resolution order: `-td-path` flag → `VCON_TDPATH`
71
+ environment variable → config file → standard install locations
72
+ (`/Applications/TouchDesigner.app/...` on macOS,
73
+ `C:\Program Files\Derivative\TouchDesigner\bin\...` on Windows).
74
+
75
+ ## Usage
76
+
77
+ A codec is **required** for every output — like ffmpeg's `-c:v`, but with no
78
+ sensible default (NotchLC and H.264 are for opposite ends of a pipeline).
79
+
80
+ ```bash
81
+ # NotchLC — GPU mezzanine (the usual choice)
82
+ vcon -i input.mov -c notchlc -q optimal output.mov
83
+
84
+ # ProRes 4444 XQ — for an edit suite
85
+ vcon -i input.mov -c prores -t 4444xq output.mov
86
+
87
+ # Hap Q — for a media server
88
+ vcon -i input.mov -c hap -t hapq output.mov
89
+
90
+ # H.264 delivery file
91
+ vcon -i input.mov -c h264 output.mp4
92
+
93
+ # Multiple outputs in one TouchDesigner pass
94
+ vcon -i input.mov -c notchlc a.nlc.mov -c hap -t hapq b.hapq.mov
95
+
96
+ # Force overwrite, quiet output
97
+ vcon -y -loglevel error -i input.mov -c notchlc output.mov
98
+ ```
99
+
100
+ Run `vcon -h` for the full option list and the recommended codecs with their
101
+ subtypes. Run `vcon -codecs` for **every** codec TouchDesigner can encode
102
+ (including legacy ones), with quality levels, pixel formats and speed notes.
103
+
104
+ Both the help and the codec list are generated from
105
+ [`src/vcon/codec_meta.py`](src/vcon/codec_meta.py) at runtime, so they can
106
+ never drift out of sync with what actually works.
107
+
108
+ ### Flags
109
+
110
+ ```
111
+ -i FILE input file
112
+ -c CODEC codec — REQUIRED (see vcon -codecs)
113
+ -t SUBTYPE codec variant (prores: 422proxy, 422lt, 422, 422hq, 4444, 4444xq;
114
+ hap: hap, hapq, hapr, haphdr)
115
+ -q QUALITY quality level (notchlc: good, very-good, excellent, optimal, best)
116
+ -f FPS override output frame rate
117
+ -no-alpha force alpha off even if the source has it
118
+ -y / -n allow / forbid overwriting existing files
119
+ -loglevel LVL quiet | error | warning | info | debug
120
+ -nostats disable the ffmpeg-style progress line
121
+ -codecs list every available codec
122
+ -doctor diagnose the TouchDesigner setup
123
+ ```
124
+
125
+ ### Notes
126
+
127
+ - **Subtypes and pixel formats vary by codec.** Alpha is only available where
128
+ a format carries it — ProRes needs `-t 4444` or `4444xq`; Hap HDR has none.
129
+ vcon tells you when a combination isn't possible rather than silently
130
+ producing something different.
131
+ - **Outputs are much larger than the source.** NotchLC and ProRes are
132
+ mezzanine codecs (~5:1 against *raw*, not against H.264). A 26 GB H.264
133
+ source can become a 45 GB NotchLC or ProRes file. Check free space first.
134
+ - **vcon verifies every output.** It reads the codec back out of the finished
135
+ file and fails the job if TouchDesigner produced something else — the
136
+ failure mode that motivated this check was a "successful" encode that was
137
+ silently in the wrong codec.
138
+
139
+ ## Architecture
140
+
141
+ ```
142
+ CLI (renderer) ──subscribes──▶ vcon.core (headless, event-emitting)
143
+ │ QueueManager · CodecRegistry · Driver
144
+
145
+ Driver backend (mock | touchdesigner)
146
+ │ spawn + TCP JSON-lines
147
+
148
+ transcoder.toe (TouchDesigner, GPU encode)
149
+ ```
150
+
151
+ - The core is an importable library that emits typed events and never prints —
152
+ a future GUI or daemon is a new subscriber, not a refactor.
153
+ - The TouchDesigner project ships inside the pip package; users never open the
154
+ TD editor.
155
+ - A `--mock` driver runs the entire pipeline without TouchDesigner (used by the
156
+ test suite and useful for development on machines without TD).
157
+
158
+ ## Development
159
+
160
+ Working on vcon itself (not just using it):
161
+
162
+ ```bash
163
+ git clone … && cd vCon
164
+ python3 -m venv .venv && .venv/bin/pip install -e . pytest
165
+ .venv/bin/python -m pytest # 134 tests, no TouchDesigner needed
166
+ ```
167
+
168
+ ### Rebuilding the toe
169
+
170
+ You only rebuild `transcoder.toe` when `toe/vcon_controller.py` changes. See
171
+ [toe/PROTOCOL.md](toe/PROTOCOL.md) for the wire contract it must satisfy.
172
+
173
+ ```python
174
+ # Run in TouchDesigner's TEXTPORT — NOT the Python console, and never `import`
175
+ # (TD does not inject its builtins like `op` into imported modules).
176
+ exec(open('/path/to/vCon/toe/build_network.py', encoding='utf-8').read())
177
+ ```
178
+
179
+ ### Using a global install while developing
180
+
181
+ If `vcon` is installed with pipx but you are rebuilding the toe, the installed
182
+ command would otherwise use a *stale packaged copy*. Point it at your repo:
183
+
184
+ ```bash
185
+ export VCON_TOE=/path/to/vCon/src/vcon/data/transcoder.toe
186
+ ```
187
+
188
+ Or re-sync the packaged copy after a rebuild:
189
+
190
+ ```bash
191
+ ./scripts/sync-toe.sh # copies toe → installed package + refreshes pipx
192
+ ```
193
+
194
+ ## Status
195
+
196
+ Phase 1 — core skeleton, protocol, queue, codec registry, mock driver,
197
+ FFmpeg-style CLI, and tests. TouchDesigner integration lands in phase 2+.
@@ -0,0 +1,57 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ # Distribution name. The PyPI name "vcon" is taken by an unrelated package,
7
+ # so the distribution is "tdxvcon". The IMPORT name stays "vcon" and the
8
+ # command stays "vcon" — short to type, unambiguous to install:
9
+ # pipx install tdxvcon
10
+ # vcon -i in.mov -c notchlc out.mov
11
+ name = "tdxvcon"
12
+ version = "0.1.0"
13
+ description = "GPU video transcoder front-end driving TouchDesigner's Movie File Out TOP (NotchLC, Hap, ProRes, ...) — FFmpeg-style CLI."
14
+ readme = "README.md"
15
+ requires-python = ">=3.10"
16
+ license = { text = "MIT" }
17
+ authors = [{ name = "JP Kelly" }]
18
+ dependencies = []
19
+ keywords = [
20
+ "touchdesigner", "notchlc", "hap", "prores", "video", "transcode",
21
+ "codec", "top", "moviefileout", "mediamanagement",
22
+ ]
23
+ classifiers = [
24
+ "Development Status :: 3 - Alpha",
25
+ "Environment :: Console",
26
+ "License :: OSI Approved :: MIT License",
27
+ "Operating System :: MacOS",
28
+ "Operating System :: Microsoft :: Windows",
29
+ "Programming Language :: Python :: 3",
30
+ "Topic :: Multimedia :: Video :: Conversion",
31
+ "Topic :: Multimedia :: Video :: Non-Linear Editor",
32
+ ]
33
+
34
+ [project.scripts]
35
+ vcon = "vcon.__main__:main"
36
+
37
+ [project.urls]
38
+ Homepage = "https://github.com/jpkelly/TDXvCon"
39
+
40
+ [tool.setuptools.packages.find]
41
+ where = ["src"]
42
+
43
+ [tool.setuptools.package-data]
44
+ # Exact filename — a bare data/*.toe glob would also ship TD's versioned
45
+ # backups (transcoder.1.toe etc.) that TD writes next to the toe on save.
46
+ vcon = ["data/transcoder.toe"]
47
+
48
+ [tool.pytest.ini_options]
49
+ testpaths = ["tests"]
50
+ addopts = "-q"
51
+
52
+ [tool.ruff]
53
+ line-length = 100
54
+ target-version = "py310"
55
+
56
+ [tool.ruff.lint]
57
+ select = ["E", "F", "I", "UP"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,216 @@
1
+ Metadata-Version: 2.4
2
+ Name: tdxvcon
3
+ Version: 0.1.0
4
+ Summary: GPU video transcoder front-end driving TouchDesigner's Movie File Out TOP (NotchLC, Hap, ProRes, ...) — FFmpeg-style CLI.
5
+ Author: JP Kelly
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/jpkelly/TDXvCon
8
+ Keywords: touchdesigner,notchlc,hap,prores,video,transcode,codec,top,moviefileout,mediamanagement
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Environment :: Console
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: MacOS
13
+ Classifier: Operating System :: Microsoft :: Windows
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Multimedia :: Video :: Conversion
16
+ Classifier: Topic :: Multimedia :: Video :: Non-Linear Editor
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+
20
+ # vCon
21
+
22
+ **GPU video transcoding, FFmpeg-style, powered by TouchDesigner.**
23
+
24
+ `vcon` is a cross-platform (macOS / Windows) command-line transcoder that
25
+ drives [TouchDesigner](https://derivative.ca/)'s GPU-accelerated
26
+ `Movie File Out TOP` to encode video into **every codec TouchDesigner
27
+ supports** — NotchLC, Hap, Apple ProRes, GoPro CineForm, H.264/H.265/AV1,
28
+ and more.
29
+
30
+ > **Naming:** the package installs as **`tdxvcon`** but the command is
31
+ > **`vcon`**. (The PyPI name `vcon` was already taken by an unrelated
32
+ > project.)
33
+
34
+ ## Why
35
+
36
+ The NotchLC encoder is not available in FFmpeg or any open encoder — it lives
37
+ in TouchDesigner (and other licensed products). vCon wraps TouchDesigner in a
38
+ headless, self-driving pipeline and exposes it through a familiar CLI, so
39
+ converting footage becomes:
40
+
41
+ ```bash
42
+ vcon -i input.mov -c notchlc out.mov
43
+ ```
44
+
45
+ ## Install
46
+
47
+ **Requirements:** TouchDesigner (macOS or Windows) and Python 3.10+.
48
+
49
+ ```bash
50
+ pipx install tdxvcon
51
+ ```
52
+
53
+ `pipx` creates an isolated environment automatically and puts `vcon` on your
54
+ PATH — **no virtualenv to create or activate, ever**. It is also the least
55
+ friction option on both macOS and Windows, and avoids app-store packaging
56
+ entirely.
57
+
58
+ Then verify:
59
+
60
+ ```bash
61
+ vcon -doctor
62
+ ```
63
+
64
+ You should see ✔ for the TouchDesigner binary, the transcoder toe, the toe's
65
+ freshness, and the controller probe. If no controller is running, `vcon`
66
+ launches TouchDesigner for you.
67
+
68
+ ### If you don't have pipx
69
+
70
+ ```bash
71
+ # macOS
72
+ brew install pipx && pipx ensurepath
73
+
74
+ # Windows (PowerShell)
75
+ py -m pip install --user pipx
76
+ py -m pipx ensurepath
77
+
78
+ # any platform, if pip is available
79
+ python3 -m pip install --user pipx && python3 -m pipx ensurepath
80
+ ```
81
+
82
+ `pipx ensurepath` is the one step people miss — it adds `~/.local/bin`
83
+ (macOS/Linux) or `%USERPROFILE%\.local\bin` (Windows) to PATH so the `vcon`
84
+ command is found. Open a new terminal afterwards.
85
+
86
+ > **Windows note:** TouchDesigner must be added to the firewall allow-list, or
87
+ > the controller's TCP port will be blocked.
88
+
89
+ TouchDesigner binary resolution order: `-td-path` flag → `VCON_TDPATH`
90
+ environment variable → config file → standard install locations
91
+ (`/Applications/TouchDesigner.app/...` on macOS,
92
+ `C:\Program Files\Derivative\TouchDesigner\bin\...` on Windows).
93
+
94
+ ## Usage
95
+
96
+ A codec is **required** for every output — like ffmpeg's `-c:v`, but with no
97
+ sensible default (NotchLC and H.264 are for opposite ends of a pipeline).
98
+
99
+ ```bash
100
+ # NotchLC — GPU mezzanine (the usual choice)
101
+ vcon -i input.mov -c notchlc -q optimal output.mov
102
+
103
+ # ProRes 4444 XQ — for an edit suite
104
+ vcon -i input.mov -c prores -t 4444xq output.mov
105
+
106
+ # Hap Q — for a media server
107
+ vcon -i input.mov -c hap -t hapq output.mov
108
+
109
+ # H.264 delivery file
110
+ vcon -i input.mov -c h264 output.mp4
111
+
112
+ # Multiple outputs in one TouchDesigner pass
113
+ vcon -i input.mov -c notchlc a.nlc.mov -c hap -t hapq b.hapq.mov
114
+
115
+ # Force overwrite, quiet output
116
+ vcon -y -loglevel error -i input.mov -c notchlc output.mov
117
+ ```
118
+
119
+ Run `vcon -h` for the full option list and the recommended codecs with their
120
+ subtypes. Run `vcon -codecs` for **every** codec TouchDesigner can encode
121
+ (including legacy ones), with quality levels, pixel formats and speed notes.
122
+
123
+ Both the help and the codec list are generated from
124
+ [`src/vcon/codec_meta.py`](src/vcon/codec_meta.py) at runtime, so they can
125
+ never drift out of sync with what actually works.
126
+
127
+ ### Flags
128
+
129
+ ```
130
+ -i FILE input file
131
+ -c CODEC codec — REQUIRED (see vcon -codecs)
132
+ -t SUBTYPE codec variant (prores: 422proxy, 422lt, 422, 422hq, 4444, 4444xq;
133
+ hap: hap, hapq, hapr, haphdr)
134
+ -q QUALITY quality level (notchlc: good, very-good, excellent, optimal, best)
135
+ -f FPS override output frame rate
136
+ -no-alpha force alpha off even if the source has it
137
+ -y / -n allow / forbid overwriting existing files
138
+ -loglevel LVL quiet | error | warning | info | debug
139
+ -nostats disable the ffmpeg-style progress line
140
+ -codecs list every available codec
141
+ -doctor diagnose the TouchDesigner setup
142
+ ```
143
+
144
+ ### Notes
145
+
146
+ - **Subtypes and pixel formats vary by codec.** Alpha is only available where
147
+ a format carries it — ProRes needs `-t 4444` or `4444xq`; Hap HDR has none.
148
+ vcon tells you when a combination isn't possible rather than silently
149
+ producing something different.
150
+ - **Outputs are much larger than the source.** NotchLC and ProRes are
151
+ mezzanine codecs (~5:1 against *raw*, not against H.264). A 26 GB H.264
152
+ source can become a 45 GB NotchLC or ProRes file. Check free space first.
153
+ - **vcon verifies every output.** It reads the codec back out of the finished
154
+ file and fails the job if TouchDesigner produced something else — the
155
+ failure mode that motivated this check was a "successful" encode that was
156
+ silently in the wrong codec.
157
+
158
+ ## Architecture
159
+
160
+ ```
161
+ CLI (renderer) ──subscribes──▶ vcon.core (headless, event-emitting)
162
+ │ QueueManager · CodecRegistry · Driver
163
+
164
+ Driver backend (mock | touchdesigner)
165
+ │ spawn + TCP JSON-lines
166
+
167
+ transcoder.toe (TouchDesigner, GPU encode)
168
+ ```
169
+
170
+ - The core is an importable library that emits typed events and never prints —
171
+ a future GUI or daemon is a new subscriber, not a refactor.
172
+ - The TouchDesigner project ships inside the pip package; users never open the
173
+ TD editor.
174
+ - A `--mock` driver runs the entire pipeline without TouchDesigner (used by the
175
+ test suite and useful for development on machines without TD).
176
+
177
+ ## Development
178
+
179
+ Working on vcon itself (not just using it):
180
+
181
+ ```bash
182
+ git clone … && cd vCon
183
+ python3 -m venv .venv && .venv/bin/pip install -e . pytest
184
+ .venv/bin/python -m pytest # 134 tests, no TouchDesigner needed
185
+ ```
186
+
187
+ ### Rebuilding the toe
188
+
189
+ You only rebuild `transcoder.toe` when `toe/vcon_controller.py` changes. See
190
+ [toe/PROTOCOL.md](toe/PROTOCOL.md) for the wire contract it must satisfy.
191
+
192
+ ```python
193
+ # Run in TouchDesigner's TEXTPORT — NOT the Python console, and never `import`
194
+ # (TD does not inject its builtins like `op` into imported modules).
195
+ exec(open('/path/to/vCon/toe/build_network.py', encoding='utf-8').read())
196
+ ```
197
+
198
+ ### Using a global install while developing
199
+
200
+ If `vcon` is installed with pipx but you are rebuilding the toe, the installed
201
+ command would otherwise use a *stale packaged copy*. Point it at your repo:
202
+
203
+ ```bash
204
+ export VCON_TOE=/path/to/vCon/src/vcon/data/transcoder.toe
205
+ ```
206
+
207
+ Or re-sync the packaged copy after a rebuild:
208
+
209
+ ```bash
210
+ ./scripts/sync-toe.sh # copies toe → installed package + refreshes pipx
211
+ ```
212
+
213
+ ## Status
214
+
215
+ Phase 1 — core skeleton, protocol, queue, codec registry, mock driver,
216
+ FFmpeg-style CLI, and tests. TouchDesigner integration lands in phase 2+.