views:

103

answers:

3

For the purpose of my testing, I am using a Logitech Quickcam 9000 which records in a 4:3 resolution (640x480, 320x240, etc). I am using a custom flash app to relay from the webcam to Wowza media server (then to our users).

When I record in the app and playback at 240x180, everything looks great. When I record in the app and playback at 480x360 (x2 dimensions), everything looks great. When I record in the app and playback at 360x270, it looks awful (pixelations / artifacts).

Why does it work fine at 240x80 and 480x360 but not anywhere in between? Is this due to my cam broadcasting a certain resolution and flash not taking it to a 1.5x resolution properly or what? Any feedback would be appreciated.

+1  A: 

Integer zoom factors scale up nicely, because 1 pixel in the source = a set number of pixels in the result. For instance, 2x zooming a 2-by-2 pixel grid is simple, like this:

12    becomes     1122
34                1122
                  3344
                  3344

Non-integer zoom factors require the player to interpolate what pixels should be, since (in your example) 2 pixel lengths in the source become 3 pixel lengths in the result - so how do you decide what that middle pixel's value should be? It's an imperfect task which, depending on the algorithm used, can often result in less-than-perfect results.

Amber
Do you mean '1122\n1122\n3344\n3344'? i.e. 2x zoom in both dimensions? (excuse the formatting; best I could think of in a comment!)
Dave Rigby
Oops, yep, let me edit that.
Amber
+1  A: 

It sounds like 240x180 and 480 x 360 are "native" resolutions of the webcam. When you try to playback at resolutions other than these two, the playback software must perform a conversion. Clearly that conversion process is less than ideal.

Robert Harvey
A: 

Its depends on the sampling methodology, eg Linear vs BiCubic etc, plus the fact that actual pixels are not always true sqaures (sometimes) they are slightly wider than tall.

The best way to upsample from my experience is to upsample beyound the target resolution then downsample to your target resolution using bicubic method at each stage:

Darknight