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
Nice additions! Is there any information on RTMP / AMF callbacks? Like, when Flash connects to an nginx-rtmp application and does this in the 'Live' manner. Then, if someone wants to start recording a callback on the NetConnection with a command like 'startRecord' could start the FLV writing, and cause a callback like 'recordStarted' back to the Flash app. A matching stopRecord with recordStopped feedback would be nice aswell. That way, from the webpage, a user can have a live stream running and at some points decide to capture it to a server. Or is this something that needs to be added as a plugin to this module...
ReplyDeleteYou're right. These callbacks should be implemented in plugins.
ReplyDeleteYou could if you want of course, add lua scripting support and make everyone happy and profit :D.
ReplyDeleteCongratulations on all your hard and demanding work!
I think I could but I don't see if it makes any sense. There's no output in handler unlike http case.
ReplyDelete