GES: Problem applying certain effects when seeking with a non-1.0 rate

Steve Rubin srubin at cs.berkeley.edu
Thu Aug 2 20:26:48 UTC 2018


Hello!

My goal is to play a GES pipeline at a faster or slower rate without
affecting the perceived audio pitch.

If I use `gst_element_seek` on the GESPipeline, I can play the pipeline at
a different speed, as desired:

  gst_element_seek(GST_ELEMENT(gesPipeline),
                   2,
                   GST_FORMAT_TIME,
                   GST_SEEK_FLAG_FLUSH,
                   GST_SEEK_TYPE_NONE,
                   GST_CLOCK_TIME_NONE,
                   GST_SEEK_TYPE_NONE,
                   GST_CLOCK_TIME_NONE);

properly plays the pipeline at 2x speed (with "chipmunk" audio).

I then tried to add a `pitch` or `scaletempo` effect to preserve the
perceived pitch:

  GESEffect *pitch = ges_effect_new("pitch pitch=0.5");
  ges_timeline_element_set_duration(GES_TIMELINE_ELEMENT(pitch),
                                    runningTime * GST_SECOND);
  ges_track_add_element(GES_TRACK(audioTrack),
                        GES_TRACK_ELEMENT(pitch));

But now when I play the pipeline, I get the following errors:

  ERROR        audioaggregator gstaudioaggregator.c:1015:gboolean
gst_audio_aggregator_sink_event(GstAggregator *, GstAggregatorPad *,
GstEvent *):<smart-adder-adder:sink_0> Got segment event with wrong rate
1.000000, expected 2.000000

  CRITICAL **: 12:40:23.458: gst_audio_buffer_clip: assertion
'segment->format == GST_FORMAT_TIME || segment->format ==
GST_FORMAT_DEFAULT' failed

  GStreamer-CRITICAL **: 12:40:23.458: gst_segment_to_running_time:
assertion 'segment->format == format' failed

  GStreamer-CRITICAL **: 12:40:23.458: gst_segment_to_running_time:
assertion 'segment->format == format' failed

The same thing happens if I add a `scaletempo` effect in place of the
`pitch` effect. The same thing happens if I try to add these effects to
GESClips rather than the GESAudioTrack, e.g.:

  GESEffect *pitch = ges_effect_new("pitch pitch=0.5");
  ges_timeline_element_set_duration(GES_TIMELINE_ELEMENT(pitch),
clipDuration);
  ges_container_add(GES_CONTAINER(clip), GES_TIMELINE_ELEMENT(pitch));

I realize that I could control the playback rate/pitch by using only the
`pitch` effect and re-writing all the clips in the pipeline every time I
want to change the playback rate; but I'd prefer it to be a simple
parameter that I can set on the pipeline as a whole (using the seek rate
property).

Any help would be greatly appreciated!

Steve Rubin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180802/6a832ce1/attachment.html>


More information about the gstreamer-devel mailing list