Audio and Video Timestamp or Offset Problems

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

Audio and Video Timestamp or Offset Problems

william.l.metcalf
Hello all,

I am reading in Raw Audio and Raw Video from capture cards, and then
rendering them directly to my computer.  I am able to do this fine, but
the resulting video is ahead of the audio.  My initial thought was to
start the Audio pipeline, and then wait 2 seconds and start the video
pipeline.  When I executed this code the audio began playing sooner than
the video as it should, but then the video just played faster until it
was ahead of the audio again.  I then tried pausing 5 seconds before I
started the video pipeline just to see what would happen, and that time
the video did the same thing.  Because the video always plays ahead of
the audio at the same rate, I am now thinking this problem is a
timestamp or offset issue of some sort.  Is there any way to adjust the
Video/Audio offset, or is there a better way to delay the video so that
it will not speed up and pass the audio?

Here are my pipelines:
video - appsrc max-bytes = 0 is-live=true typefind=true !
"video/x-raw-yuv,format=UYVY,width=720,height=486,framerate=30/1" !
autovideosink
audio - appsrc max-bytes=0 is-live=true typefind=true ! audioparse !
autoaudiosink


Thank you for any help you can offer,
William
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Audio and Video Timestamp or Offset Problems

Wim Taymans
On 07/19/2011 08:50 PM, William Metcalf wrote:

> Hello all,
>
> I am reading in Raw Audio and Raw Video from capture cards, and then
> rendering them directly to my computer. I am able to do this fine, but
> the resulting video is ahead of the audio. My initial thought was to
> start the Audio pipeline, and then wait 2 seconds and start the video
> pipeline. When I executed this code the audio began playing sooner than
> the video as it should, but then the video just played faster until it
> was ahead of the audio again. I then tried pausing 5 seconds before I
> started the video pipeline just to see what would happen, and that time
> the video did the same thing. Because the video always plays ahead of
> the audio at the same rate, I am now thinking this problem is a
> timestamp or offset issue of some sort. Is there any way to adjust the
> Video/Audio offset, or is there a better way to delay the video so that
> it will not speed up and pass the audio?
>
> Here are my pipelines:
> video - appsrc max-bytes = 0 is-live=true typefind=true !
> "video/x-raw-yuv,format=UYVY,width=720,height=486,framerate=30/1" !
> autovideosink
> audio - appsrc max-bytes=0 is-live=true typefind=true ! audioparse !
> autoaudiosink

You forgot to configure the latency on the appsrc elements. Try setting
the min-latency property.

Wim
>
>
> Thank you for any help you can offer,
> William
> _______________________________________________
> 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: Audio and Video Timestamp or Offset Problems

william.l.metcalf
In reply to this post by william.l.metcalf


-------- Original Message --------
Subject: Re: Audio and Video Timestamp or Offset Problems
Date: Tue, 19 Jul 2011 14:05:15 -0500
From: William Metcalf [hidden email]
To: Wim Taymans [hidden email]


Wim,

Thank you very much for your quick response.  I have a few questions 
about the min-latency property.  The gst-inspect of the appsrc element 
shows the min-latency property, but it only shows that the property is 
an int64.  Is the latency measured in microseconds, milliseconds, or 
seconds?  Also, what does the min-latency property control?  The minimum 
latency between sent buffers?

Thank you again for your help,
William

On 7/19/2011 1:58 PM, Wim Taymans wrote:
> On 07/19/2011 08:50 PM, William Metcalf wrote:
>> Hello all,
>>
>> I am reading in Raw Audio and Raw Video from capture cards, and then
>> rendering them directly to my computer. I am able to do this fine, but
>> the resulting video is ahead of the audio. My initial thought was to
>> start the Audio pipeline, and then wait 2 seconds and start the video
>> pipeline. When I executed this code the audio began playing sooner than
>> the video as it should, but then the video just played faster until it
>> was ahead of the audio again. I then tried pausing 5 seconds before I
>> started the video pipeline just to see what would happen, and that time
>> the video did the same thing. Because the video always plays ahead of
>> the audio at the same rate, I am now thinking this problem is a
>> timestamp or offset issue of some sort. Is there any way to adjust the
>> Video/Audio offset, or is there a better way to delay the video so that
>> it will not speed up and pass the audio?
>>
>> Here are my pipelines:
>> video - appsrc max-bytes = 0 is-live=true typefind=true !
>> "video/x-raw-yuv,format=UYVY,width=720,height=486,framerate=30/1" !
>> autovideosink
>> audio - appsrc max-bytes=0 is-live=true typefind=true ! audioparse !
>> autoaudiosink
>
> You forgot to configure the latency on the appsrc elements. Try 
> setting the min-latency property.
>
> Wim
>>
>>
>> Thank you for any help you can offer,
>> William
>> _______________________________________________
>> 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