Audio playback while recording

Hi,

I am using the below pipeline to record 2 separate files with one file containing audio mixed from 2 different sources along with the preview.

gst-launch-1.0 -e mp4mux name=mux ! filesink location=feed1mp1080HW.mp4 v4l2src device=/dev/video1 ! tee name=t1 t1. ! queue ! video/x-raw, width=1920, height=1080, framerate=30/1 ! nvvidconv ! queue ! nvv4l2h264enc maxperf-enable=1 bitrate=4000000 profile=4 ! queue ! h264parse ! queue ! mux.video_0 audiomixer name=mixer ! audioconvert ! voaacenc ! aacparse ! mux.audio_0 pulsesrc device=“alsa_input.usb-VXIS_Inc_ezcap_U3_capture-02.analog-stereo” ! queue ! audio/x-raw,width=16,depth=16,rate=44100,channel=1 ! queue ! mixer.sink_0 pulsesrc device=“alsa_input.usb-C-Media_Electronics_Inc._USB_Advanced_Audio_Device-00.analog-stereo” ! queue ! audio/x-raw,width=16,depth=16,rate=44100,channel=1 ! queue ! mixer.sink_1 t1. ! queue ! video/x-raw, width=1920, height=1080, framerate=30/1 ! nvvidconv ! queue ! “video/x-raw(memory:NVMM),width=959,height=540,framerate=30/1,format=NV12” ! queue ! nvoverlaysink overlay-x=0 overlay-y=270 overlay-w=959 overlay-h=540 overlay=1 v4l2src device=/dev/video0 io-mode=2 do-timestamp=true ! tee name=t2 t2. ! queue ! image/jpeg,width=1920,height=1080,framerate=30/1 ! videorate ! image/jpeg,width=1920,height=1080,framerate=30/1 ! nvv4l2decoder mjpeg=1 ! nvvidconv ! video/x-raw,width=1920,height=1080,framerate=30/1 ! nvvidconv ! queue ! ‘video/x-raw(memory:NVMM),framerate=30/1,format=NV12’ ! nvv4l2h264enc maxperf-enable=1 bitrate=4000000 profile=4 ! queue ! h264parse ! queue ! mp4mux ! filesink location=feed2mp1080HW.mp4 t2. ! queue ! image/jpeg,width=1920,height=1080,framerate=30/1 ! nvv4l2decoder mjpeg=1 ! nvvidconv ! video/x-raw,framerate=30/1 ! nvvidconv ! queue ! ‘video/x-raw(memory:NVMM),framerate=30/1,format=NV12’ ! queue ! nvoverlaysink overlay-x=960 overlay-y=270 overlay-w=960 overlay-h=540 overlay=2

My requirement is to output the audio from jetson or an USB audio source. How can I achieve this?

Thanks in Advance

Hi,
You can run aplay -l to get what audio devices can be used. And set it in alsasink:

$ gst-launch-1.0 filesrc location=a.mp4 ! qtdemux ! avdec_aac ! audioconvert ! alsasink device="hw:2,0"

For simultaneous audio payback and recording, you can use tee plugin.

1 Like