Closed 1goresha closed 7 months ago
I can't understand why the p2p network delay is 3 seconds, in your library RTP over UDP(default) is used, is not it?
Hello,
rtsp module use TCP by default. The delay is normally produced in player side. You have an example that you can reproduce in local network here: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/issues/1064#issuecomment-1055206908 If you are using RTSP-Server project the case is similar try using ffplay with -fflags nobuffer.
I tested RTSP-Server in wifi local(wifi hotspot from android device). RTSP-Server is on android device and ffmpeg is on windows(10), i used ffplay and ffplay -fflags nobuffer, difference is 2 seconds, really huge. It means that i need to configure player side for low latency? And, can i change protocol in your library in rtsp module to UDP? Is it possible? I want to have the smallest latency. I don't care about some packets missing.
Hello,
with rtsp module you can change TCP to UDP using this line: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/app/src/main/java/com/pedro/rtpstreamer/customexample/RtspActivity.java#L235
In case of RTSP-Server the player will decide if use TCP or UDP (I support both). You can read it in logcat: https://github.com/pedroSG94/RTSP-Server/blob/master/rtspserver/src/main/java/com/pedro/rtspserver/ServerClient.kt#L57 Check the logcat and you can know it. It is received in SETUP command from player side: https://github.com/pedroSG94/RTSP-Server/blob/master/rtspserver/src/main/java/com/pedro/rtspserver/ServerCommandManager.kt#L48
You will need find the way to force one protocol in your player.
Ok, i see. My player uses UDP. Thank you for answer. But anyway, is it possible to use your library for RTP streaming (audio and video) without RTSP. I am a new in streaming protocols and just started to study your library, i apologize in advance for some may be obvious questions.
No, I haven't a way to use it without RTSP.
Oh, i see, but is it possible to implement this protocol in your library? May be you have some ideas or recomendations for this?
This is possible because you can create a new module with that protocol and add it to project without modify encoder module. In this case rtp in ffmpeg is a stream of rtp packets directly without add previous rtsp negotiation with server but I have multiple question about it.
Anyway this protocol is not used normally and you haven't so much players that support it. For that reason, if it require so much time it isn't worth to develop.
If you could answer these questions and modify it, it would be great! 👍 i think it will be usefull for many!
I will investigate a bit about it but for now I'm developing other feature so I don't know when I will do it. Also, it isn't really interested since not so much server/players support it
I have no plan to do it for now. I can change my idea if more users needed it Closing as inactive.
Can i use your library for clear RTP(not RTSP) over UDP streaming? And how? Can you direct me to the answer, please? I want to achieve high speed by sacrificing guaranteed packet delivery. It is very interisting for me. Thank you in advance.