After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 730749 - Failed to determine keyframeness of audio/x-opus packet
Failed to determine keyframeness of audio/x-opus packet
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.2.4
Other other
: Normal normal
: 1.3.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-05-26 08:22 UTC by Lee Matthews
Modified: 2014-06-02 12:02 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Lee Matthews 2014-05-26 08:22:42 UTC
Using gstreamer-1.0-android-arm-1.2.4.1-debug I have built a streaming application that receives an audio stream over a tcp connection. The stream is encoded to opus and placed within an ogg container.

Whilst decoding the stream, I receive the following messages permanently in logcat :

W/GStreamer+oggdemux(20979): 0:01:11.763208515 0x766b5780 gstoggstream.c:212:gst_ogg_stream_packet_is_key_frame Failed to determine keyframeness of audio/x-opus packet
W/GStreamer+oggdemux(20979): 0:01:11.792104765 0x766b5780 gstoggstream.c:212:gst_ogg_stream_packet_is_key_frame Failed to determine keyframeness of audio/x-opus packet
W/GStreamer+oggdemux(20979): 0:01:11.815665754 0x766b5780 gstoggstream.c:212:gst_ogg_stream_packet_is_key_frame Failed to determine keyframeness of audio/x-opus packet
W/GStreamer+oggdemux(20979): 0:01:11.832747369 0x766b5780 gstoggstream.c:212:gst_ogg_stream_packet_is_key_frame Failed to determine keyframeness of audio/x-opus packet
W/GStreamer+oggdemux(20979): 0:01:11.847653723 0x766b5780 gstoggstream.c:212:gst_ogg_stream_packet_is_key_frame Failed to determine keyframeness of audio/x-opus packet

Here is the code that I use to build the audio pipeline :

/**
 * Initialise the audio network pipeline
 * Create the gstreamer elements
 * @param[in/out]
 * @param[in/out]
 */
int init_pipeline_stream()
{
	DEBUG("+init_pipeline_stream.\n");

	pipeline_audio_stream.pipeline  = gst_pipeline_new ("audio-stream");

	/* Create the elements */

	pipeline_audio_stream.tcpsrc    = gst_element_factory_make ("tcpclientsrc", "source");
	if(!pipeline_audio_stream.tcpsrc) 
	{
		DEBUG("tcpclientsrc element could not be created.\n");
		return AUDIO_SINK_FAILURE;
	}

	pipeline_audio_stream.mux	= gst_element_factory_make ("oggdemux",     "demux");
	if(!pipeline_audio_stream.mux) 
	{
		DEBUG("oggdemux element could not be created.\n");
		return AUDIO_SINK_FAILURE;
	}

	pipeline_audio_stream.decode    = gst_element_factory_make ("opusdec",      "opus");
	if(!pipeline_audio_stream.decode) 
	{
		DEBUG("opusdec element could not be created.\n");
		return AUDIO_SINK_FAILURE;
	}

	pipeline_audio_stream.convert   = gst_element_factory_make ("audioconvert", "convert");
	if(!pipeline_audio_stream.convert) 
	{
		DEBUG("audioconvert element could not be created.\n");
		return AUDIO_SINK_FAILURE;
	}
	
#ifdef __ANDROID__
    	pipeline_audio_stream.audiosink = gst_element_factory_make ("openslessink", "audiosink");
	if(!pipeline_audio_stream.audiosink) 
	{
		DEBUG("openslessink element could not be created.\n");
		return AUDIO_SINK_FAILURE;
	}
#else
	pipeline_audio_stream.audiosink = gst_element_factory_make ("autoaudiosink", "audiosink");
	if(!pipeline_audio_stream.audiosink) 
	{
		DEBUG("autoaudiosink element could not be created.\n");
		return AUDIO_SINK_FAILURE;
	}
#endif
	
	DEBUG("-init_pipeline_stream.\n");

	return AUDIO_SINK_SUCCESS;
}


/**
 * Configure the audio network pipeline
 * Link the gstreamer elements
 * @param[in/out]
 * @param[in/out]
 */
