This sample code is based on Google's shadercam library and extends the shadercam-example app with live streaming support using the Wowza GoCoder™ SDK. The camera preview display is based on Android's camera2 API with real-time filtering using the OpenGL Shading Language (GLSL).
The shadercam-example app was updated to support live streaming by adding a StreamingRenderer class that uses the WZGLBroadcaster API class and the WZRenderAPI.VideoFrameRenderer interface in the GoCoder SDK to encode each frame for the video stream while a live broadcast is active.
Wowza GoCoder SDK v126.96.36.1990 or later
NOTE: The GoCoder SDK library necessary to build this app isn't provided with this sample code. To get a free trial of the SDK, complete the GoCoder SDK trial sign-up form to be sent a link where you can download the SDK along with a free trial license key.
Android SDK v4.4.2 or later.
- Android Studio v1.2.0 or later.
- A Wowza Streaming Engine™ media server or a Wowza Streaming Cloud™ account. You can request a Wowza Streaming Engine trial by completing the Wowza Streaming Engine trial sign-up form or sign up for a Wowza Streaming Cloud trial by completing the Wowza Streaming Cloud trial sig-nup form.
Build and run the app for the first time
Copy the GoCoder SDK aar library file (com.wowza.gocoder.sdk.aar) to the gocoder-sdk-shaders/libs folder.
Edit the following code, which is from the StreamingShaderActivity class, with the configuration settings used by your Wowza Streaming Engine server or your Wowza Streaming Cloud live stream:
mWZBroadcastConfig.setHostAddress("192.168.1.246"); mWZBroadcastConfig.setPortNumber(1935); mWZBroadcastConfig.setApplicationName("live"); mWZBroadcastConfig.setStreamName("myStream"); mWZBroadcastConfig.setUsername(null); mWZBroadcastConfig.setPassword(null);
- Wowza GoCoder SDK Technical Articles
- Wowza GoCoder SDK for Android Reference Docs
- Wowza GoCoder SDK for Android Release Notes
- Wowza GoCoder SDK Community Forum
Wowza Media Systems™ provides developers with a platform to create streaming applications and solutions. See Wowza Developer Tools to learn more about our APIs and SDK.
This code is distributed under the Wowza Public License.