Garbled/Corrupted audio when using a modified version of play-from-disk
e3ndr opened this issue · comments
Your environment.
- Version: v3.1.44
- Browser: Chrome (105.0.5195.125)
What did you do? / What did you expect? / What happened?
I'm working on a screen sharing/voice chatting service and I've come across an issue when using a modified example of play-drom-disk. I'm trying to pipe in an OGG file and stream that to a receiver (here's the code) but the audio is garbled/corrupted.
garbled.mp4
For context, here's how the video is getting to the server:
- MediaRecorder records audio into a webm file (Opus, 510kbps, 48khz, 2 channel, 16bit).
- I grab a chunk every ~250ms and send that to my api via websocket (it's running on my local machine though).
- I then remux the data into a NUT container (for ease of data handling).
And here's how the media is getting to pion:
- I wait for the SDP to given to pion, since I need stdin for the OGG stream.
- I attach the output of the NUT feed to a OGG remuxer (here's the ffmpeg command I'm running).
- I dump the output of the OGG remuxer to a file.
- I pipe that output into the pion code via stdin.
Now the raw OGG does not exhibit the playback issues shown in the screen recording, leading me to believe that it's either a pion bug or, more likely, a bug in my code.
Thanks!