qtdemux works incorrectly with opus codecs.
Hi all, I am facing this problem while working on my project I create audio stream file with **qtmux **and stream it but qtdemux can't play it (caps of source pad always return NULL), and this file I can play it by vlc. I use gstreamer 1.16.2
This is pipeline to create file.
htdung@CaCs:~$ gst-launch-1.0 -e audiotestsrc num-buffers=100 ! opusenc ! qtmux ! filesink location=tmp.qt
This is pipeline to stream audio.
htdung@CaCs:~$ gst-launch-1.0 filesrc location=tmp.qt ! qtdemux ! rtpopuspay pt=96 ! udpsink host=127.0.0.1 port=10000
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
(gst-launch-1.0:6036): GStreamer-CRITICAL **: 14:25:01.954: gst_caps_get_structure: assertion 'GST_IS_CAPS (caps)' failed
(gst-launch-1.0:6036): GStreamer-CRITICAL **: 14:25:01.954: gst_structure_get_int: assertion 'structure != NULL' failed
ERROR: from element /GstPipeline:pipeline0/GstRtpOPUSPay:rtpopuspay0: GStreamer error: negotiation problem.
Additional debug info:
gstrtpbasepayload.c(712): gst_rtp_base_payload_chain (): /GstPipeline:pipeline0/GstRtpOPUSPay:rtpopuspay0:
No input format was negotiated, i.e. no caps event was received. Perhaps you need a parser or typefind element before the payloader
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
Note: But if I try to create the file with mp4mux qtdemux works fine. I tried to find the source code, it seems that it could be caused by hard code
case FOURCC_opus:
{
const guint8 *opus_data;
guint8 *channel_mapping = NULL;
guint32 rate;
guint8 channels;
guint8 channel_mapping_family;
guint8 stream_count;
guint8 coupled_count;
guint8 i;
opus_data = stsd_entry_data;
channels = GST_READ_UINT8 (opus_data + 45);
rate = GST_READ_UINT32_LE (opus_data + 48);
channel_mapping_family = GST_READ_UINT8 (opus_data + 54);
stream_count = GST_READ_UINT8 (opus_data + 55);
coupled_count = GST_READ_UINT8 (opus_data + 56);
if (channels > 0) {
channel_mapping = g_malloc (channels * sizeof (guint8));
for (i = 0; i < channels; i++)
channel_mapping[i] = GST_READ_UINT8 (opus_data + i + 57);
}
entry->caps = gst_codec_utils_opus_create_caps (rate, channels,
channel_mapping_family, stream_count, coupled_count,
channel_mapping);
break;
}
default:
break;
}