GStreamer Daemon - Interacting with Pipelines: Difference between revisions

From RidgeRun Developer Wiki
No edit summary
No edit summary
Line 111: Line 111:


== Delete Pipelines ==
== Delete Pipelines ==
In order to delete a pipeline use the following command:
  <b>pipeline_delete <i>name</i></b>
      Deletes the pipeline named <i>name</i>, stopping it first if necessary.
For example:
<br>&rArr; ''Gstd Commands:''
<syntaxhighlight lang="bash" line="line" style="background-color:lavender">
pipeline_delete p1
</syntaxhighlight>
would stop the ''p1'' pipeline and delete it afterwards.
The '''pipeline_delete''' command will typically fail for any of the following:
* No name was given
* No pipeline with the given name was found
* A pipeline specific error when stopping the pipeline.
Alternatively, a pipeline can be deleted using the [[Gstd-1.0 - Low Level Implementation for Applicaiton|low level CRUD syntax]]:
<br>&rArr; ''Gstd Commands:''
<syntaxhighlight lang="bash" line="line" style="background-color:lavender">
delete /pipelines p1
</syntaxhighlight>


== List Pipelines ==
== List Pipelines ==
In order to list the existing pipelines use the following command:
  <b>list_pipelines</b>
      List the pipelines in the session.
For example:
<br>&rArr; ''Gstd Commands:''
<syntaxhighlight lang="bash" line="line" style="background-color:lavender">
list_pipelines
</syntaxhighlight>
would list the pipelines in the current session, if any.
Alternatively, the list of pipelines can be found by using the [[Gstd-1.0 - Low Level Implementation for Applicaiton|low level CRUD syntax]]:
<br>&rArr; ''Gstd Commands:''
<syntaxhighlight lang="bash" line="line" style="background-color:lavender">
read /pipelines
</syntaxhighlight>
}}
}}

Revision as of 22:12, 19 May 2017



Home


This wiki describes the basics on how to interact with GStreamer pipelines. Specifically, how to create new pipelines, change their state, list existing pipelines and finally destroy them. You'll find that the family of commands used to interact with pipelines are prefixed with pipeline_<action>.

Create Pipelines

In order to create a pipeline use the following command:

 pipeline_create name description
     Creates a new pipeline named after name using the description gst-launch syntax.

For example:
Gstd Commands:

pipeline_create p1 videotestsrc ! autovideosink
pipeline_create p2 playbin
pipeline_create p3 mpegtsmux name=mux videotestsrc ! x264enc ! mux. audiotestsrc ! avenc_aac ! mux. mux. ! filesink location=test.ts

would create respectively:

  1. A pipeline named p1 consisting on a simple videotestsrc display
  2. A pipeline named p2 consisting on a single element (playbin), which is enough to do playback of a file
  3. A pipeline named p3 consisting on an audio+video transport stream video recording.

The pipeline_create command will typically fail for any of the following:

  • No name was given
  • No description was given
  • A pipeline with that name already exists
  • The description has a syntax error (typo, missing element, etc...)

Alternatively, a pipeline can be created using the low level CRUD syntax:
Gstd Commands:

create /pipelines p1 videotestsrc ! autovideosink
create /pipelines p2 playbin
create /pipelines p3 mpegtsmux name=mux videotestsrc ! x264enc ! mux. audiotestsrc ! avenc_aac ! mux. mux. ! filesink location=test.ts

Play Pipelines

In order to play a pipeline use the following command:

 pipeline_play name
     Puts the pipeline named name in the PLAYING state.

For example:
Gstd Commands:

pipeline_play p1

would put the p1 pipeline into the playing state.

The pipeline_play command will typically fail for any of the following:

  • No name was given
  • No pipeline with the given name was found
  • A pipeline specific error

Alternatively, a pipeline can be played using the low level CRUD syntax:
Gstd Commands:

update /pipelines/p1/state playing

Pause Pipelines

In order to pause a pipeline use the following command:

 pipeline_pause name
     Puts the pipeline named name in the PAUSED state.

For example:
Gstd Commands:

pipeline_pause p1

would put the p1 pipeline into the paused state.

The pipeline_pause command will typically fail for any of the following:

  • No name was given
  • No pipeline with the given name was found
  • A pipeline specific error

Alternatively, a pipeline can be paused using the low level CRUD syntax:
Gstd Commands:

update /pipelines/p1/state paused

Stop Pipelines

In order to stop a pipeline use the following command:

 pipeline_stop name
     Puts the pipeline named name in the NULL state.

For example:
Gstd Commands:

pipeline_stop p1

would put the p1 pipeline into the null state.

The pipeline_stop command will typically fail for any of the following:

  • No name was given
  • No pipeline with the given name was found
  • A pipeline specific error

Alternatively, a pipeline can be stopped using the low level CRUD syntax:
Gstd Commands:

update /pipelines/p1/state null

Delete Pipelines

In order to delete a pipeline use the following command:

 pipeline_delete name
     Deletes the pipeline named name, stopping it first if necessary.

For example:
Gstd Commands:

pipeline_delete p1

would stop the p1 pipeline and delete it afterwards.

The pipeline_delete command will typically fail for any of the following:

  • No name was given
  • No pipeline with the given name was found
  • A pipeline specific error when stopping the pipeline.

Alternatively, a pipeline can be deleted using the low level CRUD syntax:
Gstd Commands:

delete /pipelines p1

List Pipelines

In order to list the existing pipelines use the following command:

 list_pipelines
     List the pipelines in the session.

For example:
Gstd Commands:

list_pipelines

would list the pipelines in the current session, if any.

Alternatively, the list of pipelines can be found by using the low level CRUD syntax:
Gstd Commands:

read /pipelines





Home