Mediasoup + Gstreamer pipeline to record streams

I am working on a video calling project along with session recordings, mediasoup part for streaming is done, but facing problem in recording, my approach

  • for each producer present in a room, i created a dedicated plain transport (listening to some udp port selected by OS itself)
  • the plain transport is connected to some other udp port where it will be forwarding packets (used port pooling here)
  • every thing is working up to here now i just want to record the incoming RTP packets using gstreamer pipeline (trying to do this step by step for now just for one video stream)
    i have some info as well such as
    consumerId : ‘1864afc7-fe02-41cc-889b-d310993545a3’
    kind : ‘video’
    codec : ‘video/H264’
    payloadType : 101
    clockRate : 90000
    ssrc : 658844601
    port :42001
    profileLevelId : ‘42e01f’

but still facing problem with my gstreamer pipeline as the pipeline just failed saying : “Received invalid RTP payload, dropping”
here’s my pipeline btw : gst-launch-1.0 -e -v udpsrc port=42001 caps=“application/x-rtp,media=video,encoding-name=H264,payload=101,clock-rate=90000,ssrc=658844601,profile-level-id=42e01f” ! rtpjitterbuffer ! rtph264depay ! h264parse config-interval=1 ! mp4mux faststart=true ! filesink location=recording.mp4

let me also share my server repo link : version-0/server at main · VanshRana-1004/version-0 · GitHub