Skip to main content
June 22, 2012
Answered

webcam video looks stretched on Mac

  • June 22, 2012
  • 2 replies
  • 17795 views

Hi,

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.

Malte

This topic has been closed for replies.
Correct answer sinious

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!

2 replies

Participant
November 1, 2012

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(11.2.202.228) or higher player it was broken(stretched);

Code:

var cam:Camera=Camera.getCamera();

cam.setMode(640,360,30,true);

var vid:Video=new Video();

vid.width=cam.width;

vid.height=cam.height;

vid.attachCamera(cam);

addChild(vid);

Participating Frequently
February 24, 2014

Hi.

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?

sinious
Legend
February 24, 2014

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.

sinious
Legend
June 23, 2012

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:

http://logitech-en-amr.custhelp.com/app/answers/detail/a_id/25726

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).

June 25, 2012

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.

Best

Malte

sinious
siniousCorrect answer
Legend
June 25, 2012

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!