Audio / Video Synchronization issue through HLS gstreamer

Nicolas Dufresne nicolas.dufresne at gmail.com
Tue Oct 4 13:57:44 UTC 2016


Le vendredi 30 septembre 2016 à 06:39 -0700, mohcer a écrit :
> gst-launch-1.5 v4l2src do-timestamp=true ! videoconvert ! videoscale 

do-timestamp should never be set with v4l2src.

> !
> video/x-raw,framerate=30/1 ! timeoverlay shaded-background=1 ! queue
> !
> x264enc ! queue ! mpegtsmux name=mux alsasrc ! queue ! audioconvert !

Without any configuration, x264enc will pick a very complex compression
algorithm and introduce a significant latency. Configure that element
to reduce the CPU load and latency. Things like bitrate, setting
tune=zerolatency, adding a capsilter after to pick the H264 profile,
change the quantizer (if you feel like an expert) etc.

> queue
> ! audioresample ! queue ! audiorate ! voaacenc bitrate=160000 ! queue
> !
> aacparse ! queue ! mux. mux. ! queue ! hlssink sync=false

Try to stay on sync, don't diable sync. Note that mpegtsmux does not do
any type of synchronization other then marking the time on each stream
properly. As you have picked a very high latency video encoding method,
you'll get a huge drift between audio and video. Normally, sync should
not be affected, but at a certain level, it will.


More information about the gstreamer-devel mailing list