ossrs/srs

SRS successfully records video files locally, but the script specified in dvr_apply for callback processing after recording is not executed.

Closed this issue · 2 comments

srs.conf:

`listen 1935;
daemon off;
max_connections 1000;
log_level trace;

http_api {
enabled on;
listen 1985;
}

http_server {
enabled on;
listen 8080;
dir ./objs/nginx/html;
crossdomain on; # 允许跨域访问
}

vhost defaultVhost {
# 启用GOP缓存,减少首屏时间
gop_cache on;
dvr {
enabled on;
dvr_path /recordings/[app]/[stream]_[timestamp].mp4;
#dvr_plan segment;
dvr_plan session;
dvr_duration 3600;
# 录制完成后执行脚本上传到 MinIO
dvr_apply /scripts/upload_to_minio.sh [dvr_path];
}

# HTTP-FLV配置
http_remux {
    enabled     on;                # 启用HTTP-FLV
    mount       [vhost]/[app]/[stream].flv;  # HTTP-FLV访问路径
}

# HLS配置
hls {
    enabled     on;
    hls_path    ./objs/nginx/html/[app]/[stream];
    hls_fragment 10;
    hls_window   60;
}

}`

I have already tried: docker exec srs-srs-1 /scripts/upload_to_minio.sh /recordings/live/760011143946.mp4
The video was successfully uploaded.

How do you find the dvr_apply is config in this way?

see https://ossrs.net/lts/en-us/docs/v6/doc/dvr


About your requirement, check the http_hooks.on_dvr callback, you need to implement an http server with an endpoint to do the mp4 upload.

see https://ossrs.net/lts/en-us/docs/v6/doc/http-callback

Should follow docs.