Skip to content

Commit

Permalink
MOD move wiki to /docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Stabenow committed Feb 26, 2016
1 parent cd0d9f7 commit 298697a
Show file tree
Hide file tree
Showing 12 changed files with 2,394 additions and 3 deletions.
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
# NGINX-based Media Streaming Server
## nginx-rtmp-module

## nginx-rtmp-module

### Project blog

http://nginx-rtmp.blogspot.com

### Wiki manual
### Documentation

* [Home](doc/README.md)
* [Control module](doc/control_modul.md)
* [Debug log](doc/debug_log.md)
* [Directives](doc/directives.md)
* [Examples](doc/examples.md)
* [Exec wrapper in bash](doc/exec_wrapper_in_bash.md)
* [FAQ](doc/faq.md)
* [Getting number of subscribers](doc/getting_number_of_subscribers.md)
* [Getting started with nginx rtmp](doc/getting_started.md)
* [Installing in Gentoo](doc/installing_in_gentoo.md)
* [Installing on Ubuntu using PPAs](doc/installing_ubuntu_using_ppas.md)
* [Tutorial](doc/tutorial.md)

*Source: https://github.com/arut/nginx-rtmp-module/wiki*

https://github.com/arut/nginx-rtmp-module/wiki/Directives
* [Latest updates](doc/README.md#updates)

### Google group

Expand Down
94 changes: 94 additions & 0 deletions doc/control_modul.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Control module

Control module is HTTP module which makes it possible to control rtmp module from outside using HTTP protocol. Here's an example of how to enable control.
```sh
http {
...
server {
listen 8080;
server_name localhost;
....
location /control {
rtmp_control all;
}
}
}
```

There are several sub-modules within control module each controlling a different feature.

# Record
This sub-module starts and stops recordings created with _manual_ flag.
Syntax:
```sh
http://server.com/control/record/start|stop?srv=SRV&app=APP&name=NAME&rec=REC
```

* srv=SRV - optional server{} block number within rtmp{} block, default to first server{} block
* app=APP - required application name
* name=NAME - required stream name
* rec=REC - optional recorder name, defaults to root (unnamed) recorder

Example
```sh
rtmp {
server {
listen 1935;
application myapp {
live on;
recorder rec1 {
record all manual;
record_suffix all.flv;
record_path /tmp/rec;
record_unique on;
}
}
}
}
```

Publish the stream with the following command
```sh
$ ffmpeg -i http://someserver.com/mychannel.ts -c:v copy -c:a nellymoser -ar 44100 -ac 1 -f flv rtmp://localhost/myapp/mystream
```

Use the following commands to start and stop recording
```sh
$ curl "http://localhost:8080/control/record/start?app=myapp&name=mystream&rec=rec1"
§ curl "http://localhost:8080/control/record/stop?app=myapp&name=mystream&rec=rec1"
```

if the record start/stop request returns nothing sometimes, you should check if you use multi workers. one worker works great.

# Drop
This sub-module provides a simple way to drop client connection.
Syntax:
```sh
http://server.com/control/drop/publisher|subscriber|client?
srv=SRV&app=APP&name=NAME&addr=ADDR&clientid=CLIENTID
```

* srv, app, name - the same as above
* addr - optional client address (the same as returned by rtmp_stat)
* clientid - optional nginx client id (displayed in log and stat)

The first method ```drop/publisher``` drops publisher connection. The second ```drop/client``` drops every connection matching ```addr``` argument or all clients (including publisher) if ```addr``` is not specified.

Examples
```sh
$ curl http://localhost:8080/control/drop/publisher?app=myapp&name=mystream
$ curl http://localhost:8080/control/drop/client?app=myapp&name=mystream
$ curl http://localhost:8080/control/drop/client?app=myapp&name=mystream&addr=192.168.0.1
$ curl http://localhost:8080/control/drop/client?app=myapp&name=mystream&clientid=1
```

# Redirect
Redirect play/publish client to a new stream.
Syntax:
```sh
http://server.com/control/redirect/publisher|subscriber|client?
srv=SRV&app=APP&name=NAME&addr=ADDR&clientid=CLIENTID&newname=NEWNAME
```

* srv, app, name, addr, clients - the same as above
* newname - new stream name to redirect to
16 changes: 16 additions & 0 deletions doc/debug_log.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Debug log

In case you need to solve a streaming problem you might need to watch debug log.
For that configure nginx with *--with-debug* flag.
```sh
$ cd nginx-X.Y.Z
$ ./configure --add-module=/path/to/nginx-rtmp-module --with-debug ...
```

After compiling set nginx error.log level to *debug* in nginx.conf
```sh
error_log logs/error.log debug;
```

After that you will have _a lot_ of debug info in error.log. Please grep
what your problem relates to (exec, notify etc) and post to [nginx-rtmp google group](https://groups.google.com/group/nginx-rtmp) to help with solving it.
Loading

0 comments on commit 298697a

Please sign in to comment.