Decode of live RTSP stream: large video lag using MediaPlayer on Android

好久不见. 提交于 2019-12-04 04:16:20

I'm not giving a final answer, but let me share what I have by now.

  • I had a 5s latency issue playing locally on PC, from GStreamer to GStreamer. The latency was gone after adding the following parameters to pipelines:
    • on client - latency=0 parameter of rtspsrc;
    • on server - v4l2src's is-live=1 parameter and, of course, x264enc tune=zerolatency.

There is no way to control MediaPlayer/VideoView's codec/media source parameters. Neither in MediaCodec API, as far as I see.

So we need to go for GStreamer or ffmpeg.

Ease of use and portability are to be found out yet.

I'm facing the same problem. One way to dsolve this is to rewrite the whole playback class in order to control what gets fed into the codec. But this would be the last (and painful) resort. I'm still looking around... sigh...

I'm having exactly the same problem. At first I thought that it was not working, but I forgot my app opened and after a while the video showed up.

The funny thing is that if I use this video[1] which I found in a tutorial on VideoView, the lag is much smaller. I am thinking on installing Darwin Streaming server to check if it is a matter of VLC or another issue.

[1] rtsp://v5.cache1.c.youtube.com/CjYLENy73wIaLQnhycnrJQ8qmRMYESARFEIJbXYtZ29vZ2xlSARSBXdhdGNoYPj_hYjnq6uUTQw=/0/0/0/video.3gp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!