Skip to main content
October 24, 2011
Answered

Camera.setQuality() not working for H.264 enconding in Flash Player 11?

  • October 24, 2011
  • 2 replies
  • 3741 views

Hi,

I am using the new Flash Player 11 ability to encode the webcam video with H264 codec and send it via RTMP to a Flash Media Server. It works, but the bitrate of the video stream is not constant. Therefore the resulting stream is stuttering when playing back.

I tested it in two ways:

A) Encoding and sending the webcam video to FMS via FMLE -> very fluent playback

B) Encoding and sending the webcam video to FMS via Flash Player 11 (all setting for codec etc. are the same) -> playback is stuttering

As you can see in the screenshots below, the incoming bandwidth at FMS varies a lot. When using FMLE the incoming bitrate at the FMS is very constant:

In contrast: when using FP11, the bitrate jumps between 1000 and 6000 kbps during the whole stream:

That is definitely the reason why it "stutters" when using Flash Player 11. But I have no idea what I am doing wrong.

I am using these encoding settings for FP11 ...

var videoStreamSettings : H264VideoStreamSettings = new H264VideoStreamSettings();

videoStreamSettings.setKeyFrameInterval(5);

videoStreamSettings.setMode(1280,720, 25);

videoStreamSettings.setProfileLevel(H264Profile.BASELINE, H264Level.LEVEL_5_1);

videoStreamSettings.setQuality(1000000, 0);

... and these settings for the camera:

var camera : Camera = Camera.getCamera(0);

camera.setQuality(1000000, 0);

camera.setKeyFrameInterval(5);

camera.setMode(1280, 720, 25);

Any idea why the bandwith is not constant in FP11? The function camera.setQuality() should do the job, right (http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fla sh/media/Camera.html#setQuality%28%29)? Is there any known bug for Camera.setQuality when using H.264 encoding in FP11?

Thanks a lot.

Malte

This topic has been closed for replies.
Correct answer Jozsef_V

In Flash Player 11, we used variable bit rate (VBR) mode for rate control. This has been changed to constant bit rate (CBR) in the next version, so you should expect much better results.

You should also use RTMFP instead of RTMP for the uplink. That should significantly improve your video smoothness.

Jozsef

2 replies

Participant
December 31, 2011

hi,

has there been any updates? is the latest fp now uaing cbr?

peter

Participating Frequently
December 31, 2011

Yes, we have released Flash Player 11,1,102,55 on Nov. 10, which uses cbr for h.264 encoding.

Jozsef

Jozsef_VCorrect answer
Participating Frequently
October 25, 2011

In Flash Player 11, we used variable bit rate (VBR) mode for rate control. This has been changed to constant bit rate (CBR) in the next version, so you should expect much better results.

You should also use RTMFP instead of RTMP for the uplink. That should significantly improve your video smoothness.

Jozsef

October 26, 2011

Hi Jozsef,

thanks for your answer. In which version and on which date will the CBR be implemented? Flash Player 12? Or a minor release of FP11?

And until then I have no chance to have a constant bitrate? The bitrate I am passing to Camera.setQuality will just be ignored? Or is there any workaround?

Thanks and I will test using RTMFP instead of RTMP, but the CBR is the most important thing for us.

Best

Participating Frequently
October 26, 2011

Next version, definitely before 12. Private prelease probably already available.

Jozsef