webrtc
webrtc copied to clipboard
Add tools to support RTP stream saving/playback
Summary
Add libraries that make it easier to play and record RTP streams.
Motivation
It's useful to play pre-recorded streams directly to a PeerConnection to support playback of audio/video files without transcoding.
@maxhawkins This all landed right? It would be cool to have an example for this, currently we don't have a way to do easy 'playback'. I think this could be it though!
also maybe taking in a webm or something easy for users to play with.
I'm leaving this open to remind myself to add a Player/Recorder to rtpdump. I merged the reader/writer for the file format but I haven't done playback/time tracking.
One nice thing the rtpdump utility does is provide a way to pipe in RTP streams and save as a file.
You can hook it up to gstreamer, for instance.
rtpdump -Fdump -o example.rtpdump 0.0.0.0/5000
gst-launch filesrc location=example.wav ! decodebin \
! audioconvert ! audioresample ! opusenc ! rtpopuspay \
! application/x-rtp,media=audio,encoding-name=OPUS,payload=111 \
! udpsink host=0.0.0.0 port=5000
Maybe we could add a gstreamer-based utility for converting input audio/video into output opus/webm streams saved as rtpdump files.