Can't get adaptive bitrate to work
I'm trying to use srt_encoder on android as a proxy for gopro camera. Gopro only support rtmp and fixed bitrate but I'm willing to stream using mobile network. So srt_encoder looks like the solution I'm looking for to transcode the stream from gopro and adapt its bitrate to available network bandwidth. I successfully patched and built ffmpeg 4.1 but no matter of network quality bitrate stays the same. I'm using srs v5 as ingest server and MediaMTX v1.4.1 as an intermediate between gopro and ffmpeg. Ffmpeg cmd I'm using is
ffmpeg -re -i rtmp://127.0.0.1:1935/live/app -c:v libx264 -preset ultrafast -tune zerolatency -s 1920x1080 -b:v 8000k -c:a libfdk_aac -ab 256k -ar 44100 -ac 2 -f mpegts 'srt://192.168.0.10:10080?streamid=#!::r=live/livestream,m=publish'
No matter of network quality I always get bitrate close to 8000kbits/s in ffmpeg output. During bandwidth decay I receive distorted green image from server and log messages like:
23:57:15.371578/ffmpeg*E:SRT.d: SND-DROPPED 28 packets - lost delaying for 1053ms
23:57:15.414464/ffmpeg*E:SRT.d: SND-DROPPED 30 packets - lost delaying for 1057ms
23:57:15.472241/ffmpeg*E:SRT.d: SND-DROPPED 76 packets - lost delaying for 1056ms
23:59:37.487461/ffmpeg*E:SRT.d: SND-DROPPED 23 packets - lost delaying for 1034ms speed= 1x
23:59:37.568686/ffmpeg*E:SRT.d: SND-DROPPED 73 packets - lost delaying for 1084ms
23:59:37.590556/ffmpeg*E:SRT.d: SND-DROPPED 30 packets - lost delaying for 1040ms
00:00:29.036114/ffmpeg*E:SRT.d: SND-DROPPED 39 packets - lost delaying for 1032ms speed= 1x
00:00:29.077818/ffmpeg*E:SRT.d: SND-DROPPED 27 packets - lost delaying for 1022ms
00:00:29.115939/ffmpeg*E:SRT.d: SND-DROPPED 8 packets - lost delaying for 1043ms
What am I doing wrong?