Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get no RTCP packets in the sender #13

Open
j-licht opened this issue Mar 27, 2019 · 9 comments
Open

Get no RTCP packets in the sender #13

j-licht opened this issue Mar 27, 2019 · 9 comments

Comments

@j-licht
Copy link

j-licht commented Mar 27, 2019

I've tried to run sender and receiver on two different gentoo systems.
But the sender is always saying: "RTP queue discarded for SSRC"

By commenting out some debugging code in the sender plugin, I think the RTCP receive callback was never fired.
My workaround for now was to don't set the bind-port parameter of the udpsinks and -srcs.
As I see gstreamer sets reuse on the UDP sockets by default, so actually it should work.

@IngJohEricsson
Copy link
Contributor

Hi
Did you get it working ?.
You will get those RTP queue discarded messages when the RTCP feedback is received, either IP addresses are not properly set, or ports are blocked.

My impression is that I needed to set bind-port and port to the same values to get the RTCP packets pass through a NAT and/or FW when using an LTE modem.
The ideal situation would be to have RTP and RTCP on the same port but I have so far not managed to make that work.

@j-licht
Copy link
Author

j-licht commented Mar 27, 2019

I tried for now without NAT.

I used this for sending:
gst-launch-1.0 rtpbin name=rtpbin rtp-profile=avpf ! videotestsrc is-live=1 ! videoconvert ! video/x-raw,width=190,height=1080,framerate=30/1 ! x264enc name=video key-int-max=50 tune=4 vbv-buf-capacity=200 ! rtph264pay ! gscreamtx media-src=0 ! rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0 ! udpsink host=169.254.15.230 port=5000 rtpbin.send_rtcp_src_0 ! udpsink host=169.254.15.230 port=5001 async=0 sync=0 udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0

And this for receiving:
gst-launch-1.0 rtpbin name=rtpbin udpsrc port=5000 ! gscreamrx ! application/x-rtp,media=video,clock-rate=90000,encoding-name=H264 ! rtpbin.recv_rtp_sink_0 rtpbin. ! rtph264depay ! avdec_h264 ! videoconvert ! xvimagesink sync=false async=false udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 rtpbin.send_rtcp_src_0 ! udpsink port=5001 host=169.254.246.191 sync=false async=false

I dont't see the PTR1 debug output from

//g_print(" PTR1 %x %x %x\n", filter, filter_ , session);
, so therefore I think I got no RTCP data in the sender.

@IngJohEricsson
Copy link
Contributor

Hi
I tried with the above both with videotestsrc and v4l2src it it seems to work. I ran the test between two Ubuntu 18 Laptops over a local network.

@j-licht
Copy link
Author

j-licht commented Mar 27, 2019

Yes the both above work as well for me too.

But when I add the bind-port to the udpsink, which transports the rtcp in the sender, like this:
gst-launch-1.0 rtpbin name=rtpbin rtp-profile=avpf ! videotestsrc is-live=1 ! videoconvert ! video/x-raw,width=190,height=1080,framerate=30/1 ! x264enc name=video key-int-max=50 tune=4 vbv-buf-capacity=200 ! rtph264pay ! gscreamtx media-src=0 ! rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0 ! udpsink host=169.254.15.230 port=5000 rtpbin.send_rtcp_src_0 ! udpsink host=169.254.15.230 bind-port=5001 port=5001 async=0 sync=0 udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0
then I have the problem.

@IngJohEricsson
Copy link
Contributor

Seems like I don't manage to recreate this problem,.. That said, I actually had problems getting this to work when I tested with a Sierra RV50X LTE modem, but it worked fine with an LTE dongle (the same sim card in both cases). I guess the best way to solve this is make RTP and RTCP mux over the same port, but I have not managed to get this working yet.
/I

@biswaranjanpanigrahi
Copy link

Was able to receive the RTCP Feedback packets with below sender and receiver. Running two separate instance on Ubuntu sitting in office env. If it is set to 5001 as suggested RTCP Feedback messages are not recevied

Sender: Here source Port I had updated to 5002

gst-launch-1.0 rtpbin name=rtpbin ! v4l2src device=/dev/video0 ! 'video/x-raw,width=640,height=480,framerate=30/1' ! videoconvert ! x264enc name=video tune=zerolatency ! rtph264pay ! gscreamtx media-src=0 ! rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0 ! udpsink host=$RECEIVER_IP port=5000 bind-port=5000 rtpbin.send_rtcp_src_0 ! udpsink host=$RECEIVER_IP bind-port=5001 port=5001 udpsrc port=5002 ! rtpbin.recv_rtcp_sink_0

Receiver: Here Udp Sink port set to 5002
gst-launch-1.0 rtpbin name=rtpbin udpsrc port=5000 ! gscreamrx ! application/x-rtp,media=video,clock-rate=90000,encoding-name=H264 ! rtpbin.recv_rtp_sink_0 rtpbin. ! rtph264depay ! avdec_h264 ! videoconvert ! xvimagesink sync=false async=false udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 rtpbin.send_rtcp_src_0 ! udpsink port=5002 bind-port=5001 host=$SENDER_IP sync=false async=false

Would like to know how does the congestion window work in this case, size being passed during init e.g. 50000 (is it bytes?), I see the window size does not increase beyond 50000 but decrease even though the bandwidth between the two laptops connected over same Wifi is 12Mbps.

On an AVG the congestion window size remains around 15000 to 25000 (I believe this values are in bytes?)

The Bit rate passed in the register for new stream for x264enc is same as per the existing code set 1000000 (I believe its bps) i.e is around 1Mbps (as per targetBitrate = std::min(maxBitrate, std::max(minBitrate, startBitrate_));)
If I increase the value I see more packet loss as well as garbled video getting played in receiver.

So if we go as per Bit rate, Its sending out 1MB of data but the congestion window stays at very lower value.

Could you please help me to explain more on this algorithm?

@IngJohEricsson
Copy link
Contributor

IngJohEricsson commented May 2, 2019 via email

@biswaranjanpanigrahi
Copy link

Thanks for your response, with my changes mentioned earlier as well as with your suggestion (to remove bind port) was able to receive the RTCP FEEDBACK packet.

Log Snippet:

on_receiving_rtcp GST_RTCP_TYPE_RTPFB
RTP begin_seq= 4392 end_seq=4455
ScreamTx::updateCwnd maxBytesInFlight>5000 CWND: 18915

Code Snippet:

filter->screamTx = new ScreamTx(0.8f, 0.9f, 0.1f, false, 1.0f, 2.0f, 50000, 0.0f, 20, false, false);

As you can see the log snippet the cwnd has come down to 18915 where as it was set to 50000.

Question: Is Congestion Window not the total number of packets transmitted? but only count of packets that are not acked?

Could you please let me know how to get the total number of packets sent out? Is it same as the bitrate set? i.e 1Mbps as per the existing code.

Code Snippet:

switch (filter_->media_src) {
case 0:
filter->screamTx->registerNewStream(filter->rtpQueue, ssrc_h, 1.0f, 300e3f, 1000e3f, 15e6f, 5e6f, 0.3f, 0.2f, 0.1f, 0.2f);

Second question: Is when media source is 0 i.e x264enc why is the rate reduced? and set to the encoder in the filter. I would like to increase the bit rate from the sender side how could I achieve that?
And in case of congestion detected does the algorithm also optimize Bit Rate and Resolution? from the sender side.

switch (filter_->media_src) {
case 0: // x264enc
case 3: // vaapih264enc
rate /= 1000;
....

g_object_set(G_OBJECT(filter_->encoder), "bitrate", rate, NULL);
...

Third Question: At the receiver there is no action for the sender report (RTCP) packet from sender?

Best Regards
Biswa

@IngJohEricsson
Copy link
Contributor

IngJohEricsson commented May 3, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants