out of sync when capturing video and audio at the same time playing back

Ian Davidson id012c3076 at blueyonder.co.uk
Mon Jan 5 01:11:17 PST 2015


Hi,

In your first pipeline you create an mp4 file.  The incoming audio and 
video signals will each be timestamped on capture and that timestamp 
information will be passed through the pipeline.  It is the job of the 
multiplexor to 'merge' the audio and video according to the timestamps - 
and it is the job of the subsequent player to sync the audio and video 
on playback.

In your second pipeline your video is captured and you do a number of 
operations to that video and when its ready it displays the video.  
Similarly, when you capture some audio you perform some operations on it 
and when its ready it plays the audio.  The operations you perform on 
the audio and video could conceivably take different times and there is 
nothing to tie them together.

I would try to take your first pipeline and tee off the output from the 
mux - save the file and 'play the video'.

Someone else may have a better plan.

On 04/01/2015 22:24, phdloli wrote:
> Hi, here is my problem.
> Now I can capture video and audio together then mux them into mp4 file. And
> it works well.
> The pipeline is
> "gst-launch-1.0 -e autovideosrc always-copy=FALSE num-buffers=-1
> do-timestamp=TRUE ! queue ! x264enc speed-preset=veryfast ! queue ! mux.
> autoaudiosrc num-buffers=-1 typefind=TRUE do-timestamp=TRUE ! queue !
> audioconvert ! queue ! voaacenc  ! queue ! mux. mp4mux name=mux ! filesink
> location= 3.mp4 sync=true"
>
> But now I don't want to mux them into file, but just play back at the same
> time capturing. But the video and audio are out of sync. The sequence is
> like that
>
> autovideosrc -> queue -> x264enc -> queue -> h264parse -> autovideosink
> autoaudiosrc -> queue -> audioconvert -> voaacenc -> queue -> aacparse ->
> faad -> autoaudiosink
>
> Can anybody tell me the correct way to sync the video and audio if I want to
> just play them back at the same time capturing?
>
>
> By the way my platform is Mac OS and the Gstreamer is 1.4.3.
> I'm using C now...
> Thank you very much.
>
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/out-of-sync-when-capturing-video-and-audio-at-the-same-time-playing-back-tp4670092.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

-- 
--
Ian Davidson



More information about the gstreamer-devel mailing list