change video speed continuously

Ilja Booij ibooij at gmail.com
Sat Apr 25 11:14:53 PDT 2015


Hi all,

for an (open source) application I'm building (
https://github.com/ibooij/big-ring) I'm using gstreamer to display video
content according to the speed in which the camera is travelling in a
simulation.

Currently I'm using a single playbin element, coupled to an appsink. From
the appsink, I upload the
frame to a OpenGL texture. The conversion from YUV to RGB and the scaling
is done using shaders.

What I'm doing now is the following:
1. Measure the power a cyclist is generating (using an ANT+ power meter)
2. Calculate the (approximate) speed the cyclist is travelling using power,
current speed, weight and grade. The grade comes from a meta-data file that
comes with the video.
3. Calculate the distance (from the start) at which the cyclist is.
4. Calculate the video frame that needs to be displayed.
5. If the a new frame needs to be displayed, I send a step event to the
playbin.

A new simulation step is performed every 1/30th of a second. For some parts
of a course, mainly downhills, the "cyclist" will travel faster than the
original camera speed, which means that the step event in step 5 will
perform a step of more than 1 frame.

I have 2 questions about this use of gstreamer:

1. The CPU-use seems be quite high. I was wondering if doing these step
events might be inefficient. I've tried to simply change the speed of the
video multiple times a second, but that did not work out, as the video
seemed to step back (to a key-frame?) when changing speed. What would be
the (most) correct way to do this?
2. I use a playbin now. Because I obviously cannot use any sound from the
videos (most don't have any as they are made just for this kind of use),
would it perhaps be smarter to build a pipeline that omits any sound
decoding?

The videos I'm using are (at the moment) all mpeg-4, in an AVI container.
The resolutions and frame rates vary.

Thanks for taking the time to read these question,
cheers,
Ilja Booij
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150425/b1511edd/attachment.html>


More information about the gstreamer-devel mailing list