How to use GStreamer Daemon to demonstrate trickplay

From RidgeRun Developer Wiki

Warning

This GStreamer Daemon version is deprecated. A new version was written from scratch on C in 2017 to take advantage of the GStreamer 1.x API and can be found here:

Gstd-1.x GitHub Project

Gstd-1.x Documentation Wiki

If you are interested on the old vala release please continue reading this page. Otherwise please use the new documentation.

Overview:

This WIKI explains how to use GStreamer Daemon to demonstrate trickplay.

References:

https://developer.ridgerun.com/wiki/index.php/Gstd
https://developer.ridgerun.com/wiki/index.php/How_to_send_Dbus_messages_manually
https://developer.ridgerun.com/wiki/index.php/GStreamer_Debugging_Using_GDB

To start the GStd daemon:

/etc/init.d/gstd start 
To test GStd Daemon running status:
ps | grep gstd 

Please try below commands to test trickplay:

GStd command to create a new pipeline and returns the dbus-path to access it:

/ # gst-client create "filesrc location=test1.mp4 ! qtdemux ! queue ! dmaidec_h264 numOutputBufs=12 ! priority nice=-10 ! queue ! priority nice=-10 ! dmaiperf ! \
TIDmaiVideoSink enable-last-buffer=false accelFrameCopy=true videoOutput=DVI videoStd=720P_60"


GStd command to set the active pipeline to play state:

/ # gst-client -p /com/ridgerun/gstreamer/gstd/pipe0 play 

GStd command to set the active pipeline to pause state:

/ # gst-client -p /com/ridgerun/gstreamer/gstd/pipe0 pause 


GStd command to move the current playing position to a new 0 th frame position:

/ # gst-client -p /com/ridgerun/gstreamer/gstd/pipe0 seek 0 


GStd command to set the active pipeline to play state again:

/ # gst-client -p /com/ridgerun/gstreamer/gstd/pipe0 play 


GStd command to move the current playing position to a new 10000 th frame position:

/ # gst-client -p /com/ridgerun/gstreamer/gstd/pipe0 seek 10000 

GStd command to move the current playing position to a new 100000 th frame position:

/ # gst-client -p /com/ridgerun/gstreamer/gstd/pipe0 seek 100000 


GStd Speed commands: Speed command changes playback rate:

speed: Changes playback rate:

  • rate>1.0: fast-forward playback,
  • rate<1.0: slow-forward playback,
  • rate=1.0: normal speed.

Negative rate causes reverse playback.

/ # gst-client -p /com/ridgerun/gstreamer/gstd/pipe0 speed 2 
/ # gst-client -p /com/ridgerun/gstreamer/gstd/pipe0 speed 0.5 
/ # gst-client -p /com/ridgerun/gstreamer/gstd/pipe0 speed 4 
/ # gst-client -p /com/ridgerun/gstreamer/gstd/pipe0 speed 1 


GStd 'set' command to set the pipeline specified by path(-p) or active pipeline to null state:

/ # gst-client -p /com/ridgerun/gstreamer/gstd/pipe0 null


GStd 'get-state' command to get the state of a specific pipeline(-p flag) or the active pipeline

/ # gst-client -p /com/ridgerun/gstreamer/gstd/pipe0 get-state 


Following are the commands to try frame advance:


GStd 'step' command to step the number of frames, if no number is provided, 1 is assumed

/ # while true; do gst-client -p /com/ridgerun/gstreamer/gstd/pipe0 step; done 
/ # while sleep 1; do gst-client -p /com/ridgerun/gstreamer/gstd/pipe0 step; done
/ # while sleep 5; do gst-client -p /com/ridgerun/gstreamer/gstd/pipe0 step; done 


GStd 'help' command:

/ # gst-client -p /com/ridgerun/gstreamer/gstd/pipe0 help

Parse single command interactive:
Request the syntax of an specific command with "help <command>".

This is the list of supported commands:

create:Creates a new pipeline and returns the dbus-path to access it

destroy:Destroys the pipeline specified by_path(-p) or the active pipeline

destroy-all:Destroys all pipelines on the factory.

play:Sets the pipeline specified by_path(-p) or the active pipeline to play state

tplay:Sets the pipeline specified by_path (-p) or the active pipeline to play state for a specifed duration

abort-autostop:Aborts the auto stop property in the pipeline specified by_path (-p) or the active pipeline.

ready:Sets the pipeline specified by_path(-p) or the active pipeline to ready state

pause:Sets the pipeline specified by_path(-p) or the active pipeline to pause state

null:Sets the pipeline specified by_path(-p) or active pipeline to null state

aplay:Sets the pipeline to play state, it does not wait the change to be done

aready:Sets the pipeline to ready state, it does not wait the change to be done

apause:Sets the pipeline to pause state, it does not wait the change to be done

anull:Sets the pipeline to null state, it does not wait the change to be done

set:Sets an element's property value of the pipeline

Supported <data-type>s include: boolean, integer, int64, and string

get:Gets an element's property value of the pipeline

get-duration:Gets the pipeline duration time

get-position:Gets the pipeline position

sh:Execute a shell command using interactive console

get-state:Get the state of a specific pipeline(-p flag) or the active pipeline

get-elem-state:Get the state of a specific element ofthe active pipeline

list-pipes: Returns a list of all the dbus-path ofthe existing pipelines

ping: Shows if gstd is alive

ping-pipe:Test if the active pipeline is alive

active:Sets the active pipeline,if no <path> is passed:it returns the actual active pipeline

seek:Moves current playing position to a new one

skip:Skips a period, if period is positive: it moves forward, if negative: it moves backward

speed:Changes playback rate:

* rate>1.0: fast-forward playback,
* rate<1.0: slow-forward playback,
* rate=1.0: normal speed.
Negative rate causes reverse playback.
step: Step the number of frames, if no number is provided, 1 is assumed
send-eos: Send an EOS event on the pipeline
send-custom-event: Send a custom event on the pipeline. The event type can be:
* UPSTREAM
* DOWNSTREAM
* DOWNSTREAM_OOB
* BOTH
* BOTH_OOB

element-set-state: Sets the element state Supported <state>s include: null, ready, paused, playing

element-async-set-state: Sets the element state, it does not wait the change to be done

exit:Exit/quit active console

quit:Exit/quit active console

strict:Enable/disable strict execution mode.

version:Show gst-client version.