Programming erlyvideo

This page should help you to create own plugins for erlyvideo.

Layout

Let's take a look at videoreader plugin. It is an example, which you can start from. It can connect to streams and consume video frames.

Basically there are two places where you can place plugin code: src/plugins and plugins

Folder src/plugins is only for single files, which can be used for example in handling RTMP calls.

Folder plugins is for complete applications, you should put there folder with your plugin, that _must_ have ebin subfolder. In this case erlyvideo will be able to load your code.

Registration

Next step is to tell erlyvideo about plugin: add your plugin to toplevel config line {modules,[]}: {modules,[videoreader]}.

videoreader here is name of module, where function start/0 will be called. You can do what you want here, for example start your own application and supervisor tree.

start/0 is called after erlyvideo application is started, after all vhosts and listeners loaded.

start/0 MUST return ok, or erlyvideo will fail to start.

stop/0 is called before anything else is stopped.

For example you can subscribe to ems_event here, just like videoreader does.

Contacts: Max Lapshin, info@erlyvideo.org