How can I embed a rewind-bar for a videoplayer

1 visualizzazione (ultimi 30 giorni)
Dries van Roovert
Dries van Roovert il 16 Set 2016
Commentato: Geoff Hayes il 20 Set 2016
Hi guys,
I'm trying to embed a videoplayer in a custom GUI environment. Now, I want to use a uicontrol style slider as a rewind bar to "browse" the frames. I've tried to print 1 frame on the axis as a callback function and delete the previous frame. The problem is that the new frame doesn't show on the axis.
delete(get(app.Axis,'Children'));
FrameNumber=get(app.hObject,'Value');
VideoPlayFile=vision.VideoPlayer(app.dir);
Frame=step(VideoPlayFile,FrameNumber);
showFrameOnAxis(app.Axis,Frame);
hObject is the slider. Many thanks in advance if you read this and can help me.
Kind regards, Dries
  1 Commento
Geoff Hayes
Geoff Hayes il 20 Set 2016
Dries - what function does the above code appear in? Is it in a callback (of some kind) for the slider? Please clarify by posting the function signature (and all code for this function). Also, post the code for showFrameOnAxis or step through this function (using the debugger) to see why the desired frame is not being shown. You may also want to look at (or print out) FrameNumber each time the above code is called. Does it have a valid value? (i.e. is it an integer that corresponds to a valid frame within the video).

Accedi per commentare.

Risposte (0)

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by