[h323plus] Changing video codec transmit bit rate

J.C Mercier jcmerc5 at gmail.com
Thu Nov 24 16:03:57 EST 2011

Thanks Simon for your prompt response.

Having tested the code as suggested, it seems that the bit rate still
remains at 327kbps for the h.263 codec after i attempted to set it to

Is it possible that because this version of ptlib (2.8.5) does not support
flow control, changing the bit rate will not take affect?

I traced the SetMaxBitRate function, and it was called by the descendant
class in plugin, which is correct, which in turn looks as follows;

PBoolean H323PluginVideoCodec::SetMaxBitRate(unsigned bitRate)
    if (SetFlowControl(codec,context,mediaFormat,bitRate/100)) {
         frameWidth =
         frameHeight =
         targetFrameTimeMs =
         return true;
    return false;

the SetFlowControl always returns false with the following message;

 - > "No Flow Control supported in codec"

Any ideas or other suggestions you may provide will be greatly appreciated.



On Thu, Nov 24, 2011 at 2:29 PM, Simon Horne <s.horne at packetizer.com> wrote:

> Josh
> Unfortunately the OpenVideoChannel is called after the H.245 TCS stage so
> you cannot use it to negotiate a bandwidth limit for a call.
> To set the Initial Bandwidth limit in the TCS there is a callback which is
> called when building.
> H323EndPoint::OnSetInitialBandwidth(H323VideoCodec * codec);
> So you could do something like this in your code
> void MyH323EndPoint::OnSetInitialBandwidth(H323VideoCodec * codec)
> {
>        unsigned bitrate = <your rate in kbps> * 1000;
>        if ((bitrate != 0) && (codec->GetMediaFormat().GetBandwidth() >
> bitrate)) {
>                PTRACE(4,"My\tAdjusting maximum video bitrate to " <<
> bitrate);
>                codec->SetMaxBitRate(bitrate);
>        }
> }
> During a call the bitrate may change via FlowControl requests but will not
> exceed the value you set in this callback.
> Simon
> -----Original Message-----
> From: h323plus-bounces at lists.packetizer.com
> [mailto:h323plus-bounces at lists.packetizer.com] On Behalf Of J C Mercier
> Sent: 25 November 2011 05:08
> To: h323plus at lists.packetizer.com
> Subject: [h323plus] Changing video codec transmit bit rate
> Hi all,
> How would one go about adjusting the video codec max transmission bit rate?
> I understand thus can be done in OpenVideoChannel by calling
> codec.SetMaxBitRate but I I get  no flow control supported when I attempted
> to do so.
> I am using v 1.23 for H323plus downloaded from h323plus.org and pitlib v
> 2.8.5. I noticed that flow control is not supported in ptlib less than 2.9
> but would there be another way of changing the bit rate?
> Thanks!
> Josh C.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.packetizer.com/pipermail/h323plus/attachments/20111124/3de480cd/attachment.htm>

More information about the h323plus mailing list