RTP demo with RawAudio
Hello friends, I'm trying to get microphone input (via
Membrane.PortAudio.Source
) packaged into an RTP stream and sent to a server and can't quite seem to get it right.
Excerpt below based on the demo in membrane-demo/rtp
but with microphone input substituted and newer syntax.
This seems to throw an error when generating the headers because buffer.pts is nil
:
Does anyone have any tips on what I might be doing wrong?3 Replies
Ah, just stumbled across this issue:
https://github.com/membraneframework/membrane_opus_plugin/issues/22
Looks like I wasn't going mad after all - opus plugin doesn't support it yet.
Although I don't quite understand why I'm hitting this issue when membrane-demo/rtp works fine - perhaps a difference with the underlying RawAudio stream instead of a file?
Hello @calms! I believe that adding
child(:parser, Membrane.Opus.Parser)
right after the encoder should solve your problem, since the Opus.Parser
adds some metadata and PTS to the buffers flowing in the stream.Ah, that does indeed solve the problem with
buffer.pts
!
Many thanks!
With that in place, this now works (although it's super quiet...) - happy to mark this as solved.
If you had any tips on volume, I'd be all ears though!