Skip to content

runner365/srt_encoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English | 中文

SRT Encoder

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.

1. introduction

The encoder estimate the output bitrate based on rtt, maxBw, inflight and use the bbr algorithem to implement the adaptive bitrate encoder.

2. how to compile

The ffmpeg depends on libsrt, libx264, libfdk_aac.

2.1 replace ffmpeg.c

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

2.2 compile ffmpeg

go to wiki:How to compile

3. how to use it

3.1 srt in srs

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

3.2 srt encoder

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

About

srt encoder

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages