title: How to change rtp payload type when using gst-launch with rtph264pay
body: <p>I'm streaming h264 from a file using gst for python and triggering the video sending using gst.parse_launch(...). I need to change the payload type to 35 from default 96. According to examples and documentation it seems like one should be able to do it by setting the pt property on rtph264pay, "<strong>rtph264pay pt=35</strong>". NOTE: <a href="http://gstreamer-devel.966125.n4.nabble.com/rtsp-h264-problem-td4658114.html" rel="nofollow noreferrer">BOSCH used to use 35 when sending h264 data</a>.</p>
  
  <p>If setting the value to between 0-95, when examining the rtp packet in wireshark I see that it is still set to 96. <strong>Setting a value above 95 is accepted and makes its way into the rtp packet sent out.</strong></p>
  
  <p>Another question here is trying to achieve almost the same thing but on the receiving side and implementing in C, not python.
  <a href="https://stackoverflow.com/questions/29250308/gstreamer-rtspsrc-and-payload-type">Gstreamer, rtspsrc and payload type</a></p>
  
  <p>Example from documentation:
  <a href="https://gstreamer.freedesktop.org/documentation/tools/gst-launch.html" rel="nofollow noreferrer">https://gstreamer.freedesktop.org/documentation/tools/gst-launch.html</a> See Network streaming</p>
  
  <p>The base rtp payload class has the property:
  <a href="https://www.freedesktop.org/software/gstreamer-sdk/data/docs/latest/gst-plugins-base-libs-0.10/gst-plugins-base-libs-gstbasertppayload.html#GstBaseRTPPayload--pt" rel="nofollow noreferrer">https://www.freedesktop.org/software/gstreamer-sdk/data/docs/latest/gst-plugins-base-libs-0.10/gst-plugins-base-libs-gstbasertppayload.html#GstBaseRTPPayload--pt</a></p>
  
  <p>Derived h264 payload class seems to have the pt range limitation:
  <a href="https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good/html/gst-plugins-good-plugins-rtph264pay.html" rel="nofollow noreferrer">https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good/html/gst-plugins-good-plugins-rtph264pay.html</a></p>
  
  <p><strong>My command line arguments to gst-launch looks like this:</strong></p>
  
  <blockquote>
    <p>video/x-h264,width=352,height=288,framerate=(fraction)25/1 ! identity
    sleep-time=15000 sync=true ! h264parse ! rtph264pay config-interval=1
    pt=35 ! queue !  udpsink sync=true</p>
  </blockquote>
  
  <p>Any ideas on how to get around this?
  Do I need to patch the pt property setting function or is there any less invasive way?</p>
  
  <p><strong>Updates:</strong>
  I can't seem to find where in the code the actual enforcing of >95 occurs, the rtph264pay implementation does not even mention the pt property and the rtpbasepayload implementation does not seem to enforce any other restriction to the property than the min(0) and max(127), all other operations are just assignments which eventually end up in the header of the rtp package.</p>
  
  <pre><code>g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_PT,
        g_param_spec_uint ("pt", "payload type",
            "The payload type of the packets", 0, 0x7f, DEFAULT_PT,
            G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  </code></pre>
  
  <p>With debug output enabled(<em>pay</em>:6) one notices that it talks about <strong>using the peer pt 96</strong>, unfortunately the output is exactly(except the actual #) the same when setting pt=35(which gets set to default 96) vs pt=97 which keeps pt=97 so that does not in any way indicate that the requested value was replaced with the default value.</p>
  
  <p><strong>Using pt=35:</strong></p>
  
  <pre><code>rtpbasepayload gstrtpbasepayload.c:843:gst_rtp_base_payload_negotiate:&lt;rtph264pay0&gt; using peer pt 96
  ...
  rtpbasepayload gstrtpbasepayload.c:901:gst_rtp_base_payload_negotiate:&lt;rtph264pay0&gt; with peer caps: application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)"Z2QAFKzZQXCH5v/AXEBcBAAUXYwExLQCPFCmWA\=\=\,aOvssiw\=", payload=(int)96, ssrc=(uint)23420509, timestamp-offset=(uint)66866867, seqnum-offset=(uint)11269
  </code></pre>
  
  <p>vs <strong>Using pt=97:</strong></p>
  
  <pre><code>rtpbasepayload gstrtpbasepayload.c:843:gst_rtp_base_payload_negotiate:&lt;rtph264pay0&gt; using peer pt 97
  ...
  rtpbasepayload gstrtpbasepayload.c:901:gst_rtp_base_payload_negotiate:&lt;rtph264pay0&gt; with peer caps: application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)"Z2QAFKzZQXCH5v/AXEBcBAAUXYwExLQCPFCmWA\=\=\,aOvssiw\=", payload=(int)97, ssrc=(uint)23420509, timestamp-offset=(uint)66866867, seqnum-offset=(uint)11269
  </code></pre>