add latency to audio in gstrtpbin

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

add latency to audio in gstrtpbin

Tristan Matthews-2
Hi,

If I have a pipeline using gstrtpbin (similar to the example in the
documentation) to send audio and video, what is the best/most reliable
way of adding latency to the audio? Would gst_event_new_latency work
(and if so, how), or am I missing its intent:
http://gstreamer.freedesktop.org/data/doc/gstreamer/stable/gstreamer/html/gstreamer-GstEvent.html#gst-event-new-latency

Basically my concern is that if video capture is too slow, can I
manually adjust the audio latency to match.

Best,

Tristan

--
Tristan Matthews
Société des arts technologiques [SAT]
email: [hidden email]
web: http://www.music.mcgill.ca/~tmatthews


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: add latency to audio in gstrtpbin

Olivier Crête-2
On Tue, 2008-09-02 at 17:38 -0400, Tristan Matthews wrote:

> Hi,
>
> If I have a pipeline using gstrtpbin (similar to the example in the
> documentation) to send audio and video, what is the best/most reliable
> way of adding latency to the audio? Would gst_event_new_latency work
> (and if so, how), or am I missing its intent:
> http://gstreamer.freedesktop.org/data/doc/gstreamer/stable/gstreamer/html/gstreamer-GstEvent.html#gst-event-new-latency
>
> Basically my concern is that if video capture is too slow, can I
> manually adjust the audio latency to match.
You want to play latency properties on the audio source.. The new
latency event is inform pipeline elements of the overlay latency of the
pipeline.

--
Olivier Crête
[hidden email]
Collabora Ltd

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

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

Re: add latency to audio in gstrtpbin

Eric Zhang-6
In reply to this post by Tristan Matthews-2
Hi, Tristan:

    You should not adjust video/audio latency manually because RTP provides a mechanism to accomplish this, called `lip-synchronization'. Refer to RFC 3550 or book `RTP: Video and Audio for the Internet' for more details. These will help you a lot.

Eric Zhang

2008/9/3 Tristan Matthews <[hidden email]>
Hi,

If I have a pipeline using gstrtpbin (similar to the example in the
documentation) to send audio and video, what is the best/most reliable
way of adding latency to the audio? Would gst_event_new_latency work
(and if so, how), or am I missing its intent:
http://gstreamer.freedesktop.org/data/doc/gstreamer/stable/gstreamer/html/gstreamer-GstEvent.html#gst-event-new-latency

Basically my concern is that if video capture is too slow, can I
manually adjust the audio latency to match.

Best,

Tristan

--
Tristan Matthews
Société des arts technologiques [SAT]
email: [hidden email]
web: http://www.music.mcgill.ca/~tmatthews


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: add latency to audio in gstrtpbin

Tristan Matthews-2
Thanks for the feedback Eric. I had seen the RFC before but that book
looks pretty useful as well.
My concern isn't that the AV will get out of sync in
gstreamer/gstrtpbin, but rather that it will be out of sync immediately
at the capture stage, i.e. if i have video input from a camera with more
latency than a separate audio source. An example scenario is given here:
http://chris.pirillo.com/2007/07/11/audio-video-capture/
where you have video of someone clapping and you have to adjust the
delay to make the sound and image of the clap line up.
I would need to be able to manually adjust the latency to ensure the
video and audio are sync'd. Should I just put the audio through a
Ladspa-delay or is their a better solution in gstreamer?

-T

Eric Zhang wrote:

> Hi, Tristan:
>
>     You should not adjust video/audio latency manually because RTP
> provides a mechanism to accomplish this, called `lip-synchronization'.
> Refer to RFC 3550 or book `RTP: Video and Audio for the Internet' for
> more details. These will help you a lot.
>
> Eric Zhang
>
> 2008/9/3 Tristan Matthews <[hidden email] <mailto:[hidden email]>>
>
>     Hi,
>
>     If I have a pipeline using gstrtpbin (similar to the example in the
>     documentation) to send audio and video, what is the best/most reliable
>     way of adding latency to the audio? Would gst_event_new_latency work
>     (and if so, how), or am I missing its intent:
>     http://gstreamer.freedesktop.org/data/doc/gstreamer/stable/gstreamer/html/gstreamer-GstEvent.html#gst-event-new-latency
>
>     Basically my concern is that if video capture is too slow, can I
>     manually adjust the audio latency to match.
>
>     Best,
>
>     Tristan
>
>     --
>     Tristan Matthews
>     Société des arts technologiques [SAT]
>     email: [hidden email] <mailto:[hidden email]>
>     web: http://www.music.mcgill.ca/~tmatthews
>     <http://www.music.mcgill.ca/%7Etmatthews>
>
>
>     -------------------------------------------------------------------------
>     This SF.Net email is sponsored by the Moblin Your Move Developer's
>     challenge
>     Build the coolest Linux based applications with Moblin SDK & win
>     great prizes
>     Grand prize is a trip for two to an Open Source event anywhere in
>     the world
>     http://moblin-contest.org/redirect.php?banner_id=100&url=/
>     <http://moblin-contest.org/redirect.php?banner_id=100&url=/>
>     _______________________________________________
>     gstreamer-devel mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> ------------------------------------------------------------------------
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  


--
Tristan Matthews
Société des arts technologiques [SAT]
email: [hidden email]
web: http://www.music.mcgill.ca/~tmatthews


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: add latency to audio in gstrtpbin

Wim Taymans
On Thu, 2008-09-04 at 11:34 -0400, Tristan Matthews wrote:

> Thanks for the feedback Eric. I had seen the RFC before but that book
> looks pretty useful as well.
> My concern isn't that the AV will get out of sync in
> gstreamer/gstrtpbin, but rather that it will be out of sync immediately
> at the capture stage, i.e. if i have video input from a camera with more
> latency than a separate audio source. An example scenario is given here:
> http://chris.pirillo.com/2007/07/11/audio-video-capture/
> where you have video of someone clapping and you have to adjust the
> delay to make the sound and image of the clap line up.
> I would need to be able to manually adjust the latency to ensure the
> video and audio are sync'd. Should I just put the audio through a
> Ladspa-delay or is their a better solution in gstreamer?
>

This situation can not occur in gstreamer when you have a well written
source element that generates correct timestamps and reports its latency
correctly. You could write an element that applies an offset to all
timestamps on the buffers.

Wim


> -T
>
> Eric Zhang wrote:
> > Hi, Tristan:
> >
> >     You should not adjust video/audio latency manually because RTP
> > provides a mechanism to accomplish this, called `lip-synchronization'.
> > Refer to RFC 3550 or book `RTP: Video and Audio for the Internet' for
> > more details. These will help you a lot.
> >
> > Eric Zhang
> >
> > 2008/9/3 Tristan Matthews <[hidden email] <mailto:[hidden email]>>
> >
> >     Hi,
> >
> >     If I have a pipeline using gstrtpbin (similar to the example in the
> >     documentation) to send audio and video, what is the best/most reliable
> >     way of adding latency to the audio? Would gst_event_new_latency work
> >     (and if so, how), or am I missing its intent:
> >     http://gstreamer.freedesktop.org/data/doc/gstreamer/stable/gstreamer/html/gstreamer-GstEvent.html#gst-event-new-latency
> >
> >     Basically my concern is that if video capture is too slow, can I
> >     manually adjust the audio latency to match.
> >
> >     Best,
> >
> >     Tristan
> >
> >     --
> >     Tristan Matthews
> >     Société des arts technologiques [SAT]
> >     email: [hidden email] <mailto:[hidden email]>
> >     web: http://www.music.mcgill.ca/~tmatthews
> >     <http://www.music.mcgill.ca/%7Etmatthews>
> >
> >
> >     -------------------------------------------------------------------------
> >     This SF.Net email is sponsored by the Moblin Your Move Developer's
> >     challenge
> >     Build the coolest Linux based applications with Moblin SDK & win
> >     great prizes
> >     Grand prize is a trip for two to an Open Source event anywhere in
> >     the world
> >     http://moblin-contest.org/redirect.php?banner_id=100&url=/
> >     <http://moblin-contest.org/redirect.php?banner_id=100&url=/>
> >     _______________________________________________
> >     gstreamer-devel mailing list
> >     [hidden email]
> >     <mailto:[hidden email]>
> >     https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> >
> >
> > ------------------------------------------------------------------------
> >
> > -------------------------------------------------------------------------
> > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> > Build the coolest Linux based applications with Moblin SDK & win great prizes
> > Grand prize is a trip for two to an Open Source event anywhere in the world
> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > gstreamer-devel mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> >  
>
>


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: add latency to audio in gstrtpbin

