- 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.
Wowza Media Systems, LLC