AnsweredAssumed Answered

Slow H264 1080P@60fps Decoding on Android Lollipop 5.0.2 SabreSD

Question asked by Gurtaj Singh on Oct 11, 2015

I'm developing a JAVA RTP Streaming App for a company project, which should be capable of joining the Multicast Server and receive the RTP Packets.Later I use the H264 Depacketizer to recreate the a complete frame from the NAL FU (Keep append the data until End Bit & Marker Bit set )

I want to decode and display a raw h264 video byte stream in Android and therefore I'm currently using the MediaCodec classes with Hardware Decoder configured.

The Application is Up and running for the Jeallybean (API 17). Various Resolutions which I need to decodes are :
480P at 30/60 FPS
720P/I at 30/60 FPS
1080P/I at 30/60 FPS

Recently, Due to System Upgrade we are porting the App to Android L Version 5.0.2. My App is not capable of playing the high resolutions videos like 720p@60fps and 1080p@60fps.

For the debugging purpose I started feeding the Elementary H264 Frames with size from the dump file to MediaCodec and found out the Video is Lagging.
There are timestamps on the sample video I used and it seems the actual time taken to proceed by 1 sec in Rendered Video is more
Below is my sample code and links to sample video
h264 video
h264 framesize



The content of sampledecodeApp.7z package.

  1. sampledecodeApp – This is the Android Player source code which reads the size of H264 data from one file and H264 Elementary stream from another file.

The code is similar to the CTS Test code. In short it reads the size of frame line by line from dump60fps.size file and frame size of data from dump60fps.h264 file.


H264 Sample Video Detail


Resolution – 1920x1080p

FPS           – 60 framesPerSecond

Bitrate        –  25MBPS average


Steps to Install the Application


Note: Before Installing and Launching the app, We need to push the dumps into /data/loca/tmp directories

  1. With the help of adb utility , adb push the dump60fps.h264 & dump60fps.size file into the /data/local/tmp directory onto the running system
  2. Import the sampledecodeApp  project into Eclipse or Android Studio and Clean build the Package.
  3. Run the Application from the IDE .


The Prebuild apk is available in path sampledecodeApp\bin\sampledecode.apk

Original Attachment has been moved to:

Original Attachment has been moved to: