mirror of
https://github.com/m1k1o/neko.git
synced 2026-11-03 00:11:48 -06:00
fix(capture): accept a bare pipeline string in video pipelines entries (#701)
* fix(capture): accept a bare pipeline string in video pipelines entries
NEKO_CAPTURE_VIDEO_PIPELINES expects every entry to be a full pipeline config
object, but the singular capture.video.pipeline option trains people to write
the whole pipeline as a plain string, so a dict like {"high": "ximagesrc ...
! appsink"} failed to unmarshal, the error got reduced to a warn and neko fell
back to the default vp8 pipeline silently, also overriding a directly set
video codec
the json string hook decodes the env value into a generic map, so the shorthand
is restored in the mapstructure chain: a string value for an entry now becomes
VideoConfig{GstPipeline: ...}, the same shape the single pipeline option
produces, object entries are untouched
the new config test drives the production env flow (Init + Set) and fails on
master with the same two warnings the reporter saw
Fixes #689
* feat(capture): add shorthand support for pipeline entries as plain strings.
---------
Co-authored-by: Miroslav Šedivý <sedivy.miro@gmail.com>
This commit is contained in:
committed by
GitHub
parent
371f5c2c7b
commit
73b9d71b0d
@@ -165,6 +165,18 @@ capture:
|
||||
gst_pipeline: "<gstreamer_pipeline>"
|
||||
```
|
||||
|
||||
As a shorthand, a pipeline entry can also be a plain string instead of an object, which is equivalent to setting only <Opt id="video.pipelines.gst_pipeline" />:
|
||||
|
||||
```yaml title="config.yaml"
|
||||
capture:
|
||||
video:
|
||||
...
|
||||
pipelines:
|
||||
<pipeline_id>: "<gstreamer_pipeline>"
|
||||
```
|
||||
|
||||
This shorthand also works when defining <Opt id="video.pipelines" /> via the `NEKO_CAPTURE_VIDEO_PIPELINES` environment variable as a JSON object, e.g. `NEKO_CAPTURE_VIDEO_PIPELINES='{"<pipeline_id>":"<gstreamer_pipeline>"}'`.
|
||||
|
||||
Since now you have to define the whole pipeline, you need to specify the src element to get the video frames and the sink element to send the encoded video frames to neko. In your pipeline, you can use `{display}` as a placeholder for the display name that will be replaced by the actual display name at runtime. You need to set the `name` property of the sink element to `appsink` so that neko can capture the video frames.
|
||||
|
||||
Your typical pipeline string would look like this:
|
||||
|
||||
Reference in New Issue
Block a user