[FFmpeg-user] Problem with recording multiple RTP streams

Max B maxxbondd at gmail.com
Thu Dec 3 12:54:56 EET 2020


Hello everyone,

I am trying to record audio & video tracks from multiple RTP
streams(currently only 2 streams) with merged audio(using amix) and stacked
video (hstack).

RTP streams are coming from mediasoup RtpTrasnports that got the
initial streams from webrtc.

Everything works when I'm mixing and mapping only audio(OPUS), but
when I try it with video(VP8) it constantly gets missing keyframe
errors resulting to corrupted files.

ffmpeg args:

-loglevel,debug,-protocol_whitelist,data,rtp,udp,-fflags,+genpts,-f,sdp,-i,data:application/sdp;charset=UTF-8,v=0
  o=- 0 0 IN IP4 127.0.0.1
  s=FFmpeg
  c=IN IP4 127.0.0.1
  t=0 0
  m=video 26429 RTP/AVP 101
    a=rtpmap:101 VP8/90000
    a=sendonly
    m=audio 29284 RTP/AVP 100
  a=rtpmap:100 opus/48000/2
  a=sendonly
  ,-protocol_whitelist,data,rtp,udp,-fflags,+genpts,-f,sdp,-i,data:application/sdp;charset=UTF-8,v=0
  o=- 0 0 IN IP4 127.0.0.1
  s=FFmpeg
  c=IN IP4 127.0.0.1
  t=0 0
  m=video 26426 RTP/AVP 101
    a=rtpmap:101 VP8/90000
    a=sendonly
    m=audio 29168 RTP/AVP 100
  a=rtpmap:100 opus/48000/2
  a=sendonly
  ,-protocol_whitelist,data,rtp,udp,file,-filter_complex,[0:v][1:v]hstack=inputs=2:shortest=1[v];amix=inputs=2[a],-map,[v],-map,[a],-flags,+global_header,./files/1606991910180.webm


Output:

https://drive.google.com/file/d/1TLS7FwPK79Y8rBRPTSxr-Fj-msj-t5nM/view?usp=sharing


More information about the ffmpeg-user mailing list