Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by NPS · Sep 02, 2013 at 03:04 PM · fpsfreezewebcam

High FPS webcam problem

I just noticed (after hours of debugging) that a too high FPS can (and does) actually cause a problem with the web cam. I'm using WebCamTexture class to get the image from the webcam in my laptop and put it as a texture on an object (real-time). And it works well. But when I run the app (in the Editor) and it has a high FPS (like 900 or more, I'm not sure what's the threshold) the application chokes horribly, freezes, lags and so on... It doesn't complete freeze as it jumps a few frames (literally a few) every couple of seconds then it freezes again and so on... But when I set Application.targetFrameRate to a low value (like 60) the problem disappeared. Also 100 - 200 seemed to work well. I tested the app also on my mobile phone and it works ok (but I assume it's because it can't get 1000 FPS there :P).

So my conclusion is that too high an FPS causes problems as the web cam can't catch up or something. But why? Has anyone come across this problem before? Should I just fix the FPS in my application or what's the correct solution?

As a side note, or question rather - can I lock the FPS for a moment in my application (only when I actually use the camera) and then unlock it again? Or should Application.targetFrameRate be used just once at the start and never touched again?

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image TheGameLearner · Jan 23, 2019 at 09:40 AM 0
Share

I am using WebCamTexture now and in mobile, my app has a huge lag. every few seconds the image is updated and then it freezes for another few seconds.

did you ever find the reason for lags? I am creating default webcam without specifying the frameRate

avatar image Stevens-R-Miller · Nov 05, 2021 at 11:44 PM 0
Share

I'm having a similar problem. When I maximize the Game window in play mode, my webcam video freezes and the cam light blinks on and off. Turning on VSync makes the problem go away. Note that I don't have this problem on my slower computers, only on my fastest machine (HP Omen 15). It does seem from these reports that a really high frame rate causes problems for some cams.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by CHRISYS · Sep 11, 2014 at 02:18 PM

same problem here...!!!, when i started a project i first tested this code:

**http://answers.unity3d.com/questions/384734/how-to-take-a-photo-from-a-webcam.html**

but at that time i did not used the stats option in game tab when running the app, i just tested fine, after the test i was working with other thing in the app and didn´t even use the webcam, so just yesterday i was testing webcam again with stats on and set all my 3d models and objects in scene to inactive and i noticed my FPS goes from 2000 to 5000...!! the webcam shows that jumps between movement the led that lights when the webcam is on, is blinking like the web cam is turning on and of constantly and i noticed only when the light is on the webcam is able to update the img, I even tested it on a new scene and same problem, i tested it on my personal laptop whit the built-in webcam in another project in a scene with a floor cube, a directional light, a cloth and the cube where the webcam is showing the webcamtexture, fps is 58 to 68, and this problem is not happening...!! what could it be..?

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image TheGameLearner · Jan 23, 2019 at 09:41 AM 0
Share

I am using WebCamTexture now and in mobile, my app has a huge lag. every few seconds the image is updated and then it freezes for another few seconds.

did you ever find the reason for lags? I am creating default webcam without specifying the frameRate

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

19 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity android huge fps drop on new devices 1 Answer

Unity freezes on play when I left click. 2 Answers

Webcamtexture at 1080p 50fps produces black image 1 Answer

CPU usage, fps and colliders 0 Answers

Rotate gameObject if cursor is near screen edges 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges