Hi,
I'm trying to implement an edge server with your module.
Unfortunately, I couldn't figure out how to use the pull command with your module, to pull rtmp stream from origin server.
This is the configuration I tried:
My origin server is 10.58.201.130 with nginx rtmp. Streaming to it works fine - url: rtmp://10.58.201.130/live/test2.
My edge server is the localhost. Here is my nginx config:
rtmp {
server {
listen 1935 reuseport;
chunk_size 4096;
allow play all;
service cctv {
hostname direct-bi proto-all localhost 127.0.0.1;
application edgelive {
live on;
meta copy;
pull rtmp://10.58.201.130/ app=live;
}
application edgelive1 {
live on;
meta copy;
pull rtmp://127.0.0.1/ app=live;
}
application edgelive2 {
live on;
meta copy;
exec_pull ffmpeg -i rtmp://10.58.201.130/live/$name -c copy -f flv rtmp://127.0.0.1/$app/$name;
}
application live {
live on;
gop_cache on;
gop_cache_count 5; # cache 5 GOPs
hls on;
hls_fragment 10s;
hls_playlist_length 30s;
}
}
}
}
With this configuration, I can play the stream from the origin server with edgelive2 application which uses exec_pull and ffmpeg.
Streaming locally into live application and using edgelive1 to play also works.
But the edgelive application does not work, ffplay show this error _"RTMPReadPacket, failed to read RTMP packet header" when I try the url:
./ffplay rtmp://127.0.0.1/edgelive/test2
Here is the nginx log:
How can I use the pull command to get the stream from a server rather than localhost? Is there any problem with the configuration?
I really appreciate any help you can provide!
Edit: Seems like adding 10.58.201.130 to hostname solves the problem.
However, It only works with standard rtmp port. When I tried to pull from a source with different port, for instance 10.58.201.130:9030, I still get the same error. How can I modify the config to pull from a specific port?
Hi, I'm trying to implement an edge server with your module. Unfortunately, I couldn't figure out how to use the pull command with your module, to pull rtmp stream from origin server. This is the configuration I tried: My origin server is 10.58.201.130 with nginx rtmp. Streaming to it works fine - url: rtmp://10.58.201.130/live/test2. My edge server is the localhost. Here is my nginx config:
With this configuration, I can play the stream from the origin server with edgelive2 application which uses exec_pull and ffmpeg. Streaming locally into live application and using edgelive1 to play also works. But the edgelive application does not work, ffplay show this error _"RTMPReadPacket, failed to read RTMP packet header" when I try the url:
./ffplay rtmp://127.0.0.1/edgelive/test2
Here is the nginx log:How can I use the pull command to get the stream from a server rather than localhost? Is there any problem with the configuration? I really appreciate any help you can provide!
Edit: Seems like adding 10.58.201.130 to hostname solves the problem. However, It only works with standard rtmp port. When I tried to pull from a source with different port, for instance 10.58.201.130:9030, I still get the same error. How can I modify the config to pull from a specific port?