Git Product home page Git Product logo

srs_ingest_helper's Introduction

srs_ingest_helper

作用

此程序用于控制ffmpeg进程拉流并转推srs,实现自定义拉流。

原理

SRS实现了拉流功能,但是此功能需要修改配置文件,且不提供API,如果需要动态添加或删除拉流任务,自己修改配置文件是比较麻烦的。
SRS内部是通过ffmpeg实现拉流的,就是启动一个ffmpeg进程,把流拉过来,再推给SRS,其实这个工作我们自己也可以做,而且做的更加自动化。
这就是此程序所做的工作了。

编译和使用

执行下列命令进行编译,没有其他依赖
(注意:centos7 用的gcc 4.8的regex有bug,httplib.hpp用到了regex,所以在centos7上要用gcc 4.8以上的版本编译,gcc5.x 6.x 等等,否则运行时报错 std::regex error)
参见: https://github.com/yhirose/cpp-httplib#g

cd src
make -j4

ffmpeg和SRS程序要放到bin目录下,程序启动后会自动启动SRS,并读取tasks.csv中保存的任务,启动ffmpeg进程进行拉流。

SRS的编译参见SRS项目主页 https://github.com/ossrs/srs

ffmpeg的编译参见https://github.com/markus-perl/ffmpeg-build-script

API

程序对外提供http json api,用于添加和删除媒体源。

GET http://localhost:8086/addstream?src=rtmp://abc.com/live/my&dest=/live/my
GET http://localhost:8086/delstream?dest=/live/my
GET http://localhost:8086/listmedia

json API 详情参见 api.txt

release

如果不想编译只要程序,可以点击 release 下载编译后的程序 (包含ffmpeg和srs,可直接运行于centos 7.6 ubuntu 18.04)

srs_ingest_helper's People

Contributors

alongl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

srs_ingest_helper's Issues

api请求不了

请求命令行就报错
terminate called after throwing an instance of 'std::regex_error'
what(): regex_error

拉流能不能暂停

想请教下大佬,在采集过程中,能不能实现暂停,暂停后保持采集源的连接,但不获取视频流,也不推流,恢复后才继续获取流进行推流。前提是保持连接不断开,场景是这样的,源视频流 有时间防盗链时间鉴权,如果断开连接,再次请求就失效了。如果一直连接,并一直拉流,对带宽消耗又比较大。只需要保持连接,需要的时候恢复拉流。不知道这个想法ffmpeg是否能够实现。对ffmeg不熟悉,所以请教下大佬。感谢

二进制安装的srs_ingest_helper 启动后,浏览器访问http://ip:8086 服务就宕了 这是为什么啊?

[2022-03-31 20:04:24.987][Trace][8022][0] XCORE-SRS/3.0.141(OuXuli)
[2022-03-31 20:04:24.988][Trace][8022][0] config parse complete
[2022-03-31 20:04:24.988][Trace][8022][0] write log to file ./logs/srs.log
[2022-03-31 20:04:24.988][Trace][8022][0] you can: tailf ./logs/srs.log
[2022-03-31 20:04:24.988][Trace][8022][0] @see: https://github.com/ossrs/srs/wiki/v1_CN_SrsLog
terminate called after throwing an instance of 'std::regex_error'
what(): regex_error
Aborted

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.