Results 1 to 7 of 7

Thread: phonon VideoPlayer refresh

  1. #1
    Join Date
    May 2008
    Location
    Melbourne, Australia
    Posts
    136
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default phonon VideoPlayer refresh

    hello,

    I'm having trouble seeking with the phonon VideoPlayer widget.
    I want the user to be able to pause the video and then jump between different frames. Usually when I ask the video to seek it responds, but sometimes the video gets 'stuck' and won't update until I play and repause it.

    Querying currentTime() tells me that the video knows it is at a new frame but the video is not updating:
    Qt Code:
    1. video->pause();
    2. video->seek(frame);
    3. assert(video->currentTime() == frame); // no problem here
    To copy to clipboard, switch view to plain text mode 

    Is there a way to force the video to refresh to show the current frame? Or is there a way to determine whether the video has updated to the current frame?

    In case it matters, I'm seeking using a SeekSlider connected to the video, although I had the same problem with a normal slider.

    regards,
    Richard

  2. #2
    Join Date
    Jul 2008
    Posts
    47
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: phonon VideoPlayer refresh

    I don't think this will work.

    The seek( ms ) is in milliseconds and not in frames.

    For sure it seems that you calculate with the frames at which ms it should be, but it is not the intention of this interface.

    The seek is just forwarded to the phonon backend and basically it depends on the backend what it really does with this information. It may round or jump to something near to it.
    This maybe especially the case, when the fps is not constant over time.

    In order to see if it would work, I would look into the sources of your backend.
    The backends don't have to many files, so the search may not take too long.

    Also a google "phonon frames -electron" gives some hints for this topic, i.e. that in the experimental of kde phonon branch a frame based interface is intended, but for sure it is not in Phonon 4.2 which is shipped with Qt 4.4.

  3. #3
    Join Date
    May 2008
    Location
    Melbourne, Australia
    Posts
    136
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: phonon VideoPlayer refresh

    apologies for the confusing terminology. I meant ms.

    My problem is not of translating between ms and frames but that when I seek to a position sometimes the video still shows the previous position. This only happens when the video is paused - if I seek when the video is playing it updates. Phonon seems to be too conservative with its updates when paused so I want to force a refresh.

  4. #4
    Join Date
    Jul 2008
    Posts
    47
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: phonon VideoPlayer refresh

    Which BE are you using?

    and how about

    videoWidget->repaint();

    after your jump?

    I mean, there may be reasons why it should not repaint automatically after a seek().
    Last edited by muellerp; 5th November 2008 at 11:18.

  5. #5
    Join Date
    May 2008
    Location
    Melbourne, Australia
    Posts
    136
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: phonon VideoPlayer refresh

    what does BE stand for?

    yeah I've tried repaint() and update() but they don't make a difference. I suspected this was because the seeking is done asynchronously so at the time I call repaint() the player has not updated yet. However even when I tried calling repaint() periodically (every 100ms) the videoplayer still got stuck as before.
    Last edited by rbp; 6th November 2008 at 00:08.

  6. #6
    Join Date
    Jul 2008
    Posts
    47
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: phonon VideoPlayer refresh

    Maybe it is not intended to be used as you want (that means not supported) or just wrongly supported (bug).

    BE stands for Backend, so: Which backend do you use (gstreamer or xine on Linux, DS9 on Win or qt7 on Mac)?
    This would help looking into the sources for detailed handling of VideoWidget and MediaObject of these backends for your case.

    But you are right: Currently there doesn't seem to be a signal like seekFinished. Only the tick interval may help (but for sure you only need a one time shot).

  7. #7
    Join Date
    May 2008
    Location
    Melbourne, Australia
    Posts
    136
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: phonon VideoPlayer refresh

    from a discussion on the QT-interest mailing list I found that it is a codec problem. When I tried wmv files instead the seek worked but not for avi (which are smaller so I assume more compressed).

Similar Threads

  1. I cannot run the phonon demos in the PXA270!Can someone help me?
    By Justin_W in forum Qt for Embedded and Mobile
    Replies: 8
    Last Post: 19th February 2010, 10:14
  2. phonon VideoPlayer seek
    By rbp in forum Qt Programming
    Replies: 4
    Last Post: 31st October 2008, 04:53

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.