Hi all,
I’ve recently made some example Android code which records from the camera and streams the video from the Android device up to the Wowza Streaming Cloud where I can login and view the live stream.
I’m now attempted to play the live stream within another Android app, following the code example here: https://www.wowza.com/docs/how-to-play-a-live-stream-with-wowza-gocoder-sdk-for-android
However, I am getting an error ‘An exception occurred attempting to start the decoder’. If anyone can shed any light, I would very much appreciate it.
I’ll post the code sample below along with logs. I’ve removed my credentials from the sample, but I’m using the same credentials (Host Address, Stream name etc) as the code that streams to the Wowza cloud.
Thanks in advance.
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import com.wowza.gocoder.sdk.api.WowzaGoCoder;
import com.wowza.gocoder.sdk.api.configuration.WOWZMediaConfig;
import com.wowza.gocoder.sdk.api.errors.WOWZError;
import com.wowza.gocoder.sdk.api.player.WOWZPlayerConfig;
import com.wowza.gocoder.sdk.api.player.WOWZPlayerView;
import com.wowza.gocoder.sdk.api.status.WOWZState;
import com.wowza.gocoder.sdk.api.status.WOWZStatus;
import com.wowza.gocoder.sdk.api.status.WOWZStatusCallback;
public class MainActivity extends AppCompatActivity {
private WOWZPlayerView wowzPlayerView;
private WOWZPlayerConfig wowzPlayerConfig;
private WowzaGoCoder wowzaGoCoder;
private static final String SDK_SAMPLE_APP_LICENSE_KEY = "KEY";
private static final String LOG_TAG = MainActivity.class.getSimpleName();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setup();
}
private void setup() {
wowzPlayerView = (WOWZPlayerView) findViewById(R.id.vwStreamPlayer);
wowzaGoCoder = WowzaGoCoder.init(this, SDK_SAMPLE_APP_LICENSE_KEY);
if (wowzaGoCoder == null) {
WOWZError goCoderInitError = WowzaGoCoder.getLastError();
Log.e(LOG_TAG,"setup: getLastError: " + goCoderInitError.getErrorDescription());
}
wowzPlayerConfig = new WOWZPlayerConfig();
wowzPlayerConfig.setIsPlayback(true);
wowzPlayerConfig.setHostAddress("your-server-ip");
wowzPlayerConfig.setApplicationName("live");
wowzPlayerConfig.setStreamName("myStream");
wowzPlayerConfig.setPortNumber(1935);
wowzPlayerConfig.setUsername("");
wowzPlayerConfig.setPassword("");
wowzPlayerConfig.setAudioEnabled(true);
wowzPlayerConfig.setVideoEnabled(true);
wowzPlayerView.setVolume(3);
wowzPlayerView.setScaleMode(WOWZMediaConfig.FILL_VIEW);
WOWZStatusCallback wowzStatusCallback = new StatusCallback();
wowzPlayerView.play(wowzPlayerConfig, wowzStatusCallback);
}
private class StatusCallback implements WOWZStatusCallback {
@Override
public void onWZStatus(WOWZStatus wowzStatus) {
switch (wowzStatus.getState()) {
case WOWZState.STARTING:
Log.e(LOG_TAG,"StatusCallback: onWZStatus: STARTING " + wowzStatus.getState());
break;
case WOWZState.READY:
Log.e(LOG_TAG,"StatusCallback: onWZStatus: READY " + wowzStatus.getState());
break;
case WOWZState.RUNNING:
Log.e(LOG_TAG,"StatusCallback: onWZStatus: RUNNING " + wowzStatus.getState());
break;
case WOWZState.STOPPING:
Log.e(LOG_TAG,"StatusCallback: onWZStatus: STOPPING " + wowzStatus.getState());
break;
case WOWZState.IDLE:
Log.e(LOG_TAG,"StatusCallback: onWZStatus: IDLE " + wowzStatus.getState());
break;
default:
Log.e(LOG_TAG,"StatusCallback: onWZStatus: " + wowzStatus.getState());
return;
}
if (wowzStatus.getLastError() != null) {
Log.e(LOG_TAG,"StatusCallback: onWZStatus: error " + wowzStatus.getLastError().getErrorDescription());
wowzStatus.clearLastError();
}
}
@Override
public void onWZError(WOWZStatus wowzStatus) {
Log.e(LOG_TAG,"StatusCallback: onWZError: " + wowzStatus.getState());
if (wowzStatus.getLastError() != null) {
Log.e(LOG_TAG,"StatusCallback: onWZError: error " + wowzStatus.getLastError().getErrorDescription());
wowzStatus.clearLastError();
}
}
}
}
Logcat output:
05-30 17:35:33.189 17646-17661/? E/art: Thread attaching while runtime is shutting down: Binder_1
05-30 17:35:40.437 17766-17766/com.wowza.gocoder.sdk.shaders.example E/libEGL: call to OpenGL ES API with no current context (logged once per thread)
05-30 17:35:40.439 17766-17766/com.wowza.gocoder.sdk.shaders.example E/MainActivity: StatusCallback: onWZStatus: STARTING 1
05-30 17:35:40.441 17766-17790/com.wowza.gocoder.sdk.shaders.example E/MainActivity: StatusCallback: onWZStatus: 12
05-30 17:35:40.903 17766-17790/com.wowza.gocoder.sdk.shaders.example E/MainActivity: StatusCallback: onWZStatus: IDLE 0
05-30 17:35:40.903 17766-17790/com.wowza.gocoder.sdk.shaders.example E/MainActivity: StatusCallback: onWZStatus: STARTING 1
05-30 17:35:40.903 17766-17790/com.wowza.gocoder.sdk.shaders.example E/MainActivity: StatusCallback: onWZStatus: STARTING 1
05-30 17:35:40.948 196-196/? E/OMX-VDEC-1080P: Extension: OMX.google.android.index.storeANWBufferInMetadata not implemented
05-30 17:35:40.948 196-196/? E/OMX-VDEC-1080P: Extension: OMX.google.android.index.storeMetaDataInBuffers not implemented
05-30 17:35:40.948 196-196/? E/OMXNodeInstance: getExtensionIndex(3a:qcom.decoder.avc, OMX.google.android.index.storeMetaDataInBuffers) ERROR: NotImplemented(0x80001006)
05-30 17:35:40.948 17766-17798/com.wowza.gocoder.sdk.shaders.example E/ACodec: [OMX.qcom.video.decoder.avc] storeMetaDataInBuffers failed w/ err -2147483648
05-30 17:35:40.949 196-4572/? E/OMX-VDEC-1080P: Adaptive playback request exceeds max supported resolution : [1440 x 2560] vs [1920 x 1088]
05-30 17:35:40.949 196-4572/? E/OMXNodeInstance: setParameter(3a:qcom.decoder.avc, OMX.google.android.index.prepareForAdaptivePlayback(0x7f000033): Output:1 en=1 max=1440x2560) ERROR: BadParameter(0x80001005)
05-30 17:35:40.950 196-4572/? E/OMX-VDEC-1080P: No color conversion required
05-30 17:35:40.950 196-644/? E/OMX-VDEC-1080P: Set Resolution failed
05-30 17:35:40.950 196-644/? E/OMXNodeInstance: setParameter(3a:qcom.decoder.avc, ParamPortDefinition(0x2000001)) ERROR: UnsupportedSetting(0x80001019)
05-30 17:35:40.950 17766-17798/com.wowza.gocoder.sdk.shaders.example E/ACodec: [OMX.qcom.video.decoder.avc] configureCodec returning error -1010
05-30 17:35:40.950 17766-17798/com.wowza.gocoder.sdk.shaders.example E/ACodec: signalError(omxError 0x80001001, internalError -1010)
05-30 17:35:40.951 17766-17797/com.wowza.gocoder.sdk.shaders.example E/MediaCodec: Codec reported err 0xfffffc0e, actionCode 0, while in state 3
05-30 17:35:40.951 17766-17796/com.wowza.gocoder.sdk.shaders.example E/MediaCodec: configure failed with err 0xfffffc0e, resetting...
05-30 17:35:40.975 196-17800/? E/OMX-VDEC-1080P: Error in ioctl read next msg
05-30 17:35:41.003 17766-17796/com.wowza.gocoder.sdk.shaders.example E/MainActivity: StatusCallback: onWZStatus: STOPPING 4
05-30 17:35:41.003 17766-17796/com.wowza.gocoder.sdk.shaders.example E/MainActivity: StatusCallback: onWZStatus: STOPPING 4
05-30 17:35:41.007 17766-17796/com.wowza.gocoder.sdk.shaders.example E/e: An exception occurred attempting to start the decoder
android.media.MediaCodec$CodecException: Error 0xfffffc0e
at android.media.MediaCodec.native_configure(Native Method)
at android.media.MediaCodec.configure(MediaCodec.java:1778)
at com.wowza.gocoder.sdk.support.e.d.a(GoCoderSDK:345)
at com.wowza.gocoder.sdk.support.e.e.a(GoCoderSDK:183)
at com.wowza.gocoder.sdk.support.e.b.run(GoCoderSDK:478)
at com.wowza.gocoder.sdk.support.e.e.run(GoCoderSDK:43)
at java.lang.Thread.run(Thread.java:818)
05-30 17:35:41.007 17766-17796/com.wowza.gocoder.sdk.shaders.example E/MainActivity: StatusCallback: onWZStatus: STOPPING 4
05-30 17:35:41.008 17766-17796/com.wowza.gocoder.sdk.shaders.example E/MainActivity: StatusCallback: onWZStatus: IDLE 0
05-30 17:35:41.008 17766-17790/com.wowza.gocoder.sdk.shaders.example E/MainActivity: StatusCallback: onWZStatus: STOPPING 4
05-30 17:35:41.008 17766-17790/com.wowza.gocoder.sdk.shaders.example E/MainActivity: StatusCallback: onWZStatus: error An exception occurred attempting to start the decoder
05-30 17:35:41.008 17766-17796/com.wowza.gocoder.sdk.shaders.example E/MainActivity: StatusCallback: onWZStatus: IDLE 0
05-30 17:35:41.010 17766-17766/com.wowza.gocoder.sdk.shaders.example E/MainActivity: StatusCallback: onWZStatus: IDLE 0
05-30 17:35:41.011 17766-17790/com.wowza.gocoder.sdk.shaders.example E/MainActivity: StatusCallback: onWZStatus: RUNNING 3