Latency 5 seconds
Dear all,
I have 5 seconds latency.
- Camera: samsung galaxy 360 degree
- protocol: RTMP
- server: nginx-rtmp
I was able to reduce the latency by enabling "clock synchronization" from the GUI of vlc software installed in the same PC(unity installed).
I also found clock synchronization setting from the RTMPstream class in the vlc asset as below. But changing setting does not reduce latency.
public class RTMPStream : MonoBehaviour { [SerializeField] string url;
[SerializeField]
FromType fromType;
[SerializeField]
Texture targetTexture;
[SerializeField]
GameObject sphere;
LibVLC _libVLC;
MediaPlayer _mediaPlayer;
const int seekTimeDelta = 5000;
Texture2D tex = null;
bool playing;
void Awake()
{
Core.Initialize(Application.dataPath);
_libVLC = new LibVLC("--no-osd", "--verbose=2", **"--clock-synchro=1");**
_mediaPlayer = new MediaPlayer(_libVLC);
targetTexture = null;
GetComponent<Renderer>().material.mainTexture = null;
PlayPause();
PlayPause();
}
Question
- It is clear that synchronizing clock between server and VLC(decoder) is a one of the solution to reduce the latency. How we change this setting in the vlc asset script? it is not working as above.
- if Changing a certain setting in the vlc asseet is not a effective way to reduce a latency, What would be another alternative approach? I am considering FFMPEG. I need your advice.
Best regards Seongsu