ffmpeg将sdp转发,使用SDP将RTP流传输到FFMPEG

I get RTP stream from WebRTC server (I used mediasoup) using node.js and I get the decrypted RTP packets raw data from the stream.

I want to forward this RTP data to ffmpeg and from there I can save it to file, or push it as RTMP stream to other media servers.

I guess that the best way would be to create SDP file that describes both the audio and video streams and send the packets therough new sockets.

The ffmpeg command is:

ffmpeg -loglevel debug -protocol_whitelist file,crypto,udp,rtp -re -vcodec libvpx -acodec opus -i test.sdp -vcodec libx264 -acodec aac -y output.mp4

I tried to send the packets through UDP:

v=0

o=mediasoup 7199daf55e496b370e36cd1d25b1ef5b9dff6858 0 IN IP4 192.168.193.182

s=7199daf55e496b370e36cd1d25b1ef5b9dff6858

c=IN IP4 192.168.193.182

t=0 0

m=audio 33301 RTP/AVP 111

a=rtpmap:111 /opus/48000

a=fmtp:111 minptime=10;useinbandfec=1

a=rtcp-fb:111 transport-cc

a=sendrecv

m=video 33302 RTP/AVP 100

a=rtpmap:100 /VP8/90000

a=rtcp-fb:100 ccm fir

a=rtcp-fb:100 nack

a=rtcp-fb:100 nack pli

a=rtcp-fb:100 goog-remb

a=rtcp-fb:100 transport-cc

a=sendrecv

But I always get (removed the boring parts):

Opening an input file: test.sdp.

[sdp @ 0x103dea0]

Format sdp probed with size=2048 and score=50

[sdp @ 0x103dea0] audio codec set to: (null)

[sdp @ 0x103dea0] audio samplerate set to: 44100

[sdp @ 0x103dea0] audio channels set to: 1

[sdp @ 0x103dea0] video codec set to: (null)

[udp @ 0x10402e0] end receive buffer size reported is 131072

[udp @

你可能感兴趣的:(ffmpeg将sdp转发)