Disabling synchronization in udpsink for reverse playback

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

Disabling synchronization in udpsink for reverse playback

Muzzu Daniela

Hi,

 

I have a question related to the following bug (marked as INVALID), where it was proposed to disable sync in udpsink for live streams:

https://bugzilla.gnome.org/show_bug.cgi?id=665435

 

It has been replied that sync should be set to TRUE in all cases.

But, what about reverse playback? The server has to send chunks in reverse order, with a non-regular increase of timestamps. Does it make sense to set sync property to FALSE in this case?

 

Thanks,

Daniela


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

Re: Disabling synchronization in udpsink for reverse playback

Wim Taymans
On 09/21/2012 10:45 AM, Muzzu Daniela wrote:

>
> Hi,
>
> I have a question related to the following bug (marked as INVALID),
> where it was proposed to disable sync in udpsink for live streams:
>
> https://bugzilla.gnome.org/show_bug.cgi?id=665435
>
> It has been replied that sync should be set to TRUE in all cases.
>
> But, what about reverse playback? The server has to send chunks in
> reverse order, with a non-regular increase of timestamps. Does it make
> sense to set sync property to FALSE in this case?
>
No, the running-time (what udpsink synchronizes to) increases
monotonically in all cases. There is no need to disable
sync on udpsink in any case.

Wim

>
> Thanks,
>
> Daniela
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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

Re: Disabling synchronization in udpsink for reverse playback

Carlos Rafael Giani
On 2012-09-21 11:36, Wim Taymans wrote:

> On 09/21/2012 10:45 AM, Muzzu Daniela wrote:
>>
>> Hi,
>>
>> I have a question related to the following bug (marked as INVALID),
>> where it was proposed to disable sync in udpsink for live streams:
>>
>> https://bugzilla.gnome.org/show_bug.cgi?id=665435
>>
>> It has been replied that sync should be set to TRUE in all cases.
>>
>> But, what about reverse playback? The server has to send chunks in
>> reverse order, with a non-regular increase of timestamps. Does it make
>> sense to set sync property to FALSE in this case?
>>
> No, the running-time (what udpsink synchronizes to) increases
> monotonically in all cases. There is no need to disable
> sync on udpsink in any case.
>
> Wim
>>
>> Thanks,
>>
>> Daniela
>>
>>
>>
>> _______________________________________________
>> gstreamer-devel mailing list
>> [hidden email]
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

I'm curious - what is the benefit of leaving sync on with udpsink? The
only reason I can think of is to prevent 100% CPU usage on the sender
side and flooding the network, but if there is something that holds the
sender back (for example, an alsasrc), then what other reason is there?
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Disabling synchronization in udpsink for reverse playback

Wim Taymans
On 09/21/2012 11:39 AM, dv wrote:

> On 2012-09-21 11:36, Wim Taymans wrote:
>> On 09/21/2012 10:45 AM, Muzzu Daniela wrote:
>>>
>>> Hi,
>>>
>>> I have a question related to the following bug (marked as INVALID),
>>> where it was proposed to disable sync in udpsink for live streams:
>>>
>>> https://bugzilla.gnome.org/show_bug.cgi?id=665435
>>>
>>> It has been replied that sync should be set to TRUE in all cases.
>>>
>>> But, what about reverse playback? The server has to send chunks in
>>> reverse order, with a non-regular increase of timestamps. Does it make
>>> sense to set sync property to FALSE in this case?
>>>
>> No, the running-time (what udpsink synchronizes to) increases
>> monotonically in all cases. There is no need to disable
>> sync on udpsink in any case.
>>
>> Wim
>>>
>>> Thanks,
>>>
>>> Daniela
>>>
>>>
>>>
>>> _______________________________________________
>>> gstreamer-devel mailing list
>>> [hidden email]
>>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>> _______________________________________________
>> gstreamer-devel mailing list
>> [hidden email]
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> I'm curious - what is the benefit of leaving sync on with udpsink? The
> only reason I can think of is to prevent 100% CPU usage on the sender
> side and flooding the network, but if there is something that holds
> the sender back (for example, an alsasrc), then what other reason is
> there?
If you have multiple sources, alsasrc and v4l2src for example, the sync
on the udpsink would make sure that
packets with the same running-time are placed on the network at the same
time. This makes it easier for a client to
do the initial sync on them and requires less buffering in the client.

Wim

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

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

