如何从 PylonImage 缓冲区生成 QVideoFrame
我有一个 pylon 图像流,我想在 QML 应用程序中向用户显示,如何将 PylonImage 转换为 QVideoFrame 以便我可以显示它?
我使用的是 PixelType_YUV422planar,因为 pylonImages 和 QVideoFrames 都支持它。 但我不知道如何从塔图像中获取 QVideoFrame?
我将用 memcpy 进行一些实验,但我想知道是否还有其他方法..
编辑: 使用 memcpy 将 pylonImage 的缓冲区复制到 QVideoFrame 会导致图像扭曲。
I have a stream of pylon images that I would like to display to a user in a QML app, how can I convert the PylonImage to a QVideoFrame so I can display it?
I am using PixelType_YUV422planar since it is supported by both pylonImages and QVideoFrames.
yet I'm clueless on how can I get the QVideoFrame from the pylon image?
I will experiment a bit with memcpy but I would like to know if there's any other way..
edit:
copying the buffer of pylonImage to the QVideoFrame using memcpy results in distorted image..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
memcpy 方法效果很好。请参考:
https://blog.katastros.com/a?ID= 9f708708-c5b3-4cb3-bbce-400cc8b8000c
有趣的代码发布:
我自己制作了 memcpy 示例来进行 v4l2 视频捕获工作,但是 memcpy 成本太高,它导致我的帧速率从 34fps 下降到 6 fps,并且 CPU 使用率为 100%(4K 实时视频)。
你能找到 memcpy 的替代品吗?
谢谢
The memcpy approach works very well. Please refer to:
https://blog.katastros.com/a?ID=9f708708-c5b3-4cb3-bbce-400cc8b8000c
The interesting code shiped:
I made the memcpy example work myself to make a v4l2 video capture work however memcpy is too costly and it is causing my framerates to drop from 34fps to 6 fps and CPU usage is at 100% (4K live video).
Could you find any alternatives to memcpy?
Thx