Syncing two streams

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Syncing two streams

Andrew Silby
Hi,

I have 2 computers with webcams which I capture via v4l2src and encode with gstreamer using x264enc and send to a 3rd computer using rtpbin.

These streams sync well but if using the same parameters in x264enc but if I encode one stream with the zerolatency parameter and one without they are out of sync by around 1 second. I use ntp-sync=TRUE and rtcp-sync-send-time=FALSE as rtpbin parameters so I would have expected them to be in sync. Can you explain why they are out of sync and what I can do to keep them always in sync.

Below is the pipeline I have on each webcam computer:
V4l2src->x264enc->h264parse->rtph264pay->rtprtxqueue->rtpbin

Thanks very much,
Andy



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Syncing two streams

Andrew Silby
I forgot to say that I'm using gstreamer 1.14.1 on all machines.

Should rtcp-sync-send-time=FALSE not sink on capture time?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Syncing two streams

Andrew Silby
In reply to this post by Andrew Silby
So I've looked into this further and I think there's maybe a bug in x264enc.

If I run
gst-launch-1.0 videotestsrc is-live=true do-timestamp=true num-buffers=1 !
video/x-raw ! identity silent=false name=first ! x264enc ! video/x-h264 !
identity name=second silent=false !  fakesink -v

then the dts and pts are changed and reset by the x264enc. I don't think
this is correct as I would have thought that the pts should stay the same.

The output of identity "first" is:
******* (first:sink) (115200 bytes, dts: 0:00:00.011741158, pts:
0:00:00.005870579, duration: 0:00:00.033333333

The output of identity "second" which is post x264enc is:
******* (second:sink) (5795 bytes, dts: 1000:00:00.000000000, pts:
1000:00:00.000000000, duration: 0:00:00.033333333

I've looked at other encoders and they keep the pts as you would expect.

This would explain why the streams don't sync correctly. Can anyone explain
the behaviour?

Thanks very much.
Andy



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Syncing two streams

Andrew Silby
There is definitely an issue here but I can't get to the bottom of it. It
only has a problem when using x264enc. rtpbin ignores the latency or
rtcp-sync-send-time isn't working how it should do. All my remote streams
sync except ones where there is a longer latency.

Can anyone help please?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Syncing two streams

Nicolas Dufresne-5
Le vendredi 08 juin 2018 à 07:16 -0700, Andrew Silby a écrit :
> There is definitely an issue here but I can't get to the bottom of it. It
> only has a problem when using x264enc. rtpbin ignores the latency or
> rtcp-sync-send-time isn't working how it should do. All my remote streams
> sync except ones where there is a longer latency.
>
> Can anyone help please?

Do you really need B-Frames ?

>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Syncing two streams

Andrew Silby
No. Is that going to help?

-----Original Message-----
From: gstreamer-devel [mailto:[hidden email]] On Behalf Of Nicolas Dufresne
Sent: 08 June 2018 15:33
To: Discussion of the development of and with GStreamer <[hidden email]>
Subject: Re: Syncing two streams

Le vendredi 08 juin 2018 à 07:16 -0700, Andrew Silby a écrit :
> There is definitely an issue here but I can't get to the bottom of it.
> It only has a problem when using x264enc. rtpbin ignores the latency
> or rtcp-sync-send-time isn't working how it should do. All my remote
> streams sync except ones where there is a longer latency.
>
> Can anyone help please?

Do you really need B-Frames ?

>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel