AMP Android SDK: Troubleshooting

Document created by Herberth Alvarado Champion on Aug 12, 2016Last modified by Herberth Alvarado Champion on Apr 9, 2017
Version 4Show Document
  • View in full screen mode

Maintainer: Orlando Sanchez Martinez

This document is part of AMP Android SDK 

 

Video is frozen while audio is playing

This could happen when starting the playback or just after a bitrate change. This occurs when the profile used for encoding the video is not supported by the hardware of the Android device. As we are using the hardware of the device we are limited to the profiles/formats supported by it.

 

Note: This can also happen when the user selects to play only the audio bitrate. In this case we are getting the right behavior, no video is rendered (video frozen) and audio is played.

 

Solution:

Most of the Android devices only support H.264 Baseline Profile so, for maximum compatibility, be sure you use this profile when encoding your streams. As a general rule, please follow Apple’s recommendations as specified in http://developer.apple.com/library/ios/#technotes/tn2224/_index.html in conjunction with Android’s, http://developer.android.com/guide/appendix/media-formats.html#recommendations for maximum compatibility.

 

Hardware decoding mode does not work

This might occur when the AkamaiHLSService is not declared in the application section of the Android Manifest XML file.

<service android:name="com.akamai.media.hls.AkamaiHLSService"></service>

 

Audio/Video sync issues

This happens when audio and video timestamps are not correctly aligned. Although the Android SDK tries to fix big misalignments issues generated by the encoder, it is possible that many consecutive small misalignments generate audio/video sync issues during the playback.

 

Solution:

Check your encoder configuration to try to fix this issue. If the issue is still there, contact Akamai to analyze the stream to find out where the problem is.

 

Stream does not work after the Activity has been paused and resumed

The AMP SDK does not automatically manage the life cycle of the activity, it’s the app’s responsibility to implement this.

 

Solution:

Playback should be stopped in the onPause() event of the activity, and resumed at the same position in the onResume() event. Example:

 

@Override

protected void onPause()

{

if (mVideoView.isPlaying() || mVideoView.isPaused())

{

mCurrentPosition = mVideoView.getTimePosition();

mWasPlaying = true;

mVideoView.stop();

}

 

 

super.onPause();

}

@Override

protected void onResume()

{

if (mWasPlaying)

{

mVideoView.playUrl(mUrl, mCurrentPosition);

mWasPlaying = false;

}

 

 

super.onResume();

}

 

Video displays pixelation or ghosting effect after seeking in Hardware Advanced mode

Video keyframes inside the TS segments of the HLS stream are not aligned with the duration of the segments. There are two different ways to fix this issue:

  1. Fix the keyframe alignment at the encoder level – for example, setting a fixed keyframe interval of 2 seconds for 10 seconds segments.
  2. Configure the SDK to force a format change after every seek operation:

mVideoView.setForceFormatChange(true);

 

 

This document is part of AMP Android SDK 

Attachments

    Outcomes