Open Doss12 opened 7 years ago
By the way, did you use multi-threading for getting raw data and sending it into the encoder? Single thread may block the whole process and result in lag.
One more thing, you may try to reduce the bit rate of video stream for less lag. Change setVideoHDMode
into setVideoSmoothMode
in MainActivity.java
We have changed the buffer size,vgop and the vfps, the delay was reduced from 15 seconds to 7 seconds and we're satisfied with the result,thank you very much for your help
private byte[] mPcmBuffer = new byte[2048]; VGOP =18 VFPS = 32
I see, you want to generate one I-frame within one second.
The first point of you need to care about this problem is the bandwidth between your application and the RTMP server. The approach is to use FFmpeg to make comparision with the same server and player.
If it seems as bad as Yasea, what you need to do is check of your server and inquiry of your ISP.
If it works well, then I would like to ask you a question in advance -- what are you going to apply yasea to do and what did you do in the modification porting of yasea.
I have contacted many users who apply yasea far from the original application of mobile phone streaming such as Android TV, surveillance cameras, drones and so on. There are different peripherals in different areas and therefore may well produce different effect. In the view of streaming end, the less for the buffer, the less for the delay.
By the way, the latest version of yasea is v2.4.1.