Mux audio and video into hls stream

I am trying to mux video and audio to a hls stream with this command:

appsrc name=video_appsrc is-live=true format=3 do-timestamp=true ! videoconvert ! textoverlay name=overlay ! x264enc tune=zerolatency ! h264parse ! mux.
appsrc name=audio_appsrc is-live=true format=3 do-timestamp=true ! audioconvert ! voaacenc ! mux.
mpegtsmux name=mux ! hlssink2 playlist-location={HLS_PATH}/playlist.m3u8 location={HLS_PATH}/segment_%05d.ts target-duration=5 max-files=5

I get this error:

GST_PIPELINE gst/parse/grammar.y:773:gst_parse_perform_link:ESC[00m could not link mux to hlssink2-0

Do you know how can I solve the issue? Can I use mpegtsmux or is it not possible? How can i mux audio and video into hls?

Hello @j.murua

Could you use the hlssink element instead of the hlssink2? Or is there any limitation?

Regards!

I have solved the issue. I have used hlssink and i have converted audio to mpeg format. This solved the issue, as the mpegtsmux element requires audio in this format and i was sending in raw format.

Thanks for helping with the issue!!