2

I have a custom FMS app and Flash Player broadcaster which uses bandwidth detection to set quality such as:

camera.setQuality( detected_bandwidth, 0 );

This works very well to avoid frames from dropping with broadcasters with slow upload speeds but now I would like to favor dropping frames over video quality. The problem is that regardless of any other setQuality command such as:

camera.setQuality( detected_bandwidth, 90 );

or

camera.setQuality( 0, 90 );

I get much better picture quality with dropped frames as desired but the way the frames are dropped is very inconsistent and produces very jerky video. For example it seems about 3 or 4 frames play and then a pause and then 3 or 4 more then another pause, and so on.

I've also tried many buffer settings with no luck. Is there a way to smooth out the frame dropping so it's more like 1 frame, pause, 1 frame, pause, etc?

Gattster
  • 4,613
  • 5
  • 27
  • 39
  • You may also want to adjust your keyframe interval based on the bandwidth and possibly the amount of motion detected on the camera. http://livedocs.adobe.com/flashmediaserver/3.0/hpdocs/help.html?content=00000135.html – Paul Gregoire Jun 08 '12 at 20:30

2 Answers2

1

No silver bullet, but I have some hacks you could try.

You could consider modifying your camera capture frame rate based on the bandwidth detection result. (I assume you're allowing some space for any audio being sent?).

I've never tried this, but if the camera also needs to be displayed locally at full FPS, you could try dynamically attaching and detaching the camera to and from the netstream to simulate the low framerate of your choice - although this might result in each frame being a keyframe which is a waste of bandwidth.

I'd raise your camera keyframe interval to the maximum of 48 if you haven't already - each keyframe will certainly result in a pause in low bandwidth situations. Alternatively - you could use a keyframe interval of 1, meaning each frame is a keyframe. You'll waste bandwidth, but because each frame will take a while to send the runtime shouldn't queue a bunch of them up in the outbound buffer, and you may end up with a more stable stream.

David Hogan
  • 549
  • 6
  • 6
1

Try modify cam.setMode() to have a small resolution. The setQuality modifies the quality and can reduce bandwidth, but if your camera mode has a high resolution then it is sending a lot of pixel data each frame.

Also, try with different webcams because different webcams produce different results sometimes.

K2xL
  • 9,730
  • 18
  • 64
  • 101