Closed yarekc closed 3 years ago
Create an sdp.txt file with the following contents.
v=0
o=- 0 0 IN IP4 [mediasoup server ip]
s=FFmpeg
c=IN IP4 [mediasoup server ip]
t=0 0
m=video [mediasoup consumer rtp port] RTP/AVP [video codec payloadType]
a=rtpmap :[video codec payloadType] VP8/90000
a=sendonly
m=audio [mediasoup consumer rtp port] RTP/AVP [audio codec payloadType]
a=rtpmnap:[audio codec payloadType] opus/48000/2
a=sendonly
then create the script
#!/bin/bash
ffmpeg -protocol_whitelist file,udp,rtp -fflags +genpts -f sdp -i sdp.txt -map 0:v:0 -c:v copy -map 0:a:0 -strict 2 -c:a copy -flags +global_header file.webm
Thanks you !
1) I have 2 question: can you a real sample of the sdp.txt (because you never know if you have to use double quote, simple quote, escape strings on parameters such as: [video codec payloadType]
2) How to get the [mediasoup consumer rtp port] from JS ? - since the goal is to control the recording with JS with buttons like "startRecord" and "stopRecord"
Regards
Do you think it is possible to record a mediasoup stream with some bash script and ffmpeg ? (without having to write some node server side script)
(similar solution to broadcast script provided here: mediasoup-demo/ffmpeg.sh at v3 · versatica/mediasoup-demo · GitHub)
Regards