Top |
This element takes an incoming stream of timestamped raw audio frames and produces a perfect stream by inserting or dropping samples as needed.
This operation may be of use to link to elements that require or otherwise implicitly assume a perfect stream as they do not store timestamps, but derive this by some means (e.g. bitrate for some AVI cases).
The properties “in”, “out”, “add” and “drop” can be read to obtain information about number of input samples, output samples, dropped samples (i.e. the number of unused input samples) and inserted samples (i.e. the number of samples added to stream).
When the “silent” property is set to FALSE, a GObject property notification will be emitted whenever one of the “add” 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 the “tolerance” property is non-zero, and an incoming buffer's timestamp deviates less than the property indicates from what would make a 'perfect time', then no samples will be added or dropped. Note that the output is still guaranteed to be a perfect stream, which means that the incoming data is then simply shifted (by less than the indicated tolerance) to a perfect time.
1 |
gst-launch-1.0 -v autoaudiosrc ! audiorate ! audioconvert ! wavenc ! filesink location=alsa.wav |
1 |
gst-launch-1.0 -v uridecodebin uri=file:///path/to/audio.file ! audiorate ! audioconvert ! wavenc ! filesink location=alsa.wav |
name |
sink |
direction |
sink |
presence |
always |
details |
audio/x-raw, format=(string){ S8, U8, S16LE, S16BE, U16LE, U16BE, S24_32LE, S24_32BE, U24_32LE, U24_32BE, S32LE, S32BE, U32LE, U32BE, S24LE, S24BE, U24LE, U24BE, S20LE, S20BE, U20LE, U20BE, S18LE, S18BE, U18LE, U18BE, F32LE, F32BE, F64LE, F64BE }, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ], layout=(string){ interleaved, non-interleaved } |
name |
src |
direction |
source |
presence |
always |
details |
audio/x-raw, format=(string){ S8, U8, S16LE, S16BE, U16LE, U16BE, S24_32LE, S24_32BE, U24_32LE, U24_32BE, S32LE, S32BE, U32LE, U32BE, S24LE, S24BE, U24LE, U24BE, S20LE, S20BE, U20LE, U20BE, S18LE, S18BE, U18LE, U18BE, F32LE, F32BE, F64LE, F64BE }, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ], layout=(string){ interleaved, non-interleaved } |
“silent”
property“silent” gboolean
Don't emit notify for dropped and duplicated frames.
Flags: Read / Write
Default value: TRUE
“skip-to-first”
property“skip-to-first” gboolean
Don't produce buffers before the first one we receive.
Flags: Read / Write
Default value: FALSE
“tolerance”
property“tolerance” guint64
The difference between incoming timestamp and next timestamp must exceed the given value for audiorate to add or drop samples.
Flags: Read / Write
Default value: 40000000