English | 中文
An adaptive encoder based on SRT.
The encoder estimate the output bitrate based on rtt, maxBw, inflight to implement the adaptive bitrate encoder.
- ffmpeg commnand
It only need to replace ffmpeg.c and add srt_header.h in fftools fold. Then compile the ffmpeg which supports the adaptive encoder. - based on srt protocol
srt is a simple, low latency, high efficient transport protocol. - based on bbr congestion algorithem
It estimates the bitrate by bbr.
The encoder estimate the output bitrate based on rtt, maxBw, inflight and use the bbr algorithem to implement the adaptive bitrate encoder.
The ffmpeg depends on libsrt, libx264, libfdk_aac.
The adaptive encoder is developed based on ffmpeg4.1/ffmpeg5.1. It need to replace ffmpeg.c and add srt_header.h in fftools fold.
ffmpeg4.1 official download: ffmpeg-4.1.tar.xz.
ffmpeg5.1 from git:ffmpeg.org
go to wiki:How to compile
srs is live server which supports rtmp/hls/rtp live service.
Now it supports srt live service in "develop" branch.
srs github:https://github.com/ossrs/srs
How to use srt service in srs,go to wiki:v4_CN_SRTWiki
run command:
ffmpeg -re -i source.mp4 -c:v libx264 -s 640x360 -b:v 700k -c:a libfdk_aac -ab 64k -ar 44100 -ac 2 -f mpegts 'srt://127.0.0.1:10080?streamid=#!::h=live/livestream,m=publish'
Note:
- can't configure -crf
crf can't be configured because crf mode conflict with the adaptive bitrate mode in ffmpeg. - can't configure -qp
qp can't be configured because qp mode conflict with the adaptive bitrate mode in ffmpeg. - the media format must be mpegts in srt