14 Replies Latest reply on Feb 24, 2014 11:28 AM by sinious

    webcam video looks stretched on Mac

    Adobe Agency Partner



      in some cases we found out that the image of a webcam looks stretched when using a webcam on a mac. In my case I used a Logitech C910 (which definitely supports 16:9 resolutions) on a Mac running Mac OS X 10.6.8.


      In my project I want to show a webcam video in 16:9 but want to switch between different 16:9 camera resolutions (320 x 180, 480 x 270, 640 x 360). Under Windows every resolution of the camera looks fine - nothing is stretched. You can check whether the image is stretched or not best by holding a round cup in front of the webcam and check whether it is still round in the video. But when using a Mac, the webcam video looks sometimes stretched. The cup is not round anymore.


      I have built a small test application running at http://interactive-pioneers.com/camTest/. It shows three different webcam displays: on the left hand side the video will always resize to the resolution, width and height set in the dropdown (4:3 and 16:9). The video in the middle will always stay 16:9 with a fixed size of 320 x 180. The video on the right hand side will always stay 4:3 with a fixed size of 320 x 240. Whenever you change the dropdown, the webcam size will be updated via camera.setMode.


      Under Windows everything works as expected:

      - left video: cup is always round, no stretching

      - video in center: cup is always round whenever a 16:9 resolution is chosen. cup is stretched vertically whenever a 4:3 resolutions is chosen

      - right video: cup is always round whenever a 4:3 resolution is chosen. cup is stretched horizontally whenever a 16:9 resolutions is chosen


      This is what I totally expected. It makes sense.


      But not on a Mac:

      - left video: cup is round for 320x240 (4:3), 320x180 (16:9) and 640x480 (4:3). It is stretched vertically for 480x360 (4:3) and 480x270 (16:9). It is stretched horizontally for 640x360 (16:9). This doesn't make any sense for me. It should be round in all cases as it does under Windows.

      - video in center: cup is round for 320x180 (16:9) and 480x360 (4:3). It is stretched vertically for 480x270 (16:9). It is stretched horizontally for all other resolutions. It would make sense if the cup is round for all 16:9 resolutions as under Windows.

      - right video: cup is round for 320x240 (4:3),640x480 (4:3) and 640x360 (16:9). It is stretched vertically for all other resolutions. It would make sense if the cup is round for all 4:3 resolutions as under Windows.


      Due to this test result I am not able to show a 16:9 webcam video on a Mac which is not stretched in some 16:9 resolutions.


      Is there any chance to get around this issue?


      Please find screenshots with the cup here: http://interactive-pioneers.com/camTest/cam_squeeze_images.zip


      Thanks for your help.



        • 1. Re: webcam video looks stretched on Mac
          sinious Most Valuable Participant

          I've recently been doing a lot with webcams and I do find it's a combination of hardware and OS that determines the capabilities. Windows will almost let you do anything (including make terrible resolution decisions). Each camera has a set of specific supported resolutions for best quality however.


          Thing is, the 910 uses software compression whereas the 920 uses hardware. OS X could easily read the list of available resolutions and due to having no hardware to handle odd resolutions, OS X punts your efforts to use something out of spec because it's responsible in the end for rendering it.


          Also check this link because of the driver differences:




          Check the link in additioal information as it goes over the features available using logitec drivers versus UVC on Windows vs MacOS (it's not pretty).

          • 2. Re: webcam video looks stretched on Mac
            Adobe Agency Partner Level 1

            Thanks for your answer, sinious.


            Since I am using the UVC driver I could maybe eliminate the stretching by installing the Logitech drivers? But then I won't be able to use applications like Photobooth, iChat, FaceTime HD and QuickTime anymore, is that correct?


            What a bad option.


            Conclusion would be:

            "I don't have any chance to control how webcams will be rendered on a Mac. It depends on the webcam itself and on the fact whether it uses UVC drivers or Logitech drivers."


            Is that right?


            And one last question: will all webcams using hardware compression (like C920) run better / with no stretched image (independent from using UVC or Logitech drivers)?


            Thanks for your help.





            • 3. Re: webcam video looks stretched on Mac
              sinious Most Valuable Participant

              The driver and the camera are definitely responsible. The drivers job is to validate the incoming resolution request against the cameras capabilities and hand a feed that's as close as possible to it. The camera is clearly sending back a feed. What we can't tell is if it's the driver or the camera. Installing the Logitech driver, even temporarily, may solve that question.


              If it's the driver then when you request a resolution, it checks the capabilities of the camera and most likely gets the next highest resolution, stretches it to your request and sends it back.


              If it's the camera then it's doing something very similar. The driver makes a request for a resolution, the camera knows it doesn't support that resolution and sends something higher expecting the driver to "fix" the issue, but the UVC driver blindly sends back the data at the requested resolution.


              Typically you always install the driver on windows and/or it already has one that's completely capable installed by default so you're always getting the best experience.


              Best of luck!

              • 4. Re: webcam video looks stretched on Mac
                Adobe Agency Partner Level 1

                Thanks again for your answer, sinious.


                I have installed the Logitech drivers on my MAC - and it didn't change anything. All webcam videos are stretched in the same way as before (when running with UVC).


                I think in this case (with the C910) it shouldn't be the fault of the camera, since it supports all the different 16:9 resolutions. And all these resolutions are running fine on Windows. Isn't this a proof, that the camera itself supports alle of these resolutions?


                So on Mac it must be an issue of the drivers. UVC seems not to be able to force my webcam into the correct resolution. But Logitech drivers are not able as well.


                So it still seems that I am totally lost in solving that.


                Thanks again. Best.



                • 5. Re: webcam video looks stretched on Mac
                  sinious Most Valuable Participant

                  It appears to be so. The 920 may support more resolution options on the Mac or have better compatability. You can always grab some cams at a local retailer and test them and take back any that don't work for you.


                  You may simply need to branch the code for a Mac and do some "viewport" faking to fix the issue. Use a larger resolution than you need, then shrink it down and only show the portion of it you need at the correct aspect. It's a quick fix.


                  If that's all you need please mark the thread complete and good luck!

                  • 6. Re: webcam video looks stretched on Mac
                    Adobe Agency Partner Level 1



                    It would be ok for me to return any camera which doesn't work for me, but the software I am writing is meant for a customer whose users stream with their webcams. Therefor I have to deal with all webcams all around the world.


                    Faking the viewport is not possible as well. If I am checking the width and the height of the webcam image, it returns exactly the values which I have put into camera.setMode(). So I can't detect the distorted viewport within my code. Everything seems to be fine, even if the video image is not ok.


                    Maybe it is just an issue with C910/C920, if the following blog post is true: http://www.ambercutie.com/forums/viewtopic.php?f=15&t=7929 (beware, it is a forum of a porn site, but it deals with the technical issue).


                    But I couldn't fix it with iGlasses (as proposed in the blog post). Anyway, I think I have no solution for it.


                    Thanks again. I will close the thread now.

                    • 7. Re: webcam video looks stretched on Mac
                      sinious Most Valuable Participant

                      Ah so it's not a controlled setup like a kiosk or something. Yes you will not be able to tell if it's distorted. You'd need to put a special button on Mac to allow the user to indicate there's an aspect ratio issue and toggle it to try to fix it. If the distortion ratio is equal no matter what resolution you chose they could toggle that button and it would fix their video. It'd be um... a Mac "feature" .


                      Good luck!

                      • 8. Re: webcam video looks stretched on Mac
                        Adobe Agency Partner Level 1

                        Great idea! That is revolutionary!



                        • 10. Re: webcam video looks stretched on Mac
                          Adobe Agency Partner Level 1

                          One last thought on this topic: when using e.g. FMLE (or other encoders) on the same MAC with C910, the camera is easily switched to the correct resolution. No stretching with exactly the same resolutions I am using in my Flex app! So it seems that it can't be a driver or a hardware issue since FMLE can only use the same drivers and hardware as the Flash player does, right? So it is maybe really a bug described in the forum above. Or a bug within Flash player. Who knows...


                          This just came up into my mind. Sorry ...

                          • 11. Re: webcam video looks stretched on Mac
                            sinious Most Valuable Participant

                            If you put a 3rd party between the driver and flash, such as an encoder, it could be doing the same thing we're talking about here, fixing it for you before it hands the feed off. It very well may be a bug, I'm not discounting that. At my agency almost everyone except myself runs macs and I've heard all sorts of interesting remarks while using flash, some of which I can't repeat here .

                            • 12. Re: webcam video looks stretched on Mac

                              Hello, I think this is a Flash Player's bug....... I try to write some code in Adobe cs 5.5 in Mac and TestMovie
                              (Cs5.5's TestPlayer)IT Works prefect and no any stretched..... but I put the same swf to browser(11.4) or stand alone debugPlayer( or higher player it was broken(stretched);




                              var cam:Camera=Camera.getCamera();


                              var vid:Video=new Video();





                              • 13. Re: webcam video looks stretched on Mac


                                We are currently still running into this issue.  With web cam image capture on mac the image width is squished.  This only happends on Safari and Firefox, not on Chrome.  Has anyone incountered this issue and afound a solution?

                                • 14. Re: webcam video looks stretched on Mac
                                  sinious Most Valuable Participant

                                  As reply #12 mentioned testing in Flash works fine, that's probably because it's testing on version 10.2 by default (just trace(flash.system.Capabilities.version); and it should say 10,2,x,x). You're supposed to replace the FlashPlayerDebugger when you update to a newer versions profile so the debugger will be the correct version and this issue should happen equally inside flash (CTRL/CMD+SHIFT+ENTER to debug).


                                  Has anyone simply hard coded some values to what they desire to unstretch the video? e.g. don't set vid.width = cam.width;, hardcode it to what you want for a temporary workaround.