ffmpeg拉流支持指定命令模板

This commit is contained in:
xiongziliang
2021-01-23 09:42:15 +08:00
parent f63b2b1863
commit af2481c619
3 changed files with 24 additions and 10 deletions

View File

@@ -55,12 +55,13 @@ public:
/**
* 开始播放url
* @param ffmpeg_cmd_key FFmpeg拉流命令配置项key用户可以在配置文件中同时设置多个命令参数模板
* @param src_url FFmpeg拉流地址
* @param dst_url FFmpeg推流地址
* @param timeout_ms 等待结果超时时间,单位毫秒
* @param cb 成功与否回调
*/
void play(const string &src_url, const string &dst_url, int timeout_ms, const onPlay &cb);
void play(const string &ffmpeg_cmd_key, const string &src_url, const string &dst_url, int timeout_ms, const onPlay &cb);
/**
* 设置录制
@@ -93,6 +94,7 @@ private:
MediaInfo _media_info;
string _src_url;
string _dst_url;
string _ffmpeg_cmd_key;
function<void()> _onClose;
Ticker _replay_ticker;
};