exec_publish
- run external program on publish eventexec_play
- run external program on play eventexec_publish_done
- run external program when publisher closes streamexec_play_done
- run external program when player closes
streamexec_record_done
- run external program when recording has finished
Previously implemented exec
command is supported as well. The difference is old plain exec keeps external program running during all publishing period. It supports program restart. This behavior convenient for online transcoding with ffmpeg. The new features are pure notifiers. Unlike on_publish
and on_play
program result code is not used.
All (old & new) execs support the following variables:
app
- application namename
- stream nameaddr
- client addressflashver
- client flash versionpageurl
- client page urlswfurl
- client swf urltcurl
- client tc urlpath
- recorded file path (only forexec_record_done
)
application foo {
live on;
# register all publishers in text file
exec_publish bash -c "echo $addr $app $name >> /var/publishers"
# register all players too
exec_play bash -c "echo $addr $app $name $pageurl $swfurl >> /var/players"
# make previews
recorder preview {
record keyframes;
record_max_frames 4;
record_path /var/rec;
record_interval 30s;
exec_record_done ffmpeg -i $path -vcodec png -vframes 1 -an -f rawvideo -s 320x240 -ss 00:00:01 -y $path.png;
}
}
Go to nginx-rtmp project page