0

I need to replicate the stream of a QCamera on two different QVideoWidgets (at the same time). Is there any way?

Andrea G.
  • 3
  • 2

1 Answers1

1

Unfortunately, only a single display output can be attached to a media object at one time if you use the built-in api. You'll have to use a a QCameraImageCapture to explicitly capture QVideoFrames from the camera. You can then display them on any widget, e.g. a QLabel by creating an pixmap that wraps the video data.

Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313
  • but is that as efficient as attaching the display output to the media object? I mean, doesn't extracting the `QVideoFrames` and setting them in a `QLabel` after creating the `QPixmap` cost too much compared to the built in approach?? – Mike Aug 26 '16 at 17:37
  • The built-in approach doesn't do what you need. If you're asking if there's another way of doing it other than patching QtMultimedia: I don't know of it. – Kuba hasn't forgotten Monica Aug 26 '16 at 17:57