RE: Disabling synchronization in udpsink for reverse playback

Muzzu Daniela
I asked the question because I'm trying to enable reverse playback in gst-rtsp, and with sync=TRUE it happens that udpsink waits for almost a second to synchronize each new chunk, while the other packets inside the GOP are sent immediately because they are late (hence chunks are sent in bursts). On client side, this causes an annoying delay in first frame rendering (only video, no audio in the stream).
On the contrary, with sync=FALSE everything is fine (besides, as dv said, a significant increase of CPU usage ;-) ).

But probably something is wrong in the pipeline before udpsink... I'll furtherly investigate.
Regards,
Daniela

-----Original Message-----
From: gstreamer-devel-bounces+daniela.muzzu=[hidden email] [mailto:gstreamer-devel-bounces+daniela.muzzu=[hidden email]] On Behalf Of Wim Taymans
Sent: Friday, September 21, 2012 12:08 PM
To: [hidden email]
Subject: Re: Disabling synchronization in udpsink for reverse playback

On 09/21/2012 11:39 AM, dv wrote:

> On 2012-09-21 11:36, Wim Taymans wrote:
>> On 09/21/2012 10:45 AM, Muzzu Daniela wrote:
>>>
>>> Hi,
>>>
>>> I have a question related to the following bug (marked as INVALID),
>>> where it was proposed to disable sync in udpsink for live streams:
>>>
>>> https://bugzilla.gnome.org/show_bug.cgi?id=665435
>>>
>>> It has been replied that sync should be set to TRUE in all cases.
>>>
>>> But, what about reverse playback? The server has to send chunks in
>>> reverse order, with a non-regular increase of timestamps. Does it
>>> make sense to set sync property to FALSE in this case?
>>>
>> No, the running-time (what udpsink synchronizes to) increases
>> monotonically in all cases. There is no need to disable sync on
>> udpsink in any case.
>>
>> Wim
>>>
>>> Thanks,
>>>
>>> Daniela
>>>
>>>
>>>
>>> _______________________________________________
>>> gstreamer-devel mailing list
>>> [hidden email]
>>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>> _______________________________________________
>> gstreamer-devel mailing list
>> [hidden email]
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> I'm curious - what is the benefit of leaving sync on with udpsink? The
> only reason I can think of is to prevent 100% CPU usage on the sender
> side and flooding the network, but if there is something that holds
> the sender back (for example, an alsasrc), then what other reason is
> there?
If you have multiple sources, alsasrc and v4l2src for example, the sync on the udpsink would make sure that packets with the same running-time are placed on the network at the same time. This makes it easier for a client to do the initial sync on them and requires less buffering in the client.

Wim

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

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

RE: Disabling synchronization in udpsink for reverse playback

Krause, Mathias
In reply to this post by Muzzu Daniela
Hi,

I don't exactly know, what you're trying to do. But as far as I can say:

If you turn the sync option off, that means, that udpsink does sent the data through UDP as fast as possible, instead of keep sending the data in sync with the own clock. That means, that you get a lot of traffic, if the source provides enough data. For a live source, you may disable the sync, but I don't exactly understand, what you're trying to archive with that.

Regards,
Mathias




From: gstreamer-devel-bounces+mathias.krause=[hidden email] [mailto:gstreamer-devel-bounces+mathias.krause=[hidden email]] On Behalf Of Muzzu Daniela
Sent: Friday, September 21, 2012 10:46 AM
To: [hidden email]
Subject: Disabling synchronization in udpsink for reverse playback

Hi,

I have a question related to the following bug (marked as INVALID), where it was proposed to disable sync in udpsink for live streams:
https://bugzilla.gnome.org/show_bug.cgi?id=665435

It has been replied that sync should be set to TRUE in all cases.
But, what about reverse playback? The server has to send chunks in reverse order, with a non-regular increase of timestamps. Does it make sense to set sync property to FALSE in this case?

Thanks,
Daniela

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

Re: Disabling synchronization in udpsink for reverse playback

sam shmayev
Windows:
gst-launch-0.10 version 0.10.31
GStreamer 0.10.31

Ubuntu:
gst-launch-0.10 version 0.10.36
GStreamer 0.10.36
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

