Skip to content

feat: add a GStreamer runner to launch pipelines#323

Open
ylatuya wants to merge 1 commit intomasterfrom
gst-runner
Open

feat: add a GStreamer runner to launch pipelines#323
ylatuya wants to merge 1 commit intomasterfrom
gst-runner

Conversation

@ylatuya
Copy link
Copy Markdown
Contributor

@ylatuya ylatuya commented Dec 10, 2025

Add a new GStreamer runner to launch pipelines that gives use more control in errors and allow us to differentiate for example between a pipelines miss-configuration or a format that's not supported.

This a first iteration in order to support #319

@dabrain34
Copy link
Copy Markdown
Contributor

dabrain34 commented Dec 10, 2025

I would put the gstreamer cffi in decoders as it should be not located in fluster base. IMHO fluster is GStreamer agnostic.

@ylatuya
Copy link
Copy Markdown
Contributor Author

ylatuya commented Dec 10, 2025

I would put the gstreamer cffi in decoders as it should not be located in the fluster base. IMHO, fluster is GStreamer agnostic.

The fluster.gstreamer namespace contains generic helpers around GStreamer that are not specific to decoders, that's why I decided to leave them under fluster.gstreamer instead of fluster.decoders.gstreamer. They can be used by a GStreamer decoder or a future GStreamer encoder.

@rsanchez87
Copy link
Copy Markdown
Contributor

rsanchez87 commented Mar 31, 2026

An important thing I'm seeing is that in l51 of pyproject.toml, it would be necessary to add fluster.gstreamer to the package list:

packages = ["fluster", "fluster.decoders", "fluster.gstreamer"]

cc: @ylatuya

pipeline = self.gen_pipeline(input_filepath, output_filepath, output_format)
run_command(shlex.split(pipeline), timeout=timeout, verbose=verbose)
result = run_pipeline(pipeline, timeout=timeout, verbose=verbose)
if result.returncode != 0:
Copy link
Copy Markdown
Contributor

@rsanchez87 rsanchez87 Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same of above

command.append("-m")
data = run_command_with_output(command, timeout=timeout, verbose=verbose).splitlines()
result = run_pipeline(pipeline, timeout=timeout, verbose=verbose, print_messages=True)
if result.returncode != 0:
Copy link
Copy Markdown
Contributor

@rsanchez87 rsanchez87 Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about adding all the types to decode() and check() ?, currently ignore the structured exit codes:

            if result.returncode == GstExitCode.TIMEOUT:
                raise subprocess.TimeoutExpired(pipeline, timeout)
            if result.returncode == GstExitCode.INIT_ERROR:
                raise NotImplementedError(f"Pipeline not supported: {self.decoder_bin}")
            if result.returncode != GstExitCode.SUCCESS:

Add a new GStreamer runner to launch pipelines that gives use more
control in errors and allow us to differentiate for example between a
pipelines miss-configuration or a format that's not supported.
@rsanchez87
Copy link
Copy Markdown
Contributor

rsanchez87 commented Mar 31, 2026

Something to keep in mind... now that #319 uses exit code 69 for "not supported" (matching the gst-launch upstream change), the runner here should return 69 also instead of INIT_ERROR = 2 for unsupported formats.

Otherwise the NotSupportedError path in utils.py will not be activated, since it only checks 69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants