entransstamp

Re-sequence timestamps on buffers and optionally provide progress info.

The identity element has a similar identity:single-segment functionality which timestamps buffers according to the running time, which should typically then result into a perfect stream of sequential timestamps. It can do this on the basis of segment information or based on bytes per second given by a identity:datarate, provided to it externally. However, this datarate is typically available within the stream itself, by means of caps (e.g. framerate, samplerate), which is extracted by this element and automagically used to perform (re)timestamping. Again, the result is a single-segment "time-perfect" stream. Since the re-sequencing is performed based on datarate, a/v synchronization might be affected if incoming timestamps are irregular (with respect to datarate). Use e.g. videorate to aid with that.

The silent and progress properties allow also using this element to obtain some intermittent progress updates (re-assuring the pipeline is still carrying on).

If sync-margin is non-zero when part of a video stream, then it performs synchronization w.r.t. clock (typically provided by audio src or sink). Specifically, buffers passing through will either be duplicated or dropped as necessary to ensure that the (calculated) timestamp does not deviate more than sync-margin frames. A check for this is performed either each time or every sync-interval frames (if non-zero).

However, if sync-margin is zero, then enabling#entransstamp:interpolate will leave existing (pts) timestamps intact and will interpolate others (using proper data rate). If not enabled, any existing timestamps are discarded and 0-based timestamps are generated.

The properties duplicate and drop can be read to obtain information about number of dropped frames (i.e. the number of unused input frames) and duplicated frames (i.e. the number of times an input frame was duplicated, beside being used normally).

An input stream that needs no adjustments will thus never have dropped or duplicated frames.

When the silent property is FALSE, a GObject property notification will be emitted whenever one of the "duplicate" or "drop" values changes. This can potentially cause performance degradation. Note that property notification will happen from the streaming thread, so applications should be prepared for this.

If allow-segments is FALSE, all segment updates will be discarded. Otherwise, some moderately intelligent decision will allow crucial ones to pass (e.g. time synchronization for subtitle streams).

It can be noted that the "sync" functionality is somewhat related to GstVideoRate:videorate element and should probably be merged into the latter element at some point.

History

  • sync functionality based on transcode's import_v4l2 [Erik Slagter]

Hierarchy

GObject
    ╰──GInitiallyUnowned
        ╰──GstObject
            ╰──GstElement
                ╰──GstBaseTransform
                    ╰──entransstamp

Factory details

Authors: – Mark Nauwelaerts

Classification:Generic

Rank – none

Plugin – entransentrans

Package – GStreamer Entrans

Pad Templates

sink

ANY

Presencealways

Directionsink

Object typeGstPad


src

ANY

Presencealways

Directionsrc

Object typeGstPad


Properties

allow-segments

“allow-segments” gboolean

Allow (intelligent) passing of updating TIME segments (e.g. for stream time synchronization)

Flags : Read / Write

Default value : true


drop

“drop” guint64

Number of dropped frames

Flags : Read

Default value : 0


duplicate

“duplicate” guint64

Number of duplicated frames

Flags : Read

Default value : 0


interpolate

“interpolate” gboolean

Interpolate buffer time [if also sync-margin == 0]

Flags : Read / Write

Default value : false


invalidate

“invalidate” gboolean

Invalidate buffer time and duration

Flags : Read / Write

Default value : false


last-message

“last-message” gchararray

last-message

Flags : Read

Default value : NULL


progress

“progress” guint

Microseconds between progress status info

Flags : Read / Write

Default value : 2000000


silent

“silent” gboolean

silent

Flags : Read / Write

Default value : true


sync-interval

“sync-interval” guint

Interval to check sync

Flags : Read / Write

Default value : 25


sync-margin

“sync-margin” guint

Margin beyond which to enforce sync [0 = disabled]

Flags : Read / Write

Default value : 0


The results of the search are