oggmux not creating valid files for opus received via RTP (unless explicit caps or opusparse is present)
With git (using 49c9f318):
gst-launch-1.0 -e -v audiotestsrc num-buffers=1000 ! opusenc ! rtpopuspay ! rtpopusdepay ! oggmux ! filesink location=testsrc.ogg
the resulting file is missing the OpusHead
header etc. and can't be played:
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstAudioTestSrc:audiotestsrc0.GstPad:src: caps = audio/x-raw, rate=(int)48000, channels=(int)1, format=(string)S16LE, layout=(string)interleaved
/GstPipeline:pipeline0/GstOpusEnc:opusenc0.GstPad:sink: caps = audio/x-raw, rate=(int)48000, channels=(int)1, format=(string)S16LE, layout=(string)interleaved
Redistribute latency...
/GstPipeline:pipeline0/GstOpusEnc:opusenc0.GstPad:src: caps = audio/x-opus, rate=(int)48000, channels=(int)1, channel-mapping-family=(int)0, stream-count=(int)1, coupled-count=(int)0, streamheader=(buffer)< 4f707573486561640101380180bb0000000000, 4f707573546167731e000000456e636f6465642077697468204753747265616d6572206f707573656e63010000001a0000004445534352495054494f4e3d617564696f74657374207761766501 >
/GstPipeline:pipeline0/GstRtpOPUSPay:rtpopuspay0.GstPad:src: caps = application/x-rtp, media=(string)audio, clock-rate=(int)48000, encoding-name=(string)OPUS, sprop-stereo=(string)0, encoding-params=(string)2, sprop-maxcapturerate=(string)48000, payload=(int)96, ssrc=(uint)4224652647, timestamp-offset=(uint)281281597, seqnum-offset=(uint)28254
/GstPipeline:pipeline0/GstRTPOpusDepay:rtpopusdepay0.GstPad:src: caps = audio/x-opus, channel-mapping-family=(int)0, channels=(int)1, rate=(int)48000
/GstPipeline:pipeline0/GstOggMux:oggmux0.GstPad:audio_889019218: caps = audio/x-opus, channel-mapping-family=(int)0, channels=(int)1, rate=(int)48000
/GstPipeline:pipeline0/GstRTPOpusDepay:rtpopusdepay0.GstPad:sink: caps = application/x-rtp, media=(string)audio, clock-rate=(int)48000, encoding-name=(string)OPUS, sprop-stereo=(string)0, encoding-params=(string)2, sprop-maxcapturerate=(string)48000, payload=(int)96, ssrc=(uint)4224652647, timestamp-offset=(uint)281281597, seqnum-offset=(uint)28254
/GstPipeline:pipeline0/GstRtpOPUSPay:rtpopuspay0.GstPad:sink: caps = audio/x-opus, rate=(int)48000, channels=(int)1, channel-mapping-family=(int)0, stream-count=(int)1, coupled-count=(int)0, streamheader=(buffer)< 4f707573486561640101380180bb0000000000, 4f707573546167731e000000456e636f6465642077697468204753747265616d6572206f707573656e63010000001a0000004445534352495054494f4e3d617564696f74657374207761766501 >
/GstPipeline:pipeline0/GstRtpOPUSPay:rtpopuspay0: timestamp = 281281597
/GstPipeline:pipeline0/GstRtpOPUSPay:rtpopuspay0: seqnum = 28254
0:00:00.026207252 2983687 0x562fc2a94800 ERROR oggmux gstoggmux.c:1063:gst_ogg_mux_queue_pads:<oggmux0:audio_889019218> mapper didn't recognise input stream (pad caps: audio/x-opus, channel-mapping-family=(int)0, channels=(int)1, rate=(int)48000)
/GstPipeline:pipeline0/GstOggMux:oggmux0.GstPad:src: caps = application/ogg, streamheader=(buffer)< 4f67675300020000000000000000525bfd3400000000d393351001fdf8b50e7d91cc0582757248c1edf330e4fc3244559a0eb22341bf71c0d7629492c7235296a7807c99b03cfbb4bbac96098d0a5a47ec34ed9fdbf0bf9486bb35e23f4209c156cb86395ba2c7992aaf8cbac090fa3cf6723caa903a901b2b75cf577e7b8c68b924943db538bcd4f57551503003800066a32ac441d1a8dec6c61a79d8784f38907dd8784e32d61f63b902884a55aed31e9b57c5aed3eb8fad2a11bb9d77bd8f28d2a6f7b3ff3e45ae9146b0f657518f9d03568f6a01bc2a02379b7d9e8efe99bad517386e3351abe963fdfab4fd8e3981e10623fca8fa68b9f0dc1859ffb4aa117aaa65b60d141ad643734b13d8ecbb7411297056d48f8f6d >
/GstPipeline:pipeline0/GstFileSink:filesink0.GstPad:sink: caps = application/ogg, streamheader=(buffer)< 4f67675300020000000000000000525bfd3400000000d393351001fdf8b50e7d91cc0582757248c1edf330e4fc3244559a0eb22341bf71c0d7629492c7235296a7807c99b03cfbb4bbac96098d0a5a47ec34ed9fdbf0bf9486bb35e23f4209c156cb86395ba2c7992aaf8cbac090fa3cf6723caa903a901b2b75cf577e7b8c68b924943db538bcd4f57551503003800066a32ac441d1a8dec6c61a79d8784f38907dd8784e32d61f63b902884a55aed31e9b57c5aed3eb8fad2a11bb9d77bd8f28d2a6f7b3ff3e45ae9146b0f657518f9d03568f6a01bc2a02379b7d9e8efe99bad517386e3351abe963fdfab4fd8e3981e10623fca8fa68b9f0dc1859ffb4aa117aaa65b60d141ad643734b13d8ecbb7411297056d48f8f6d >
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
Redistribute latency...
New clock: GstSystemClock
Got EOS from element "pipeline0".
EOS received - stopping pipeline...
Execution ended after 0:00:00.126034469
Setting pipeline to NULL ...
Freeing pipeline ...
If I put an opusparse
or explicit caps before the oggmux, the file is OK.