Large (3-4 sec) delay from capture to render on Android

726 views
Skip to first unread message

Lisen Mu

unread,
Nov 16, 2015, 8:53:26 PM11/16/15
to discuss-webrtc
Hi,

I'm using WebRTC(version: branch 45) for video streaming, from android to android. Android rendering application code comes from AppRTCDemo.

However, my problem is that I got about 3-4 seconds of delay before camera captured contents got on screen.

After a while of debugging, I could observe that about 1.2 seconds between

VCMGenericDecoder::Decode and VCMDecodedFrameCallback::Decoded. It appears to me that WebRTC invokes up to java's MediaCodec interface to do the decoding, and passes data back in native code and to renderer.

Is this too much time for frame decoding? Am I setting up the receiver pipeline incorrectly and/or is there any way to improve this?

Thanks in advance,



Peter Boström

unread,
Nov 17, 2015, 6:44:24 AM11/17/15
to discuss...@googlegroups.com
Are you reproducing this with AppRTCDemo?

What framerate are you roughly getting? (Are these overlapping calls, or are you getting <1fps?)

Also interesting, what device is this?

Best,
- Peter

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/46336da8-b72b-46ef-8d62-108c33b6599e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lisen Mu

unread,
Nov 19, 2015, 12:53:21 AM11/19/15
to discuss-webrtc
Hi Peter,

Thanks for your reply!

Yes, not steadily reproduces but frequently.

The video stream feeding in is about 10 fps, and I can get about 10 fps at receive time. the video stream is smooth enough for me, just delayed for seconds.

My device is Huawei Honor 4x, Android 5.0.2.

P.S. I'm using `OMX.k3.video.decoder.avc`  in my MediaCodecVideoDecoder, because I don't have `OMX.qcom.` when enumerating codecs on my phone.

Peter Boström

unread,
Nov 19, 2015, 5:46:38 AM11/19/15
to discuss-webrtc
Can you test this in tip of tree (branch: master) to see if this is still a problem?

Lisen Mu

unread,
Nov 19, 2015, 10:32:22 PM11/19/15
to discuss-webrtc
It's seems to be quite a few changes since branch 45's AppRTCDemo.

I would post my test result asap.

Is webrtc's Java encapsulation(including renderer/captuerer) subjected to change in future?

mag...@webrtc.org

unread,
Nov 20, 2015, 4:53:54 AM11/20/15
to discuss-webrtc
Yes, the Android renderer and capturer are subject to change in the future.

Lisen Mu

unread,
Nov 21, 2015, 1:41:29 AM11/21/15
to discuss-webrtc
It also happens on master. And a lot of frames got dropped:

W/MediaCodecVideoDecoder(25018): MediaCodecVideoDecoder: Too many output buffers. Dropping frame with TS: 55650480. Total number of dropped frames: 3229

Per

unread,
Nov 26, 2015, 8:56:50 AM11/26/15
to discuss-webrtc
You will get the log if the renderer does not return the decoded frame. Then we will start dropping frames. 

Do you see this in your own app only or on a certain device or on ApprtDemo as well? If so- can you please file a bug with reproduction steps? https://bugs.chromium.org/p/webrtc/issues/list
Assign it to me.

Peter Boström

unread,
Nov 26, 2015, 9:00:19 AM11/26/15
to discuss-webrtc
Post the bug link here and I'll assign it.

Boyuan Liu

unread,
Dec 29, 2015, 2:55:25 AM12/29/15
to discuss-webrtc
Hi Peter:

our team encounter the same problem, is there any method to reduce the latency ?

在 2015年11月26日星期四 UTC+8下午10:00:19,Peter Boström写道:

Peter Boström

unread,
Dec 30, 2015, 11:44:40 AM12/30/15
to discuss-webrtc
Please file a bug for this if there isn't one already.

Peter Boström

unread,
Dec 30, 2015, 11:45:14 AM12/30/15
to discuss-webrtc
(And check Per's answer, please try to reproduce with AppRTCDemo)
Reply all
Reply to author
Forward
0 new messages