GStreamer Daemon - New Clock

From RidgeRun Developer Wiki


Previous: MP4 Video Recording Index Next: Slow Motion




This wiki shows how to use the bus_<action> to read the bus in the pipeline, with the bus_filter command we can filter the new_clock messages then use the bus_read to read them.

Example

The following example is a bash script that demonstrates the simple slow motion playback.

#!/bin/bash

# Absolute path to the video location
VIDEO=$1

# Graceful cleanup upon CTRL-C
trap "gstd-client pipeline_delete p; exit" SIGHUP SIGINT SIGTERM

# Make sure there is no pipeline with this name already
gstd-client pipeline_delete p

gstd-client pipeline_create p playbin uri=file://$VIDEO

# Filter only a new-clock
gstd-client bus_filter p new_clock

# Play the pipeline
gstd-client pipeline_play p

# Waiting until bus read a message error 
gstd-client bus_read p


The output of the command bus_read should be as follows:

{
  "code" : 0,
  "description" : "Success",
  "response" : {
    "type" : "new-clock",
    "source" : "p",
    "timestamp" : "99:99:99.999999999",
    "seqnum" : 95411
}
}


To run the script you will need an existing video. You may use the video recording simple example to quickly use Gstd to record one. To run the new-clock script, type

./new-clock.sh /tmp/video.mp4


Previous: MP4 Video Recording Index Next: Slow Motion