简体   繁体   English

无法在Qt 5.0.2(Linux)中使用QCamera获得用于图像捕获的相机支持的分辨率

[英]Can't get supported resolutions of the camera for image capturing using QCamera in Qt 5.0.2 (Linux)

I am trying to write a simple program for taking photos from the webcam using Qt. 我正在尝试编写一个简单的程序,使用Qt从网络摄像头拍照。 There is an example project in the Qt Creator, where QCamera is used to take photos and record video. Qt Creator中有一个示例项目,其中QCamera用于拍照和录制视频。 But it is not working the right way. 但这不是正确的方法。 I can't get supported resolutions of the camera using method QCameraImageCapture::supportedResolutions(). 使用方法QCameraImageCapture :: supportedResolutions()无法获得相机的受支持分辨率。 A null QList object is returned, and camera is always capturing images with 640x480 resolutions. 返回一个空的QList对象,并且相机始终以640x480的分辨率捕获图像。 OS is Ubuntu 11.04. 操作系统是Ubuntu 11.04。 Same problem occurs on Windows XP. Windows XP上也会发生相同的问题。 Can anyone help me? 谁能帮我?

I have answered nearly the same question. 我回答了几乎相同的问题。

https://stackoverflow.com/a/21140214/2452081 https://stackoverflow.com/a/21140214/2452081

In short: Portable solution can be gstreamer, but if Windows DirectShow solution is enough for you download my code from here 简而言之:便携式解决方案可以是gstreamer,但是如果Windows DirectShow解决方案足以让您从此处下载我的代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM