Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use MJPEG format for high speed camera support #12

Open
zmz125000 opened this issue May 25, 2021 · 5 comments
Open

Use MJPEG format for high speed camera support #12

zmz125000 opened this issue May 25, 2021 · 5 comments

Comments

@zmz125000
Copy link

zmz125000 commented May 25, 2021

Windows 10 下高帧率相机默认采集无压缩 YUY2 流导致帧数降低到个位数,希望作者能添加一个启用 MJPEG 流的选项

在 src/HeadPoseDetector.cpp 里

    cap.set(cv::CAP_PROP_FRAME_WIDTH, 640);  
    cap.set(cv::CAP_PROP_FRAME_HEIGHT, 480);  
    cap.set(cv::CAP_PROP_FPS, settings->fps);  

加上

cap.set(cv::CV_CAP_PROP_FOURCC, cv::CV_FOURCC('M', 'J', 'P', 'G') );

就可以了。默认开启应该也没什么副作用。
谢谢!

@zmz125000 zmz125000 changed the title Add MJPEG format to capture settings for high speed camera support Use MJPEG format for high speed camera support May 25, 2021
@xuhao1
Copy link
Owner

xuhao1 commented May 31, 2021

The main reason for low FPS is weak CPU. What's your hardward configuration?

@zmz125000
Copy link
Author

zmz125000 commented May 31, 2021

CPU 为 Ryzen R5 3600 和 Ryzen 4600U
YUY2 是无压缩的,很多USB2.0的摄像头用 YUY2 达不到最高帧数。
@xuhao1

@SSV-Normandy
Copy link

遇到了同样的问题,我手头的相机在YUV格式下只支持30帧,但是MJPEG可以支持到120,能否增加一个开关控制传输格式

@xuhao1
Copy link
Owner

xuhao1 commented Jul 21, 2022

我手头没有MJPEG的摄像头
@zmz125000 @SSV-Normandy 你们有什么推荐的我试试?

@zmz125000
Copy link
Author

我的相机已经卖了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants