<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 05/20/2012 03:42 AM, Robert Schroll wrote:
<blockquote cite="mid:4FB84C22.7000006@gmail.com" type="cite">Hi
all,
<br>
<br>
I'm trying to put together a simple video player with overlaid
controls. At the moment, I'm using cairooverlay to draw the
controls directly on the video stream. When I receive user input,
I just update some state variables so that when the next frame is
drawn, it properly reflects the user's actions by prelighting
controls, etc. This works pretty well when the video is playing
(low frame-rate videos have a bit of lag in the controls, but I'm
willing to live with it), but it means nothing is updated when the
video is paused. I'm trying to work around this, but I'm new to
gstreamer and don't know which ideas are feasible. Any comments
you have on which way to go (or if there's an entirely better way
to do this) would be appreciated.
<br>
</blockquote>
This is difficult. When the video is paused, the time is standing
still and no updates are pushed to the screen. I wonder if we could
do something clever using the recent VideoOverlayComposition api: <br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a
href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstvideooverlaycomposition.html">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstvideooverlaycomposition.html</a><br>
Something like having a flag to mark them as 'live', so that
video-sinks would re-render them even on paused frames.<br>
<br>
One general problem with your approach though is, that your UI
update rate is linked to the video framerate (but probably okay for
you). You could mitigate that using a videorate element in front of
the sink to fixate the fps to e.g. 30.<br>
<br>
Stefan<br>
<br>
<blockquote cite="mid:4FB84C22.7000006@gmail.com" type="cite">
<br>
The ideas I've had so far:
<br>
1) Find a way to force cairooverlay to emit a frame down the
pipeline when paused. I could hook up a timer to call this
occasionally when the movie is paused. But I suspect being paused
is an all-or-nothing thing for the pipeline, I can't have data
flowing through only half of it.
<br>
<br>
2) Find some sort of equivalent of imagefreeze for videos, either
as a source or a filter. When activated, this would replace the
video frames with a stream of that repeats the last frame over and
over. The pipeline would always be in the "playing" state, so the
controls would always be updated. But I don't know if such an
element exists.
<br>
<br>
3) Use a videomixer to combine my desired video and a test source
in such a way that only the former is visible. (This could also
up the refresh rate for low-frame rate videos.) But I don't know
if I can pause the sources to a video mixer individually, or what
this would do to seeking.
<br>
<br>
4) What I'm doing right now is pausing the pipeline and then
seeking to the current position every 50ms. This triggers a new
frame to go down the pipeline, on which I can draw the updated
controls. This works seamlessly for some videos, but for others
it introduces half-second jumps on the pause, presumably because
the seek is going to a keyframe or something. There also seems to
be a problem with seeking to the exact end of a video - I have to
back up at least 1ns to get a new frame, but some videos seem to
require more. In short, this method seems sort of fragile, but it
is the only one that I know how to make work.
<br>
<br>
So, is there anyway to make (1), (2), or (3) work, or does
gstreamer just not work that way? Is there a way to improve (4),
or are the problems with it that I'm not seeing yet? Is there a
better way to overlay controls than a cairooverlay?
<br>
<br>
As I said, I'm new to gstreamer, so please don't assume I've
considered something that seems obvious to you. I'm working in
Vala, but I'd be happy with example code in any language.
<br>
<br>
Thanks in advance,
<br>
Robert
<br>
_______________________________________________
<br>
gstreamer-devel mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
<br>
</blockquote>
<br>
</body>
</html>