You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The plugin supports building multiple variants that can coexist in the same GStreamer installation. This is useful when you need to run different models or configurations in the same pipeline.
265
+
266
+
**Why PLUGIN_VARIANT?**
267
+
268
+
GStreamer identifies plugins by three key attributes:
269
+
1.**Library filename**: The shared library file that contains the plugin
270
+
2.**Plugin name**: The internal plugin identifier registered with GStreamer
271
+
3.**Element names**: The names of individual elements (e.g., `edgeimpulsevideoinfer`)
272
+
273
+
To allow multiple plugin builds to coexist, each variant must have unique values for all three. The `PLUGIN_VARIANT` environment variable automatically handles this by:
274
+
275
+
-**Library naming**: After building, use the `rename-library.sh` script to rename the output library from `libgstedgeimpulse.{dylib,so,dll}` to `libgstedgeimpulse_{variant}.{dylib,so,dll}`
276
+
-**Plugin naming**: The plugin name becomes `gst-plugins-edgeimpulse_{variant}` instead of just `gst-plugins-edgeimpulse`
277
+
-**Element naming**: All elements are automatically suffixed with `_{variant}` (e.g., `edgeimpulsevideoinfer_variantX`, `edgeimpulseaudioinfer_variantX`, etc.)
278
+
279
+
**Usage:**
280
+
281
+
1.**Build with a variant:**
282
+
```bash
283
+
# Build variant "variantX"
284
+
PLUGIN_VARIANT=variantX cargo build --release
285
+
286
+
# After build completes, rename the library
287
+
PLUGIN_VARIANT=variantX ./rename-library.sh
288
+
```
289
+
290
+
2.**Build multiple variants:**
291
+
```bash
292
+
# Build first variant
293
+
PLUGIN_VARIANT=variantX \
294
+
EI_MODEL=~/Downloads/model-a \
295
+
EI_ENGINE=tflite \
296
+
USE_FULL_TFLITE=1 \
297
+
cargo build --release
298
+
PLUGIN_VARIANT=variantX ./rename-library.sh
299
+
300
+
# Build second variant (with different model or configuration)
301
+
PLUGIN_VARIANT=variantY \
302
+
EI_MODEL=~/Downloads/model-b \
303
+
EI_ENGINE=tflite \
304
+
USE_FULL_TFLITE=1 \
305
+
cargo build --release
306
+
PLUGIN_VARIANT=variantY ./rename-library.sh
307
+
```
308
+
309
+
3.**Use both variants in the same pipeline:**
310
+
```bash
311
+
# Make sure both libraries are in GST_PLUGIN_PATH
312
+
export GST_PLUGIN_PATH="$(pwd)/target/release"
313
+
314
+
# Use elements from both variants
315
+
gst-launch-1.0 \
316
+
videotestsrc ! \
317
+
edgeimpulsevideoinfer_variantX ! \
318
+
edgeimpulseoverlay_variantX ! \
319
+
queue ! \
320
+
edgeimpulsevideoinfer_variantY ! \
321
+
edgeimpulseoverlay_variantY ! \
322
+
autovideosink
323
+
```
324
+
325
+
**Technical Details:**
326
+
327
+
- The `PLUGIN_VARIANT` environment variable must be set during both the build and rename steps
328
+
- The `rename-library.sh` script renames the output library from `libgstedgeimpulse.{dylib,so,dll}` to `libgstedgeimpulse_{variant}.{dylib,so,dll}`
329
+
- Each variant produces a uniquely named library file, allowing GStreamer to load multiple variants simultaneously
330
+
- Element names include the variant suffix, preventing naming conflicts when multiple variants are loaded
0 commit comments