winshining / nginx-http-flv-module

A media streaming server based on nginx-rtmp-module. In addtion to the features nginx-rtmp-module provides, HTTP-FLV, GOP cache, VHosts (one IP for multi domain names) and JSON style statistics are supported now.
BSD 2-Clause "Simplified" License
2.75k stars 571 forks source link

Pref: Let flv live application have the ability to access the all of get request arguments. #186

Closed seamory closed 1 year ago

seamory commented 3 years ago

Pref: Let flv live application have the ability to access the all of get request arguments.

By add above code. Developer could analyse the argument by shell in exec command when construct the request customized. By that, developer could pull stream which need more than two arguments ($app, $name) from rtsp of hikivision, dahua, etc.

pass parameter in application:

application main {
    live on;
    wait_key on;
    gop_cache on;

    exec_pull /usr/program/nginx/script/main_code.sh $args $app $name;
    exec_kill_signal term;
}

analyse get request arguments by shell: ip=echo $1 | awk '{split($0,a,"&"); for(i in a){if (a[i] ~ /ip=/) {split(a[i], a, "="); print a[2]}}}'``