GStreamer Daemon - Interacting with Pipelines: Difference between revisions

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


== API Summary ==
== API Summary ==
{{#!:
 
{| class="wikitable"
{{#!
|-
{{{!}} class="wikitable"
{{!}}-
! High Level Command !! Low Level CRUD !! Description
! High Level Command !! Low Level CRUD !! Description
|-
{{!}}-
| pipeline_create name description || create /pipelines name description || Creates a new pipeline named after name using the description gst-launch syntax.
{{!}} pipeline_create name description {{!}}{{!}} create /pipelines name description {{!}}{{!}} Creates a new pipeline named after name using the description gst-launch syntax.
|-
{{!}}-
| pipeline_play name || update /pipelines/name/state playing || Puts the pipeline named name in the PLAYING state.
{{!}} pipeline_play name {{!}}{{!}} update /pipelines/name/state playing {{!}}{{!}} Puts the pipeline named name in the PLAYING state.
|-
{{!}}-
| pipeline_pause name || update /pipelines/name/state paused || Puts the pipeline named name in the PAUSED state.
{{!}} pipeline_pause name {{!}}{{!}} update /pipelines/name/state paused {{!}}{{!}} Puts the pipeline named name in the PAUSED state.
|-
{{!}}-
| pipeline_stop name || update /pipelines/name/state null || Puts the pipeline named name in the NULL state.
{{!}} pipeline_stop name {{!}}{{!}} update /pipelines/name/state null {{!}}{{!}} Puts the pipeline named name in the NULL state.
|-
{{!}}-
| pipeline_delete name || delete /pipelines/ name || Deletes the pipeline named name, stopping it first if necessary.
{{!}} pipeline_delete name {{!}}{{!}} delete /pipelines/ name {{!}}{{!}} Deletes the pipeline named name, stopping it first if necessary.
|-
{{!}}-
| list_pipelines || read /pipelines || List the pipelines in the session.
{{!}} list_pipelines {{!}}{{!}} read /pipelines {{!}}{{!}} List the pipelines in the session.
|}
{{!}}}
}}
}}
}}

Revision as of 23:33, 19 May 2017


Quick Start Guide

Home

Modifying Element Properties


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

API Summary

{{#!

High Level Command Low Level CRUD Description
pipeline_create name description create /pipelines name description Creates a new pipeline named after name using the description gst-launch syntax.
pipeline_play name update /pipelines/name/state playing Puts the pipeline named name in the PLAYING state.
pipeline_pause name update /pipelines/name/state paused Puts the pipeline named name in the PAUSED state.
pipeline_stop name update /pipelines/name/state null Puts the pipeline named name in the NULL state.
pipeline_delete name delete /pipelines/ name Deletes the pipeline named name, stopping it first if necessary.
list_pipelines read /pipelines List the pipelines in the session.

}}



Quick Start Guide

Home

Modifying Element Properties