[Interest] QAbstractVideoSurface::present - videoframe start/endtime always -1 on windows
Ola Røer Thorsen
ola at silentwings.no
Thu Jun 13 13:20:15 CEST 2013
Hi,
I've created a custom video player using QMultimedia, that plays back
certain video files that are to be post-processed frame-by-frame. The
post-process depends on each video frame's start time. I'm using the Qt
5.1 beta release (I use the new desktop QML features).
I've created a video surface class that inherits QAbstractVideoSurface,
register this in QMediaplayer, and I get each frame in my own
implementation of QAbstractVideoSurface::present.
On Linux, this works flawlessly, each QVideoFrame have proper values for
QVideoFrame::startTime() and endTime(). However on windows, start- and
endtimes are always -1 (invalid).
I try now to look up the current position in the mediaplayer each time
present is called, but this is not really precise enough. Anyone know
how to make this work? I've tried various video file formats but they
all give the same -1 values.
Maybe there is a bug in the windows backend (WMF?). I tried looking into
the source code - at first glance it looks allright (mftvideo.cpp at
line 638), but while googling further into it I found this page here,
http://msdn.microsoft.com/en-us/library/windows/desktop/bb530107(v=vs.85).aspx
<http://msdn.microsoft.com/en-us/library/windows/desktop/bb530107%28v=vs.85%29.aspx>
where further calculations are needed as the sample times are relative
to a "presentation clock", so maybe it can't work like it's implemented
now?
Best regards
Ola
More information about the Interest
mailing list