GStreamer Daemon - Seek
← EOS |
⌂ Home |
→ Flush start/Flush stop |
This wiki shows how to send a seek event to a given pipeline. Seek event moves current playing position to a new one, sometimes it is important to measure the time needed to seek to different points in a video file.
Sending an Seek event
A new Seek event is sent to a pipeline using the command shown below.
event_seek pipeline rate=1.0 format=3 flags=1 start-type=1 start=0 end-type=1 end=-1 Creates a new Seek event and sends it to pipeline.
For more information of the seek arguments go to gst_element_seek.
For example:
⇒ Gstd Commands:
pipeline_create p1 videotestsrc ! autovideosink pipeline_play p1 event_seek p1 1.0 0
will respectively
- Create a pipeline p1
- Put it to playing
- Send a Seek event to it
The event_seek command will typically fail for any of the following:
- No pipeline was given
- The given pipeline doesn't exist
- Wrong seek event property
Alternatively, a pipeline can be created using the low level CRUD syntax:
⇒ Gstd Commands:
create /pipelines/p1/event seek rate=1.0 format=3 flags=1 start-type=1 start=0 end-type=1 end=-1
Example Application
A very useful application of the seek event is when a video is needed to playback in a interval, for severals seconds. This example shows how to set the start time and the end time of the playback, the seek event takes the time in nanoseconds, for this example the playback start at 5s and ends in 10s.
⇒ Gstd Commands:
# Create the pipeline pipeline_create p1 playbin uri=file:///tmp/video.mp4 # Play the pipeline pipeline_play p1 # Send the seek event. Play the pipeline from the second 5 to 10 event_seek p1 1.0 3 1 1 5000000000 1 10000000000
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. |
event_seek <pipe> <rate=1.0> <format=3> <flags=1> <start-type=1> <start=0> <end-type=1> <end=-1> | create /pipelines/<name>/event_seek <rate=1.0> <format=3> <flags=1> <start-type=1> <start=0> <end-type=1> <end=-1> | Sends a seek event to an element. |
}}
← EOS |
⌂ Home |
→ Flush start/Flush stop |
- GStreamer Daemon Basics
- Building GStreamer Daemon
- Quick Start Guide
- Interacting with Pipelines
- Modifying Element Properties
- Sending Events
- Receiving Messages from the Bus
- Receiving Signals
- Enabling the Debug Subsystem
- Low-level Implementation for Applications
- Response Format
- API Reference
- Simple Examples
- Advanced Examples
- Troubleshooting
- Releases
- Licensing
- FAQ
- Contact Us
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 |
event_seek <pipe> <rate=1.0> <format=3> <flags=1> <start-type=1> <start=0> <end-type=1> <end=-1> | create /pipelines/<name>/event_seek <rate=1.0> <format=3> <flags=1> <start-type=1> <start=0> <end-type=1> <end=-1> | Sends a seek event to an element |
}}
}}