Rtmp in raspberry

install relay

1
sudo apt-get install build-essential libpcre3 libpcre3-dev libssl-dev

install nginx

prepare

1
2
3
4
5
6
7
8
9
sudo wget http://nginx.org/download/nginx-1.13.1.tar.gz

tar -zxvf nginx-1.13.1.tar.gz

sudo wget https://github.com/arut/nginx-rtmp-module/archive/master.zip

unzip master.zip

cd nginx-1.13.1

compile & install

1
2
3
sudo ./configure --with-http_ssl_module --add-module=../nginx-rtmp-module-master
sudo make
sudo sudo make install

config

1
2
3
4
5
6
7
8
9
10
rtmp {
server {
listen 1935;
chunk_size 4096;
application live {
live on;
record off;
}
}
}

http://blog.csdn.net/defonds/article/details/9274479/

nginx

restart

1
2
sudo /usr/local/nginx/sbin/nginx -s stop
sudo /usr/local/nginx/sbin/nginx

1
2
3
ps -ef|grep nginx
kill -QUIT xxx
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

test

1
ffmpeg -re -i "/mnt/pny/T25.mp4" -vcodec libx264 -r 15 -vprofile baseline -acodec aac -ar 44100 -strict -2 -ac 1 -f flv -b:v 500k -s 360x240 -q 10 rtmp://192.168.xxx.xxx:1935/live/demo