wrtc-to-ffmpeg
Pipe MediaStreamTracks between wrtc and fluent-ffmpeg. Early development, plenty of issues. Currently only for Unix and Linux.
Allows you to record WebRTC streams, stream media files over WebRTC connections, or route WebRTC streams to RTSP/RTMP/etc.
const ffmpeg = const wrtc = const w2f = wrtc const input = await w2finputtrack // audio or video MediaStreamTrack inputinputurl // add our input // specify the input options // save the stream to an mp4
You can also pipe FFMPEG output to MediaStreamTracks
.
const videoOutput = await w2fconst audioOutput = await w2f input'./myVideo.mp4' videoOutputtrack // do what you want with the new MediaStreamTracksaudioOutputtrack
API
input = await w2f.input(track)
Transforms a MediaStreamTrack
into an input object.
input.url
is a Unix domain socket path that FFMPEG can use as input.
input.options
is an object with the minimum FFMPEG options.
output = await w2f.output({ kind, width, height, sampleRate })
Creates an output object with the specified properties.
output.track
is a MediaStreamTrack
.
output.url
is a Unix domain socket path that FFMPEG can use as output.
output.options
is an object with the minimum FFMPEG options.