Authentication from Java rtmp publisher

Hello Wowza Team , I have been building a small publisher app using ffmpeg which is capable of streaming an RTMP stream with username and password .

So far I have experimented with the following Authentication mechanisms in wowza server v4.1.1 , all in vain

1. ModuleCoreSecurity

My class extends ModuleBase implements IServerNotify.

My Settings in Application.xml

ModuleCoreSecurity

Core Security Module for Applications

com.wowza.wms.security.ModuleCoreSecurity

Set property securityPublishRequirePassword to true

usernamePasswordProviderClass points to my class in jar

The class checks for username and password from file (username 123456) and accepts or rejects the connection . works okay with gocoder but not with the ffmpeg url : ffmpeg -i big_buck_bunny.mp4 -f flv “rtmp://wowzaip:1935/appname/streamname?user=username&password=123456”

Error : ERROR 500 - invoke(publish): java.lang.reflect.InvocationTargetException|at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)|at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)|at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)|at java.lang.reflect.Method.invoke(Method.java:606)|at com.wowza.wms.module.ModuleFunction.invoke(ModuleFunction.java:369)|

2. ModuleRTMPAuthenticate

The class extends AuthenticateUsernamePasswordProviderBase and uses the getpassword() method to make the checks .

Settings in Application.xml

ModuleRTMPAuthenticate

ModuleRTMPAuthenticate

com.wowza.wms.security.ModuleRTMPAuthenticate

Remove Module CoreSecurity

Set property securityPublishRequirePassword to false

usernamePasswordProviderClass points to my class in jar

Again Works ok for Gocoder and other encoders but on ffmpeg url ffmpeg -i big_buck_bunny.mp4 -f flv "rtmp://username:password@wowzaip:1935/appname/streamname

or ffmpeg -i big_buck_bunny.mp4 -f flv “rtmp://wwoszaip:1935/appname/streamname?user=username&password=123456” it doesnt stream

3.ModuleOnConnectAuthenticate2

The class extends extends ModuleBase

rtmpAuthenticateFile

${com.wowza.wms.context.VHostConfigHome}/conf/connect.password

String

moduleOnConnectAuthenticate

Authenticates RTMP in flash

com.wowza.wms.plugin.collection.module.ModuleOnConnectAuthenticate2

usernamePasswordProviderClass points to my class in jar

However the stream gets published even with the wrong userna,e password as mentioned in the connect.password file

I am at the end of my wits on how to enable media publishing security from my app using any of the methods / modules . Any help will be useful .

Thanks

Hi altanai,

One of our Support staff members posted recently about incorporating user authentication in an ffmpeg URL. I hope that helps.

Michelle