int config_pipeline_stream()
{
	gboolean  status;
	gboolean link_ok;
	GstCaps *caps;

	// gst-launch -v tcpclientsrc host= port=7821 ! oggdemux ! opusdec ! audioconvert ! openslessink/autoaudiosink

	DEBUG("+config_pipeline_stream.\n");

	/* Build the pipeline. Note that we are NOT linking the source at this point */
	status = gst_bin_add (GST_BIN (pipeline_audio_stream.pipeline), pipeline_audio_stream.tcpsrc);
	if(!status) 
	{
		DEBUG("tcpclientsrc could not be added to pipeline.\n");
		return AUDIO_SINK_FAILURE;
	}

	status = gst_bin_add (GST_BIN (pipeline_audio_stream.pipeline), pipeline_audio_stream.mux);
	if(!status) 
	{
		DEBUG("oggdemux could not be added to pipeline.\n");
		return AUDIO_SINK_FAILURE;
	}

	status = gst_bin_add (GST_BIN (pipeline_audio_stream.pipeline), pipeline_audio_stream.decode);
	if(!status) 
	{
		DEBUG("opusdec could not be added to pipeline.\n");
		return AUDIO_SINK_FAILURE;
	}

	status = gst_bin_add (GST_BIN (pipeline_audio_stream.pipeline), pipeline_audio_stream.convert);
	if(!status) 
	{
		DEBUG("audioconvert could not be added to pipeline.\n");
		return AUDIO_SINK_FAILURE;
	}

	status = gst_bin_add (GST_BIN (pipeline_audio_stream.pipeline), pipeline_audio_stream.audiosink);
	if(!status) 
	{
		DEBUG("audiosink could not be added to pipeline.\n");
		return AUDIO_SINK_FAILURE;
	}

	link_ok = gst_element_link(pipeline_audio_stream.tcpsrc, pipeline_audio_stream.mux);

	if (!link_ok)
	{
		DEBUG("Failed to link tcpsrc and decode mux!");
		return AUDIO_SINK_FAILURE;
	} 
	else
		DEBUG("Linked tcpsrc and mux elements!");

	// It is not possible to link the multiplexor to the decoder before the stream has started.
	// The multiplexor needs to receive the stream before it knows whether the contents contain
	// audio/video. A callback is used to perform the link once the oggdemux sink pad is created.
	g_signal_connect (pipeline_audio_stream.mux, "pad-added", G_CALLBACK (on_pad_added_stream), pipeline_audio_stream.decode);

	 /* Set the capabilities between autoaudiosrc and volume elements */
	caps = gst_caps_new_simple ("audio/x-raw", "format", G_TYPE_STRING, "S16LE", "rate", G_TYPE_INT, 
				    __audioSamplingRate, "channels", G_TYPE_INT, __audioChannels,  NULL); 

	link_ok = gst_element_link_filtered (pipeline_audio_stream.decode, pipeline_audio_stream.convert, caps);

	gst_caps_unref (caps);

	if (!link_ok)
	{
		DEBUG("Failed to link decode and convert elements!\n");
		return AUDIO_SINK_FAILURE;
	} 
	else
		DEBUG("Linked decode and convert elements.\n");

	link_ok = gst_element_link(pipeline_audio_stream.convert, pipeline_audio_stream.audiosink);

	if(!link_ok) 
	{
		DEBUG("Unable to link elements.\n");
		return AUDIO_SINK_FAILURE;
	}	
	else
		DEBUG("Linked remaining elements\n");
	
	DEBUG("Setting tcpclientsrc config\n");
	g_object_set (pipeline_audio_stream.tcpsrc, "port", AUDIO_SINK_INTERFACE_PORT, NULL); // set the port
	g_object_set (pipeline_audio_stream.tcpsrc, "host", "localhost", NULL); // set the host

	DEBUG("-config_pipeline_stream.\n");

	return AUDIO_SINK_SUCCESS;
}
Comment 1 Sebastian Dröge (slomo) 2014-05-26 08:25:00 UTC
This warning also happens in a normal

> audiotestsrc ! opusenc ! oggmux ! oggdemux ! fakesink

pipeline
Comment 2 Vincent Penquerc'h 2014-06-02 12:02:44 UTC
commit 716987063c765a74cd9957d6beae810f73bf3d85
Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Date:   Mon Jun 2 12:40:27 2014 +0100

    oggstream: consider all opus packets as "keyframes"
    
    This lets oggdemux determine they are not delta units, and removes
    spurious per packet warnings about being unable to determine the
    packet's keyframeness.