Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QGraphicsVideoItem doesn't render QCamera output, while QCameraViewfinder does without problems
Forum Updated to NodeBB v4.3 + New Features

QGraphicsVideoItem doesn't render QCamera output, while QCameraViewfinder does without problems

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 232 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fama_lab3d
    wrote on last edited by
    #1

    As the title says, I need to use a QGraphicsScene to render points (ellipses) on top of the QCamera output.
    So what I've done? I've created a scene, added a QGraphicsVideoItem and setted that item as the QCamera viewfinder.
    The problem is that it never renders the camera output.
    I tested with a QCameraViefinder and worked flawlessly, on the first try.
    The strange thing is that I've did it in the past, so I don't understand what kind of setup the QGraphicsVideoItem requires.

    Do I need to set the item as the viewfinder before it's added to the scene?
    Do I need to be sure it's painted at least once before setting it as the viewfinder?

    At the moment I'm simply doing this:

    void worker::set_viewfinder(QGraphicsVideoItem *video_item) // doesn't work
    {
        camera->stop();
        camera->setViewfinder(video_item);
        camera->start();
    }
    void worker::set_viewfinder(QVideoWidget *video_item) // works
    {
        camera->stop();
        camera->setViewfinder(video_item);
        camera->start();
    }
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Which version of Qt are you using ?
      On which platform ?
      The class name Worker suggests it could be doing things in a different thread, is it the case ?
      Do you have the same issue with a simple view, scene and item ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved