Discussion:
Screen Capture as format YUV
(too old to reply)
Emre Cetin
2018-11-06 15:48:30 UTC
Permalink
Hi everyone,

I have a project related to image processing on QT and GStream. I have
created a program with QWidget, and I got a screenshot of this program with
QPixmap. However, I need to convert these frames into a YUV format and send
them to GStream because I am going to merge these frames another video
frames with GStream.

Is there any way I can get QWidget frames in YUV format? Without
conversion. I am working on QT 5.5. Any advice ?

Thanks,
Emre Cetin
Ariel Molina
2018-11-06 17:00:02 UTC
Permalink
On-screen pixels are RGB, as far as I know there aren't any YUV screens
(unless you are into some strange older broadcast pipeline). So you are
forced to convert.

Ariel
Post by Emre Cetin
Hi everyone,
I have a project related to image processing on QT and GStream. I have
created a program with QWidget, and I got a screenshot of this program with
QPixmap. However, I need to convert these frames into a YUV format and
send them to GStream because I am going to merge these frames another video
frames with GStream.
Is there any way I can get QWidget frames in YUV format? Without
conversion. I am working on QT 5.5. Any advice ?
Thanks,
Emre Cetin
_______________________________________________
Qt-creator mailing list
http://lists.qt-project.org/mailman/listinfo/qt-creator
--
Ariel Molina R.

http://edis.mx
Eike Ziller
2018-11-07 07:42:15 UTC
Permalink
Post by Emre Cetin
Hi everyone,
I have a project related to image processing on QT and GStream. I have created a program with QWidget, and I got a screenshot of this program with QPixmap. However, I need to convert these frames into a YUV format and send them to GStream because I am going to merge these frames another video frames with GStream.
Is there any way I can get QWidget frames in YUV format? Without conversion. I am working on QT 5.5. Any advice ?
If you really get that from a screen, that will need to be converted _somewhere_.

On the other hand, QImage is a QPaintDevice and supports different image formats. So it is possible to render a QWidget (+ its child hierarchy) directly into a QImage by using the QWidget::render(....) method, similar to printing a widget: https://doc.qt.io/qt-5/qtprintsupport-index.html#printing-widgets . I’d expect that to be as direct as it gets.

Br, Eike

--
Eike Ziller
Principal Software Engineer

The Qt Company GmbH
Rudower Chaussee 13
D-12489 Berlin
***@qt.io
http://qt.io
Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B
Loading...