How do I adjust the quality of the video? If I'm using a 3G or 4G mobile network with iOS and Android, what are the best settings to use?
I'm concerned that it may disconnect. Is there a way to resume streaming if this happens?
What if I need low-latency?
Manually Setting the Bitrate and Resolution:
Please experiment with different settings to see what work best.
Resolution (in tests.plist):
<key>GlobalProperties</key> <dict> <key>camera_width</key> <integer>640</integer> <key>camera_height</key> <integer>360</integer> <true/> </dict>
Note: The iOS camera is configured to use pre-set ratios so the camera will give you the closest resolution to what you have requested. The exact resolutions are as follows:
Bandwidth (in tests.plist):
<key>GlobalProperties</key> <dict> <key>bitrate</key> <integer>750</integer> </dict>
Resolution (in test.xml):
<Testbed> <Properties> <camera_width>640</camera_width> <camera_height>360</camera_height> </Properties> <Tests>
Note: As mentioned above in the note for iOS, the camera might use pre-set ratios. However, Android devices have a little more variety with their hardware so there may be different results between models.
Bitrate (in test.xml):
<Testbed> <Properties> <bitrate>750</bitrate> </Properties> <Tests>We'd recommend trying to set the max bitrate to 400kbps - it goes in increments of 200kbs. Ramp it up and down during your testing to see what works best for you. You could ramp that kbps up to 800kbps if you wanted but your 3g customers might have issues with the stream.
For more on recommended resolution and bitrate settings, please refer to this FAQ.
Please note: mobile devices may not be able to handle a high bitrate and resolution as they do not have the processing power of larger machines.
For 4G and 3G: We'd recommend trying to set the max bitrate to 400kbps (426 x 240 resolution)- it goes in increments of 200kbs. Ramp it up and down during your testing to see what works best for you. You could ramp that kbps up to 800kbps if you wanted but your 3g customers might have issues with the stream.
The Red5 Pro server was built around providing the lowest latency possible. Please take a look at the buffer_time setting in iOS, or Android. The lower the number the lower the latency. However, if the buffer is too low, it can affect the smoothness of a stream, especially for VOD applications.
Adaptive Bitrate for the Publisher:
For the mobile bitrate, we'd recommend using our adaptive bitrate feature. It's sort of a balancing act because if you have users on 3g and the bitrate is set too high it could impact the stream for them.
Please note that you can only set the bitrate (or implement adaptive bitrate) in the publisher, not the subscriber.
After a certain threshold, the server automatically disconnects the stream. If you put a reconnect timer on the publisher of 4-5 seconds that should give it enough time to clean up the stream. As long as the publisher is still broadcasting, the subscriber will automatically resubscribe to the stream.
For more information on balancing quality and latency, please see our blog post.