webrtc icon indicating copy to clipboard operation
webrtc copied to clipboard

Add tools to support RTP stream saving/playback

Open maxhawkins opened this issue 5 years ago • 3 comments

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 avatar Mar 25 '19 21:03 maxhawkins

@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.

Sean-Der avatar Apr 07 '19 08:04 Sean-Der

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.

maxhawkins avatar Apr 07 '19 15:04 maxhawkins

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.

maxhawkins avatar Apr 07 '19 18:04 maxhawkins