Android RTSP camera streaming

Preface

The function expansion of Android's camera is becoming more and more abundant. Recently, because of the need for RTSP push, I have a little understanding of the pits that have been stepped on.

Server

The server-side project developed by pure JAVA, used a few years ago, is still easy to use today.

Client

On the client side, it is recommended to use VLC on the PC, which is very convenient for debugging and powerful. On the
mobile side, this point is to talk about, after all, a few years ago, the deep pit that I stepped on was it:

Then, the result after trying is:

delay

This is a common question

  • The VideoView/MeidaPlayer control on the mobile phone often finds a 5 second delay after playing
  • Use VLC test on PC, under default settings, it will be about 2 seconds

At the beginning, I suspected that it was a problem on the server side. After a lot of time toss, I can only say that I was still too young.

  • Connection settings in VLC:
    Insert picture description here
    reduce the cache appropriately, for example, change 1000ms to 200ms
  • On the mobile phone, you have to find a useful playback control or tool
    RTSPPlayer : This project used to work well, but the recent test found that it often fails to connect or there is no image or screen after connecting. In the interface, the delay can support about 100ms .
    vlc-android : How to say it, powerful, but to be able to toss very much, once downloaded and compiled, the final result is not satisfactory (different from the official released APK performance)

Expand

Image format conversion

Android YUV image conversion algorithm and detection tools
YUV420P, YUV420SP, NV12, NV21 and RGB are mutually converted and stored as JPEG and PNG images

GIT clone failed

$ git clone https://github.com/tsingsee/EasyPlayer-RTSP-Android.git
正克隆到 'EasyPlayer-RTSP-Android'...
remote: Enumerating objects: 50, done.
remote: Counting objects: 100% (50/50), done.
remote: Compressing objects: 100% (29/29), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: 过早的文件结束符(EOF)
fatal: index-pack failed

git clone时RPC failed; curl 18 transfer closed with outstanding read data remaining

Guess you like

Origin blog.csdn.net/ansondroider/article/details/105903286