Audio / video out of sync for custom capture pipeline

Chris Tapp opensource at keylevel.com
Fri Aug 30 10:27:40 PDT 2013


On 30 Aug 2013, at 08:53, Chris Tapp wrote:

> Hi Tim,
> 
> On 30 Aug 2013, at 07:39, Tim-Philipp Müller wrote:
> 
>> Hi Chris,
>> 
>> ----- Original message -----
>>> I'm trying to use a pipeline to capture a video stream so that I can
>>> display the frames in a custom app whilst the audio streams in the
>>> background. I've been using pipelines of the form:
>>> 
>>> gst-launch playbin2 uri=sintel.webm audio-sink="alsasink"
>>> video-sink="videorate ! ffmpegcolorspace ! videoscale add-borders=true !
>>> video/x-raw-rgb, bpp=32, pixel-aspect-ratio=1/1, width=800, height=500 !
>>> appsink drop=1 max-buffers=1"
>>> 
>>> I then use the 'last-buffer' of the appsink to grab the most-recent
>>> video frame to render.
>>> 
>>> This works great one system, but on another the audio gets ahead of the
>>> video and eventually breaks up.
>>> 
>>> What do I need to change in the pipeline so the audio keeps running
>>> real-time and the 'last-buffer' in the appsink is in step with it?
>>> 
>> 
>> Have you tried setting sync=true on appsink?
> 
> 
> Yes, I've tried that and it makes no difference.
> 
> I think I need to make the video sink bin lossy so that it drops frames. Does that makes sense? If so, how can I get that behaviour? I though the 'drop=1' should do the job.

It looks as if using:

  video-sink="queue leaky=0 max-size-buffers=1 ! video/x-raw-rgb, bpp=32, pixel-aspect-ratio=1/1, width=800, height=500 ! fakesink sync=1 qos=1"

does what I need. The important part was the "qos=1".

Chris Tapp

opensource at keylevel.com
www.keylevel.com





More information about the gstreamer-devel mailing list