load_module /usr/lib/nginx/modules/ngx_rtmp_module.so;
rtmp {
server {
listen 1935; # RTMP port
chunk_size 4096;
application live {
live on;
record off;
}
}
}
include rtmp.conf;
into your nginx.conf
and throw the rtmp {...
block into /etc/nginx/rtmp.conf
nginx -t
to ensure that nginx still works fine.logs
directory, run mkdir -p /etc/nginx/logs
, this is exlusively for rtmp logs.systemctl restart nginx
) after making sure that everything is fine.rtmp://your.server/live/streamname
, substitute streamname
with whatever you want.ffmpeg -re -f pulse -ac 2 -i pulse -f x11grab -i :0.0 -vcodec libx264 -pix_fmt yuv420p -preset ultrafast -crf 20 -threads 1 -c:a aac -ar 44100 -ac 2 -f flv rtmp://your.server/live/streamname
ffmpeg -stream_loop -1 -re -i video.mkv -c:v copy -c:a aac -ar 44100 -ac 2 -f flv rtmp://your.server/live/streamname
rtmpdump -r "rtmp://your.server:1935/live/streamname" | mpv -
rtmpdump -r "rtmp://cia.govt.hu:1935/live/jews" | mpv -
!
/etc/i2pd/tunnels.conf
:
[rtmp-server]
type = server
host = 127.0.0.1
port = 1935
inport = 1934
keys = rtmp-server.dat
destinationport = 1934
on your client later.curl "http://127.0.0.1:7070/?page=i2p_tunnels" | grep rtmp-server
<div class="listitem"><a href="/?page=local_destination&b32=ao454mwqxhvoy4albtghb57ahbtzz6vo4iq7kbf3kj2x5ickcpdq">rtmp-server</a> ⇒ ao454mwqxhvoy4albtghb57ahbtzz6vo4iq7kbf3kj2x5ickcpdq.b32.i2p:1934</a></div>
/etc/i2pd/tunnels.conf
:
[rtmp-client]
type = client
address = 127.0.0.1
port = 1933
destination = ao454mwqxhvoy4albtghb57ahbtzz6vo4iq7kbf3kj2x5ickcpdq.b32.i2p
destinationport = 1934
keys = rtmp-client.dat
rtmpdump -r "rtmp://127.0.0.1:1934/live/streamname" | mpv -
.