Installation ============ Download the ``ams-moderator-x.y.z.jar`` file `from here `_ and place it under the ``/usr/local/antmedia/plugins`` directory of your media server. .. code-block:: bash cd /usr/local/antmedia/plugins sudo wget https://streamtoolbox.com/download/ams-moderator-1.0.0.jar sudo touch /usr/local/antmedia/conf/moderator.conf sudo nano /usr/local/antmedia/conf/moderator.conf An example configuration that watches out for Smoking looks like this: .. code-block:: properties moderator.enabled=true moderator.aws.region=us-east-1 moderator.aws.access.key.id=AKIA..... moderator.frame.sampling.rate=100 moderator.aws.secret.access.key=aZeuI..... moderator.labels=Smoking moderator.action=notify moderator.notify.webhook.url="https://localhost:9999/anything" For testing, you can use httpbin to accept and echo back your notifications: .. code-block:: bash docker run -p 9999:80 kennethreitz/httpbin If you have purchased a license, copy the license file into the ``/usr/local/antmedia/conf`` directory. If you don't have a license file, the software will log a message and will start in time limited trial mode. Restart Ant Media Server using ``sudo systemctl restart antmedia.service`` You should see the below messages when your Live application starts up: .. code-block:: text 2025-09-02 22:42:03,221 [Loader:/live] INFO io.antmedia.plugin.ModeratorPlugin - Moderator Plugin is starting in LiveApp 2025-09-02 22:42:03,252 [Loader:/live] INFO i.a.plugin.moderator.Configuration - Loading moderator configuration from /usr/local/antmedia/conf/moderator.conf Publish a stream to ``LiveApp`` and verify that the logs contain these messages. You can publish the stream from vMix, OBS or just simply use ``ffmpeg`` from command line: .. code-block:: bash wget https://streamtoolbox.com/download/big_buck_bunny_720p_h264.mov ffmpeg -re -i big_buck_bunny_720p_h264.mov -c copy -f flv rtmp://localhost:1935/LiveApp/myStream .. code-block:: text 2025-09-02 22:42:16,550 [vert.x-worker-thread-21] INFO io.antmedia.plugin.ModeratorPlugin - Registering Moderator frame listener in stream myStream You should see AWS responses in the logs periodically: .. code-block:: text 2025-09-02 22:52:52,787 [vert.x-worker-thread-45] WARN i.a.p.m.AwsRekognitionService - Detected moderation labels in myStream: Pills (58.62), Products (58.62), Drugs & Tobacco (58.62), Smoking (20.05), Drugs & Tobacco Paraphernalia & Use (20.05) 2025-09-02 22:52:52,840 [vert.x-worker-thread-45] INFO io.antmedia.plugin.ModeratorPlugin - Moderation notification sent, response code: 200, body: { "args": {}, "data": "{\"streamId\":\"myStream\",\"labels\":[{\"label\":\"Smoking\",\"confidence\":20.0506}]}", "files": {}, "form": {}, "headers": { "Accept-Encoding": "gzip", "Content-Length": "75", "Content-Type": "application/json", "User-Agent": "Java-http-client/17.0.16" }, "json": { "labels": [ { "confidence": 20.0506, "label": "Smoking" } ], "streamId": "myStream" }, "method": "POST", "url": "http://localhost:9999/anything" }