Remove audio delay in gstreamer pipeline

Hi,

I am encoding a 1080p vidoe and mixing 2 audio sources and playback the audio through a USB device. One audio source is a mic and the output(muxed to file and played back) is connected to a speaker system. The issue is the audio is not live there is a delay in the playback. Is there a method to remove this delay?

below is the pipeline

gst-launch-1.0 -e videotestsrc pattern=black ! video/x-raw,width=320,height=240 ! nvvidconv ! queue ! tee name=back ! queue ! comppc.sink_0 v4l2src device=/dev/video0 ! queue ! tee name=t1 ! video/x-raw, width=1920, height=1080, framerate=60/1 ! videorate ! video/x-raw, width=1920, height=1080, framerate=${fpsp1}/1 ! nvvidconv ! queue ! “video/x-raw(memory:NVMM),width=960,height=540,format=NV12” ! queue ! comppc.sink_1 rtspsrc location=rtsp://192.168.8.100:554 latency=0 ! application/x-rtp, media=video, encoding-name=H264 ! rtph264depay ! tee name=t2 ! queue ! h264parse ! queue ! nvv4l2decoder ! nvvidconv ! queue ! “video/x-raw(memory:NVMM),width=1920,height=1080,format=NV12” ! videorate ! “video/x-raw(memory:NVMM),width=1920,height=1080,format=NV12,framerate=30/1” ! nvvidconv ! queue ! “video/x-raw(memory:NVMM),width=960,height=540,format=NV12” ! queue ! comppc.sink_2 nvcompositor name=comppc sink_0::width=1920 sink_0::height=1080 sink_1::xpos=0 sink_1::ypos=270 sink_1::width=960 sink_1::height=540 sink_2::xpos=960 sink_2::ypos=270 sink_2::width=960 sink_2::height=540 ! queue ! nvvidconv ! queue ! nvv4l2h264enc maxperf-enable=1 bitrate=4000000 profile=4 ! queue ! h264parse ! queue ! mux. liveadder name=filaud ! queue ! audioconvert ! voaacenc ! mux. alsasrc device=“hw:3,0” ! queue ! audio/x-raw ! queue ! audioresample ! “audio/x-raw,rate=48000” ! tee name=a1 ! queue ! filaud.sink_0 alsasrc device=“hw:2,0” ! queue ! audio/x-raw ! queue ! audioresample ! “audio/x-raw,rate=48000” ! tee name=a2 ! queue ! filaud.sink_1 mpegtsmux name=mux ! filesink location=“file.ts” async=false liveadder name=audout ! queue ! audioconvert ! audioresample ! “audio/x-raw,rate=48000,channels=2,format=S16LE” ! alsasink device=“hw:2,0” sync=false async=false a1. ! queue ! audout.sink_0 a2. ! queue ! audout.sink_1

Hi,
Please check if there is property in alsasrc/alsasink you can set to adjust delay. There is timestamping mechanism in gstreamer and there should be property for adjusting timestamp of audio samples.

Thank you @DaneLLL. Will check it

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.