Forums - How to configure MediaCodec for decoding with low latency

4 posts / 0 new
Last post
How to configure MediaCodec for decoding with low latency
geierconstantin
Join Date: 1 Dec 15
Posts: 4
Posted: Sun, 2021-01-24 09:39

Hello,
If I compare two devices of the same price range ( and roughly the same decoder specs regarding max fps/resolution ) I notice a big difference between the performance of Snapdragon devices and your competitor (Exynos devices)
As an example, decoding the same h264 stream on a Snapdragon device takes ~92ms while the competitor decodes it in less than 5ms
E.g. if latency is the important metric for you, your competitor is 87ms quicker.
I would like to know if you can give me any information on how to configure a MediaCodec instance properly for qualcom / snapdragon devices, to bring the performance on your chipsets on-par with Exynos devices.

As an example, for the specific h264 stream I am dealing with,I found out that the decoding latency on Snapdragon devices can be reduced slighlty by adding the "VUI" parameter to he bitstream SPS with the value "max_dec_frame_buffering" set to 1. But I cannot set it to the required "0" aka "no decoder frame buffering".
Note that the exynos decoder shows that this specific stream can be decoded in less than 5ms (e.g. without decoder frame buffering), but I just cannot get the snapdragon decoder to do the same.
If you want to take a look at the issue yourself, I can show it to you using my test app:
https://github.com/Consti10/LiveVideo10ms/tree/master/VideoCore

Best regards,
Constantin

  • Up0
  • Down0
geierconstantin
Join Date: 1 Dec 15
Posts: 4
Posted: Fri, 2021-01-29 05:49
  • Up0
  • Down0
stokleygary
Join Date: 28 Feb 21
Posts: 3
Posted: Sun, 2021-02-28 17:02

Thank you for this solution!

  • Up0
  • Down0
geierconstantin
Join Date: 1 Dec 15
Posts: 4
Posted: Sun, 2021-02-28 17:58

Well, my workaround is an improvement but it  is not really a solution, since the snapdragon still buffers frames in this case, but less frames compared to without.
Ideally it would buffer 0 frames, but so far only exynos can do that with streams for poc_type=0.

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.