how to consume best simulcast quality from PlainTransport?

consumer.setPreferredLayers with various temporalLayer and spatialLayer seems has no effect. scalabilityMode inside consumer.rtpParameters.encodings is ‘S2T3’

You may want to clarify the question and expose the problem better. Telling “seems has no effect” won’t make any bell ring here.

Observing situation is that: we initiate PlainTransport to get an RTP stream with a simulcast video, two qualities (full and divided by 4). All we can receive with ffmpeg is the lower quality, and tcpdump suggests that the overall bitrate on the port corresponds to just that (so i know it is not an ffmpeg issue - we are only being sent the lower quality, we cant probably receive the higher one whatever we do with ffmpeg)…

Maybe other qualities are being sent through adjacent port numbers? How does it work @ibc?

Thanks!

Please avoid direct naming, I’m not the only one that can answer questions in this forum.

First of all, try consuming the same Producer simulcast streams into a WebRTC client and see if such a client receives the preferred layers. If so, then there is a problem in the RTP capabilities that you are using in your consumer in the plain transport (for example: you are announcing support for Transport-CC or REMB in those RTP capabilities while your endpoint, ffmpeg, obviously does not support them).

This is how we trying to do it:

  1. creating PlainRtpTransport on localhost (all optional params are not specified)
  2. allocating free port and transport.connect to it
  3. consuming paused consumer from the transport with requested producerId and router.rtpCapabilities
  4. calling consumer.setPreferredLayers (tried various values)
  5. launching ffmpeg with sdp input
  6. resuming the consumer

P.S. In browser consumed stream has full resolution after some frames.

According to its stats published stream is about 1.5mbit/sec but traffic on port with 5 sec interval is much less:

while :; do /bin/bash -c "timeout 5 tcpdump -i any -e udp portrange 26386-26386 2>/dev/null" | grep -oE '[^ ]+$' | awk '{s+=$1} END {print s}'; done;
73286
31911
63510
83541
81612
76915
76450

Ask yourself why you are calling plainTransport.consume() with router.rtpCapabilities as argument and then check my previous response in this topic.

Thank you for advice! Works now, fantastic!

Great. rtpCapabilities are not “whatever that make the thing seem to work”. They MUST correspond to the REAL capabilities of the consuming endpoint. Otherwise you are telling mediasoup that the endpoint supports something, mediasoup relies on it and later things do not work.