GStreamer clock only

I have tried to do this:

I have changed my approach and will play file locally using windows API, but the only problem i have is syncing it so I need gstreamer pipelines with clock only, I couldn’t find any way to do it. I don’t need synced playback just synced start playing.

Reciever:

GstClock* net_clock = gst_net_client_clock_new("net_clock", "127.0.0.1", 8554, 0);
if (!GST_IS_CLOCK(net_clock)) {
    std::cerr << "Failed to connect to network clock" << std::endl;
    return -1;
}
gst_clock_wait_for_sync(net_clock, GST_CLOCK_TIME_NONE);

Server:

GstNetTimeProvider* net_time_provider = gst_net_time_provider_new(clock, "127.0.0.1", 8554);
if (!net_time_provider) {
  std::cerr << "Failed to start network time provider" << std::endl;
  gst_object_unref(clock);
  return -1;
}

You probably also want something like

pipeline.use_clock(net_clock)
pipeline.set_start_time(Gst.CLOCK_TIME_NONE)
pipeline.set_base_time(start_time)

and then distribute a common start_time (you can query the net clock for the current time and distribute that, or add a few hundred millisecs to it) to all the playback clients that are supposed to play in sync.

1 Like