I just want to play rtsp stream from IP camera with audio and video.
On Windows it works with the following syntax (but I don't need Windows)

// using playbin2

// using decodebin2 (full freeze on Ubuntu)
gst-launch rtspsrc location=rtsp://administrator:123123@192.168.1.253:554/nphMpeg4/g726-640x480 latency=0 name=demux demux. ! application/x-rtp,media=audio ! queue2 ! decodebin2 ! audioresample ! autoaudiosink demux. ! application/x-rtp,media=video ! queue2 ! decodebin2 ! ffmpegcolorspace ! autovideosink -vvv


Attachments contain debug info from Ubuntu.

Thank you.

On Thu, Sep 27, 2012 at 1:40 PM, Krause, Mathias <[hidden email]> wrote:
Hi,

I don't exactly know, what you're trying to do. But as far as I can say:

If you turn the sync option off, that means, that udpsink does sent the data through UDP as fast as possible, instead of keep sending the data in sync with the own clock. That means, that you get a lot of traffic, if the source provides enough data. For a live source, you may disable the sync, but I don't exactly understand, what you're trying to archive with that.

Regards,
Mathias




From: gstreamer-devel-bounces+mathias.krause=[hidden email] [mailto:[hidden email]=[hidden email]] On Behalf Of Muzzu Daniela
Sent: Friday, September 21, 2012 10:46 AM
To: [hidden email]
Subject: Disabling synchronization in udpsink for reverse playback

Hi,

I have a question related to the following bug (marked as INVALID), where it was proposed to disable sync in udpsink for live streams:
https://bugzilla.gnome.org/show_bug.cgi?id=665435

It has been replied that sync should be set to TRUE in all cases.
But, what about reverse playback? The server has to send chunks in reverse order, with a non-regular increase of timestamps. Does it make sense to set sync property to FALSE in this case?

Thanks,
Daniela

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



--
S.Shmayev

Office:  <a href="tel:%2B972-72-2777239" value="+972722777239" target="_blank">+972-72-2777239
Mobile: <a href="tel:%2B972-54-6216356" value="+972546216356" target="_blank">+972-54-6216356


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

ubuntu_decodebin2 (21K) Download Attachment
ubuntu_playbin2 (36K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Disabling synchronization in udpsink for reverse playback

Muzzu Daniela
In reply to this post by Krause, Mathias
I'm trying to implement reverse playback in gst-rtsp server (and client-side too where needed), playing from a previously recorded stream. I also have a GStreamer-based client, with rtspsrc as source, that sends to the server an RTSP request with a negative scale to play backwards at a certain point.
Both client and server in this case set a newsegment with rate -1, and the server starts sending GOPs to the client in reverse order (from stop position to start, but with bytes in forward order inside GOP). The client is then able to queue and reverse  frames inside received GOPs and present them going backwards.

The main issue I have is about timestamps, more specifically related to multiudpsink synchronization in the server. Since GOPs are sent in reverse order but with frames in forward order, in current implementation frames arrive to udpsink with timestamps in this order (very simple example, playing from 10 to 0):
7 8 9   4 5 6   2 3 4   0 1

and multiudpsink-basesink synchronize, with rate < 0, with the rule :
time = stop - position -> 3 2 1   6 5 4   8 7 6   10 9
(time to be added to base_time before syncing).

[In forward order on the contrary timestamp would increase from 0 to 10 and time = pos - start]

This leads to a synchronization time which is not monotonically increasing, as Wim stated it should be; moreover, there is a delay (almost 1 sec.) at first GOPs starting, while the remaining frames in the GOP are sent immediately because they are late.
Obviously there is something strange, and I'm trying to figure out how to change things in order to have a smoother synchronization in multiudpsink also in reverse playback. I was wondering whether in this case synchronization still has to be enabled, but it seems that yes, it has to.

I hope my explanation is clear. Any suggestion is appreciated.
Thanks and regards,
Daniela



-----Original Message-----
From: gstreamer-devel-bounces+daniela.muzzu=[hidden email] [mailto:gstreamer-devel-bounces+daniela.muzzu=[hidden email]] On Behalf Of Krause, Mathias
Sent: Thursday, September 27, 2012 1:41 PM
To: Discussion of the development of and with GStreamer
Subject: RE: Disabling synchronization in udpsink for reverse playback

Hi,

I don't exactly know, what you're trying to do. But as far as I can say:

If you turn the sync option off, that means, that udpsink does sent the data through UDP as fast as possible, instead of keep sending the data in sync with the own clock. That means, that you get a lot of traffic, if the source provides enough data. For a live source, you may disable the sync, but I don't exactly understand, what you're trying to archive with that.

Regards,
Mathias




From: gstreamer-devel-bounces+mathias.krause=[hidden email] [mailto:gstreamer-devel-bounces+mathias.krause=[hidden email]] On Behalf Of Muzzu Daniela
Sent: Friday, September 21, 2012 10:46 AM
To: [hidden email]
Subject: Disabling synchronization in udpsink for reverse playback

Hi,

I have a question related to the following bug (marked as INVALID), where it was proposed to disable sync in udpsink for live streams:
https://bugzilla.gnome.org/show_bug.cgi?id=665435

It has been replied that sync should be set to TRUE in all cases.
But, what about reverse playback? The server has to send chunks in reverse order, with a non-regular increase of timestamps. Does it make sense to set sync property to FALSE in this case?

Thanks,
Daniela

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

Re: Disabling synchronization in udpsink for reverse playback

Wim Taymans
On 09/27/2012 03:41 PM, Muzzu Daniela wrote:

> I'm trying to implement reverse playback in gst-rtsp server (and client-side too where needed), playing from a previously recorded stream. I also have a GStreamer-based client, with rtspsrc as source, that sends to the server an RTSP request with a negative scale to play backwards at a certain point.
> Both client and server in this case set a newsegment with rate -1, and the server starts sending GOPs to the client in reverse order (from stop position to start, but with bytes in forward order inside GOP). The client is then able to queue and reverse  frames inside received GOPs and present them going backwards.
>
> The main issue I have is about timestamps, more specifically related to multiudpsink synchronization in the server. Since GOPs are sent in reverse order but with frames in forward order, in current implementation frames arrive to udpsink with timestamps in this order (very simple example, playing from 10 to 0):
> 7 8 9   4 5 6   2 3 4   0 1
>
> and multiudpsink-basesink synchronize, with rate < 0, with the rule :
> time = stop - position -> 3 2 1   6 5 4   8 7 6   10 9
> (time to be added to base_time before syncing).
>
> [In forward order on the contrary timestamp would increase from 0 to 10 and time = pos - start]
>
> This leads to a synchronization time which is not monotonically increasing, as Wim stated it should be; moreover, there is a delay (almost 1 sec.) at first GOPs starting, while the remaining frames in the GOP are sent immediately because they are late.
> Obviously there is something strange, and I'm trying to figure out how to change things in order to have a smoother synchronization in multiudpsink also in reverse playback. I was wondering whether in this case synchronization still has to be enabled, but it seems that yes, it has to.
You can't do this with RTSP afaik, you need to re-encode on the server.

Wim

>
> I hope my explanation is clear. Any suggestion is appreciated.
> Thanks and regards,
> Daniela
>
>
>
> -----Original Message-----
> From: gstreamer-devel-bounces+daniela.muzzu=[hidden email] [mailto:gstreamer-devel-bounces+daniela.muzzu=[hidden email]] On Behalf Of Krause, Mathias
> Sent: Thursday, September 27, 2012 1:41 PM
> To: Discussion of the development of and with GStreamer
> Subject: RE: Disabling synchronization in udpsink for reverse playback
>
> Hi,
>
> I don't exactly know, what you're trying to do. But as far as I can say:
>
> If you turn the sync option off, that means, that udpsink does sent the data through UDP as fast as possible, instead of keep sending the data in sync with the own clock. That means, that you get a lot of traffic, if the source provides enough data. For a live source, you may disable the sync, but I don't exactly understand, what you're trying to archive with that.
>
> Regards,
> Mathias
>
>
>
>
> From: gstreamer-devel-bounces+mathias.krause=[hidden email] [mailto:gstreamer-devel-bounces+mathias.krause=[hidden email]] On Behalf Of Muzzu Daniela
> Sent: Friday, September 21, 2012 10:46 AM
> To: [hidden email]
> Subject: Disabling synchronization in udpsink for reverse playback
>
> Hi,
>
> I have a question related to the following bug (marked as INVALID), where it was proposed to disable sync in udpsink for live streams:
> https://bugzilla.gnome.org/show_bug.cgi?id=665435
>
> It has been replied that sync should be set to TRUE in all cases.
> But, what about reverse playback? The server has to send chunks in reverse order, with a non-regular increase of timestamps. Does it make sense to set sync property to FALSE in this case?
>
> Thanks,
> Daniela
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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