Thanks very much for your help Simon.<br><br>I don't seem to have good luck working with any of ptlib 2.10 on windows but i'll try 2.9. <br><br>Just for curiosity, you mentioned that one can change the bit rate during a call which i had not thought was possible, but in the case of h.264, how would one go about doing so?<br>
<br>Thanks!<br><br>Josh<br><br><br><div class="gmail_quote">On Thu, Nov 24, 2011 at 4:36 PM, Simon Horne <span dir="ltr"><<a href="mailto:s.horne@packetizer.com">s.horne@packetizer.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div link="blue" vlink="purple" lang="EN-US"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Josh<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Yes you are correct  FlowControl for the InputDevice (change frame size and rate) requires PTLIB 2.9 or above. Also FlowControl is not supported on H.263 or H.261 which have fixed frame sizes. In H.264 you pass to the plugin the required bitrate and it will return an appropriate frameWidth, FrameHeight and FrameRate to match the proposed BitRate. In H.263 and H.261 the framesize is more rigid (CIF,QCIF) so really you can only adjust the FrameRate. <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">For H.261/H.263 If you set <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">mediaFormat.SetBandwidth(yourrate) if SetFlowControl() fails in the </span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">H323PluginVideoCodec::SetMaxBitRate(unsigned bitRate)  function then you’ll force the remote via the TCS to that bitrate. Then in your OpenVideoChannel you set your inputdevice to a matching FrameRate (ie 128kbps/327kbps * 30 = 12)  then that should be a workaround to get the bitrate in both directions.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">The limitation is you will not be able to change the bitrate during the call.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Simon<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:h323plus-bounces@lists.packetizer.com" target="_blank">h323plus-bounces@lists.packetizer.com</a> [mailto:<a href="mailto:h323plus-bounces@lists.packetizer.com" target="_blank">h323plus-bounces@lists.packetizer.com</a>] <b>On Behalf Of </b>J.C Mercier<br>
<b>Sent:</b> 25 November 2011 07:04<br><b>To:</b> Simon Horne<br><b>Cc:</b> <a href="mailto:h323plus@lists.packetizer.com" target="_blank">h323plus@lists.packetizer.com</a><br><b>Subject:</b> Re: [h323plus] Changing video codec transmit bit rate<u></u><u></u></span></p>
<div><div></div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal" style="margin-bottom:12.0pt">Thanks Simon for your prompt response.<br><br>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 128kbps.<br>
<br>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?<br><br>I traced the SetMaxBitRate function, and it was called by the descendant class in plugin, which is correct, which in turn looks as follows;<br>
<br>PBoolean H323PluginVideoCodec::SetMaxBitRate(unsigned bitRate)  <br>{ <br>    if (SetFlowControl(codec,context,mediaFormat,bitRate/100)) {<br>         frameWidth = mediaFormat.GetOptionInteger(OpalVideoFormat::FrameWidthOption); <br>
         frameHeight =  mediaFormat.GetOptionInteger(OpalVideoFormat::FrameHeightOption);<br>         targetFrameTimeMs = mediaFormat.GetOptionInteger(OpalVideoFormat::FrameTimeOption);<br>         mediaFormat.SetBandwidth(bitRate);<br>
         return true;<br>    }<br>    return false;<br>}<br><br>the SetFlowControl always returns false with the following message;<br><br> - > "No Flow Control supported in codec"<br><br>Any ideas or other suggestions you may provide will be greatly appreciated.<br>
<br>Thanks<br><br>Josh <br><br><u></u><u></u></p><div><p class="MsoNormal">On Thu, Nov 24, 2011 at 2:29 PM, Simon Horne <<a href="mailto:s.horne@packetizer.com" target="_blank">s.horne@packetizer.com</a>> wrote:<u></u><u></u></p>
<p class="MsoNormal">Josh<br><br>Unfortunately the OpenVideoChannel is called after the H.245 TCS stage so<br>you cannot use it to negotiate a bandwidth limit for a call.<br><br>To set the Initial Bandwidth limit in the TCS there is a callback which is<br>
called when building.<br>H323EndPoint::OnSetInitialBandwidth(H323VideoCodec * codec);<br><br>So you could do something like this in your code<br><br>void MyH323EndPoint::OnSetInitialBandwidth(H323VideoCodec * codec)<br>{<br>
       unsigned bitrate = <your rate in kbps> * 1000;<br>       if ((bitrate != 0) && (codec->GetMediaFormat().GetBandwidth() ><br>bitrate)) {<br>               PTRACE(4,"My\tAdjusting maximum video bitrate to " <<<br>
bitrate);<br>               codec->SetMaxBitRate(bitrate);<br>       }<br>}<br><br>During a call the bitrate may change via FlowControl requests but will not<br>exceed the value you set in this callback.<br><br>Simon<br>
<br><br>-----Original Message-----<br>From: <a href="mailto:h323plus-bounces@lists.packetizer.com" target="_blank">h323plus-bounces@lists.packetizer.com</a><br>[mailto:<a href="mailto:h323plus-bounces@lists.packetizer.com" target="_blank">h323plus-bounces@lists.packetizer.com</a>] On Behalf Of J C Mercier<br>
Sent: 25 November 2011 05:08<br>To: <a href="mailto:h323plus@lists.packetizer.com" target="_blank">h323plus@lists.packetizer.com</a><br>Subject: [h323plus] Changing video codec transmit bit rate<u></u><u></u></p><div><div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>Hi all,<br><br>How would one go about adjusting the video codec max transmission bit rate?<br><br>I understand thus can be done in OpenVideoChannel by calling<br>codec.SetMaxBitRate but I I get  no flow control supported when I attempted<br>
to do so.<br><br>I am using v 1.23 for H323plus downloaded from <a href="http://h323plus.org" target="_blank">h323plus.org</a> and pitlib v<br>2.8.5. I noticed that flow control is not supported in ptlib less than 2.9<br>
but would there be another way of changing the bit rate?<br><br>Thanks!<br><br>Josh C.<u></u><u></u></p></div></div></div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></blockquote></div><br><div style="visibility: hidden; left: -5000px;" id="avg_ls_inline_popup">
</div>