微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

从原始视频中提取帧

如何解决从原始视频中提取帧

我将配置设置为:

v4l2-ctl -v pixelformat=pRCC,width=4056,height=3040
v4l2-ctl -p 10

然后获取帧:

v4l2-ctl --stream-mmap=3 --stream-count=100 --stream-to=test.avi

成功结束。现在我一直在尝试从这个视频文件提取帧并将它们转换为 RGB 以供查看。

我有两种相机操作模式,第一种是直接将它连接到地址总线,而不是将格式结果列为:

v4l2-ctl --list-formats-ext

ioctl: VIdioC_ENUM_FMT
Type: Video Capture

[0]: 'pRCC' (12-bit Bayer RGRG/GBGB Packed)
    Size: discrete 4056x3040
    Size: discrete 2028x1520
    Size: discrete 2028x1080
[1]: 'RG12' (12-bit Bayer RGRG/GBGB)
    Size: discrete 4056x3040
    Size: discrete 2028x1520
    Size: discrete 2028x1080
[2]: 'pRAA' (10-bit Bayer RGRG/GBGB Packed)
    Size: discrete 1012x760
[3]: 'RG10' (10-bit Bayer RGRG/GBGB)
    Size: discrete 1012x760

如果我通过操作系统连接,那么结果是:

ioctl: VIdioC_ENUM_FMT
Type: Video Capture

[0]: 'YU12' (Planar YUV 4:2:0)
    Size: Stepwise 32x32 - 4056x3040 with step 2/2
[1]: 'YUYV' (YUYV 4:2:2)
    Size: Stepwise 32x32 - 4056x3040 with step 2/2
[2]: 'RGB3' (24-bit RGB 8-8-8)
    Size: Stepwise 32x32 - 4056x3040 with step 2/2
[3]: 'JPEG' (JFIF JPEG,compressed)
    Size: Stepwise 32x32 - 4056x3040 with step 2/2
[4]: 'H264' (H.264,compressed)
    Size: Stepwise 32x32 - 4056x3040 with step 2/2
[5]: 'MJPG' (Motion-JPEG,compressed)
    Size: Stepwise 32x32 - 4056x3040 with step 2/2
[6]: 'YVYU' (YVYU 4:2:2)
    Size: Stepwise 32x32 - 4056x3040 with step 2/2
[7]: 'VYUY' (VYUY 4:2:2)
    Size: Stepwise 32x32 - 4056x3040 with step 2/2
[8]: 'UYVY' (UYVY 4:2:2)
    Size: Stepwise 32x32 - 4056x3040 with step 2/2
[9]: 'NV12' (Y/CbCr 4:2:0)
    Size: Stepwise 32x32 - 4056x3040 with step 2/2
[10]: 'BGR3' (24-bit BGR 8-8-8)
    Size: Stepwise 32x32 - 4056x3040 with step 2/2
[11]: 'YV12' (Planar YVU 4:2:0)
    Size: Stepwise 32x32 - 4056x3040 with step 2/2
[12]: 'NV21' (Y/CrCb 4:2:0)
    Size: Stepwise 32x32 - 4056x3040 with step 2/2
[13]: 'RX24' (32-bit XBGR 8-8-8-8)
    Size: Stepwise 32x32 - 4056x3040 with step 2/2

正如我所提到的,我试图尽可能快地获得未触及的 12 位数据,然后我可以在 Python 中查看像素数据,最好(我也愿意接受其他建议)。

如果有经验的用户提供一些解决方案,我会很高兴。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。