Incomplete video record after end broadcast, How to fix this or wait for a time to upload buffered video?

I am using Wowza Go-coder Android SDK and i am following provided Android sample.

I am able to record live video to stream engine. But after calling end broadcast it not uplaod/save last few or more recorded second.

e.g. If i am recording 60 secs it only save 20 secs or 30 secs only its less than actual recorded duration.

And also sometime i am getting error “A error occurred writing to the open broadcast connection” after calling end broad cast.

I appreciate if you help to overcome this problem.

I am waiting for your support and help.

Hello @Bhavesh Desai, I’d be happy to try and help.

These errors suggest a full internet issues that caused a disconnection.

If there was not a full disconnection you can improve your chances of holding onto the stream with the below ABR params:

Here are detailed descriptions for the ABR-related parameters available in the WOWZMediaConfig class of the Android SDK…

The LowBandwidthScalingFactor property is the factor by which to scale the desired bitrate in low bandwidth conditions. Valid range is 0.0 to 1.0; any other value will be ignored. Setting a value of 0.0 indicates that the encoder should choose the best value; setting a value of 1.0 indicates that bitrate will never be throttled. The default is 0.75.

The FrameBufferSizeMultiplier property is the value by which to multiply the video frame rate to derive the number of video frames to buffer before the encoder starts to throttle bitrate and/or frame rate. For example: if the frame rate is 30 and the videoFrameBufferSizeMultiplier is 5, the encoder will buffer 150 (5 * 30) frames before throttling. Setting a value of 0 indicates that the encoder should choose the best value. The default value is 4.

The FrameRateLowBandwidthSkipCount property is the number of frames to skip when the encoder cannot keep up with the broadcaster. In low bandwidth conditions the encoder will skip frames to conserve bandwidth but still send consistent frames so the encoder can produce smooth playback. The maximum number of frames that can be skipped is equal to the key frame interval minus one - i.e. setting this to 29 with a key frame interval of 30 will produce a key frame only stream, setting to 1 will never skip frames. The default is 4 meaning skip 1 of every 4 frames.

You should be able to record the entire stream to an mp4 file in the SDK. Have you seen the Capture Activity sample code on our GitHub.

https://github.com/WowzaMediaSystems/gocoder-sdk-samples-android/blob/master/gocoder-sdk-sample-app/src/main/java/com/wowza/gocoder/sdk/sampleapp/mp4/MP4CaptureActivity.java

Thanks for reply.

Is there any callback method that notify that all captured frames are encoded and transmitted after End Broadcast?

We don’t need to store any local file. And rest same as implement for base app.