Thiago Sousa Santos-2


On Thu, Sep 4, 2008 at 1:54 PM, Wim Taymans <[hidden email]> wrote:
On Thu, 2008-09-04 at 11:34 -0400, Tristan Matthews wrote:
> Thanks for the feedback Eric. I had seen the RFC before but that book
> looks pretty useful as well.
> My concern isn't that the AV will get out of sync in
> gstreamer/gstrtpbin, but rather that it will be out of sync immediately
> at the capture stage, i.e. if i have video input from a camera with more
> latency than a separate audio source. An example scenario is given here:
> http://chris.pirillo.com/2007/07/11/audio-video-capture/
> where you have video of someone clapping and you have to adjust the
> delay to make the sound and image of the clap line up.
> I would need to be able to manually adjust the latency to ensure the
> video and audio are sync'd. Should I just put the audio through a
> Ladspa-delay or is their a better solution in gstreamer?
>

This situation can not occur in gstreamer when you have a well written
source element that generates correct timestamps and reports its latency
correctly. You could write an element that applies an offset to all
timestamps on the buffers.

Wim

AFAIK, This element already exists and is called GstShift from gentrans plugins
 


> -T
>
> Eric Zhang wrote:
> > Hi, Tristan:
> >
> >     You should not adjust video/audio latency manually because RTP
> > provides a mechanism to accomplish this, called `lip-synchronization'.
> > Refer to RFC 3550 or book `RTP: Video and Audio for the Internet' for
> > more details. These will help you a lot.
> >
> > Eric Zhang
> >
> > 2008/9/3 Tristan Matthews <[hidden email] <mailto:[hidden email]>>
> >
> >     Hi,
> >
> >     If I have a pipeline using gstrtpbin (similar to the example in the
> >     documentation) to send audio and video, what is the best/most reliable
> >     way of adding latency to the audio? Would gst_event_new_latency work
> >     (and if so, how), or am I missing its intent:
> >     http://gstreamer.freedesktop.org/data/doc/gstreamer/stable/gstreamer/html/gstreamer-GstEvent.html#gst-event-new-latency
> >
> >     Basically my concern is that if video capture is too slow, can I
> >     manually adjust the audio latency to match.
> >
> >     Best,
> >
> >     Tristan
> >
> >     --
> >     Tristan Matthews
> >     Société des arts technologiques [SAT]
> >     email: [hidden email] <mailto:[hidden email]>
> >     web: http://www.music.mcgill.ca/~tmatthews
> >     <http://www.music.mcgill.ca/%7Etmatthews>
> >
> >
> >     -------------------------------------------------------------------------
> >     This SF.Net email is sponsored by the Moblin Your Move Developer's
> >     challenge
> >     Build the coolest Linux based applications with Moblin SDK & win
> >     great prizes
> >     Grand prize is a trip for two to an Open Source event anywhere in
> >     the world
> >     http://moblin-contest.org/redirect.php?banner_id=100&url=/
> >     <http://moblin-contest.org/redirect.php?banner_id=100&url=/>
> >     _______________________________________________
> >     gstreamer-devel mailing list
> >     [hidden email]
> >     <mailto:[hidden email]>
> >     https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> >
> >
> > ------------------------------------------------------------------------
> >
> > -------------------------------------------------------------------------
> > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> > Build the coolest Linux based applications with Moblin SDK & win great prizes
> > Grand prize is a trip for two to an Open Source event anywhere in the world
> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > gstreamer-devel mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> >
>
>


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



