nginx - 在 http 连接上触发 exec_pull
问题描述
exec_pull
是否可以在http连接上触发?例如,我有以下Nginx配置:
server {
listen 80;
location /hls {
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /mnt;
add_header Cache-Control no-cache;
index index.m3u8 index.ts;
add_header Access-Control-Allow-Origin *;
}
}
}
rtmp {
server {
listen 1935;
allow play all;
application hls {
live on;
exec_options on;
exec_pull /usr/bin/ffmpeg -re -i http://example.com:333/293.m3u8 -c copy -f flv rtmp://localhost:1935/hls/$name;
}
application hls {
live on;
hls on;
hls_path /mnt/hls;
hls_fragment 3s;
}
}
}
我想exec_pull
触发 HLS http 请求。例如,如果我请求http://my-serverip.com/hls/293.m3u8那么它应该启动 ffmpeg 来开始创建hls
文件。
我已经为此工作了 5-6 天,无法弄清楚如何触发exec_pull
http 请求。
解决方案
推荐阅读
- ruby-on-rails - 如何按字段创建组对象
- django-rest-framework - 使用 django 2 的自定义序列化程序
- go - Bolt DB 项目的排序
- python - Python/Sklearn 中的循环回归模型
- javascript - 无法在视图或警报中显示 JSON 成功输出
- c - Windows API 是面向对象的框架吗?
- boto3 - Boto3 列出每个 aws 安全组中的所有规则
- javascript - 使用 CET 作为默认时区在 javascript 中解析日期
- angular - Angular,要服务的组件属性
- java - 配置参数的分层数据结构