Hey guys, there are a few things I am wondering about and whether or not you are planning to add support for these features in the SDK in the near future:
-
Continue to stream/record while device screen is locked by the user in mid-stream.
-
Add watermark/logo/text before streaming to server; this would allow us to watermark video without re-encoding on the server side.
-
Stream AND record to local storage at the same time.
-
Programatically trigger recording while the device is locked - this can help in certain situations, for example ability to schedule video streams to start on a certain date/time if our app requires it.
-
Record from both rear and front cameras at the same time - similar to Picture in Picture feature.
I´m also very interested in all these features.
- Continue to stream/record while device screen is locked by the user in mid-stream.
When the user locks the screen on both iOS and Android, the app is placed in the background and access to the camera is restricted. On iOS, accessing the camera is not allowed for any background tasks (see here). On Android, there have been some solutions discovered for accessing the camera from a background service application, but the degree of success could vary widely among device models as well as other conditions such as a foreground application currently having exclusive access to the camera. Here’s a StackOverflow post detailing how one developer created a solution to record video using a background service.
- Add watermark/logo/text before streaming to server; this would allow us to watermark video without re-encoding on the server side.
The WZCameraView class in the Gocoder SDK for Android includes the registerFrameListener(WZRenderAPI.FrameListener) method allowing you to register an object instance that implements the WZRenderAPI.FrameListener interface. This interface defines a set of methods that will be called by the camera preview renderer and allow you to render additional content using OpenGL ES. More detailed documentation on this set of classes will be added shortly.
- Stream AND record to local storage at the same time…
Yes. Have a look at the example included with the GoCoder SDK for Android that stores the stream to a local MP4 file on GitHub here. An iOS example will be added to GitHub soon.
- Programmatically trigger recording while the device is locked - this can help in certain situations, for example ability to schedule video streams to start on a certain date/time if our app requires it.
See my response to #1 regarding the issue with accessing resources such as the camera while an app is in a background state. On both iOS and Android it is possible for background tasks to receive network notifications. As stated earlier though, you may be able to put something together that runs as a background service on Android, but the degree of success in gaining access to the camera as a background service could vary widely among device models and various conditions.
- Record from both rear and front cameras at the same time - similar to Picture in Picture feature.
There are only a few mobile device models that permit access to both cameras simultaneously at this time. Some of the Android devices based on the Snapdragon 801 chipset from Qualcomm allow you to have both cameras open at the same time, although doing so is not officially supported by Android’s Camera and Camera2 APIs. The camera app included with Samsung’s later models supports picture-in-picture video capture but it also appears to be using an unpublished proprietary API. Samsung’s own SDK which they offer for developing apps specifically for their devices does not have this ability, at least publicly documented. Here’s an example from a developer who had success accessing both cameras simultaneously on an HTC One M8 (which is based on the Snapdragon 801).
We’ve been receiving frequent inquiries similar in nature to each of your questions. As you can see, they present a no. of challenges, and they’re driving a no. of features on the GoCoder SDK roadmap. Keep the input coming.
Thanks
Rob Gabbard
Wowza Media Systems, LLC
Hi,
The sample app included with the Android SDK zip file (wowza.gocoder.sdk.sampleapp) demonstrates the use of the WZBitmap API to display a bitmap as an overlay within the GoCoder SDK camera preview display. In particular, you can refer to the bitmapoverlayactivity.java file.
Michelle
Thank you for the very detailed response!
When the user locks the screen on both iOS and Android, the app is placed in the background and access to the camera is restricted. On iOS, accessing the camera is not allowed for any background tasks (see here). On Android, there are some documented solutions for accessing the camera from a background service application, albeit with many caveats.
The WZCameraView class in the Gocoder SDK for Android includes the registerFrameListener(WZRenderAPI.FrameListener) method allowing you to register an object instance that implements the WZRenderAPI.FrameListener interface. This interface defines a set of methods that will be called by the camera preview renderer and allow you to render additional content using OpenGL ES. More detailed documentation on this set of classes will be added shortly.
Yes. Have a look at the example included with the GoCoder SDK for Android that stores the stream to a local MP4 file on GitHub here. An iOS example will be added to GitHub soon.
See my response to #1 regarding the issue with accessing resources such as the camera while an app is in a background state. On both iOS and Android it is possible for background tasks to receive network notifications. As stated earlier, you may be able to put something together that runs as a background service on Android, but the degree of success in gaining gaining access to the camera as a background service could vary widely among device models.
There are only a few mobile device models that permit access to both cameras simultaneously at this time. Some of the Android devices based on the Snapdragon 801 processor from Qualcomm allow you to have both cameras open at the same time, although doing so is not officially supported by Android’s Camera and Camera2 APIs. The Samsung Camera app included with their later model devices supports picture-in-picture but appears to be using an unpublished API considering that Samsung’s own proprietary SDK for Android does not offer this ability in their camera-related APIs.
Hi Rob, I am curious did you guys have a chance to post any sample code anywhere on how to use the WZCameraView class to add a watermark to a stream? We would love to initiate this on the client side to avoid re-encoding footage after the fact. If you have any snippets of code or any instructions at all on how we could do this, we would really really appreciate it!
I updated the response with some addt’l details and links to examples that might help out as well.
Rob