--
Thiago Sousa Santos

Embedded Systems and Pervasive Computing Lab (Embedded)
Center of Electrical Engineering and Informatics (CEEI)
Federal University of Campina Grande (UFCG)

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: add latency to audio in gstrtpbin

Eric Zhang-6
In reply to this post by Wim Taymans
Hi, Tristan:

    I agree with Wim. According to your requirement and problems, this is not the gstreamer or the network makes the audio/video out of sync. So you should apply different latency to your video and audio. Try to set `latency' property to your video and audio RTP stream or just write a plugin/probe to adjust the timestamp manually.

Eric

2008/9/5 Wim Taymans <[hidden email]>
On Thu, 2008-09-04 at 11:34 -0400, Tristan Matthews wrote:
> Thanks for the feedback Eric. I had seen the RFC before but that book
> looks pretty useful as well.
> My concern isn't that the AV will get out of sync in
> gstreamer/gstrtpbin, but rather that it will be out of sync immediately
> at the capture stage, i.e. if i have video input from a camera with more
> latency than a separate audio source. An example scenario is given here:
> http://chris.pirillo.com/2007/07/11/audio-video-capture/
> where you have video of someone clapping and you have to adjust the
> delay to make the sound and image of the clap line up.
> I would need to be able to manually adjust the latency to ensure the
> video and audio are sync'd. Should I just put the audio through a
> Ladspa-delay or is their a better solution in gstreamer?
>

This situation can not occur in gstreamer when you have a well written
source element that generates correct timestamps and reports its latency
correctly. You could write an element that applies an offset to all
timestamps on the buffers.

Wim


> -T
>
> Eric Zhang wrote:
> > Hi, Tristan:
> >
> >     You should not adjust video/audio latency manually because RTP
> > provides a mechanism to accomplish this, called `lip-synchronization'.
> > Refer to RFC 3550 or book `RTP: Video and Audio for the Internet' for
> > more details. These will help you a lot.
> >
> > Eric Zhang
> >
> > 2008/9/3 Tristan Matthews <[hidden email] <mailto:[hidden email]>>
> >
> >     Hi,
> >
> >     If I have a pipeline using gstrtpbin (similar to the example in the
> >     documentation) to send audio and video, what is the best/most reliable
> >     way of adding latency to the audio? Would gst_event_new_latency work
> >     (and if so, how), or am I missing its intent:
> >     http://gstreamer.freedesktop.org/data/doc/gstreamer/stable/gstreamer/html/gstreamer-GstEvent.html#gst-event-new-latency
> >
> >     Basically my concern is that if video capture is too slow, can I
> >     manually adjust the audio latency to match.
> >
> >     Best,
> >
> >     Tristan
> >
> >     --
> >     Tristan Matthews
> >     Société des arts technologiques [SAT]
> >     email: [hidden email] <mailto:[hidden email]>
> >     web: http://www.music.mcgill.ca/~tmatthews
> >     <http://www.music.mcgill.ca/%7Etmatthews>
> >
> >
> >     -------------------------------------------------------------------------
> >     This SF.Net email is sponsored by the Moblin Your Move Developer's
> >     challenge
> >     Build the coolest Linux based applications with Moblin SDK & win
> >     great prizes
> >     Grand prize is a trip for two to an Open Source event anywhere in
> >     the world
> >     http://moblin-contest.org/redirect.php?banner_id=100&url=/
> >     <http://moblin-contest.org/redirect.php?banner_id=100&url=/>
> >     _______________________________________________
> >     gstreamer-devel mailing list
> >     [hidden email]
> >     <mailto:[hidden email]>
> >     https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> >
> >
> > ------------------------------------------------------------------------
> >
> > -------------------------------------------------------------------------
> > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> > Build the coolest Linux based applications with Moblin SDK & win great prizes
> > Grand prize is a trip for two to an Open Source event anywhere in the world
> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > gstreamer-devel mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> >
>
>


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel