Pulling between streams does not work

Author: Martmists-GHCreated Oct 4, 2025Updated Oct 4, 2025

Config:

nginx
rtmp {
    server {
        listen 1935;

        application live {
            live on;

            pull rtmp://localhost/publish name=online;
	    pull rtmp://localhost/stillstore/offline name=offline;
        }

	application stillstore {
		live on;
		exec_static /usr/bin/ffmpeg -re -hide_banner -loop 1 -i /opt/offline.jpg -c:v h264_nvenc -preset p1 -c:a aac -f flv rtmp://127.0.0.1/stillstore/offline;
	}

	application publish {
	        live on;
 
                exec_publish /usr/bin/curl "http://127.0.0.1:1936/control/redirect/subscriber?app=live&newname=online";
                exec_publish_done /usr/bin/curl "http://127.0.0.1:1936/control/redirect/subscriber?app=live&newname=offline";
	}
    }
}

http {
    # ...

    server {
        listen 1936;
	location /control {
		rtmp_control all;
	}
    }
}

Commands used to test:

bash
$ ffplay rtmp://server/live  # should display the offline image but is stuck loading
$ ffmpeg -re -i file.mp4 -preset p1 -c:v h264_nvenc -c:a aac -f flv rtmp://server/publish  # At this point I'd expect the stream to switch to the video, but instead ffplay errors with `rtmp://server/live: End of file`
$ ffplay rtmp://server/live  # should display the playing file but is stuck loading