GNOME Bugzilla – Bug 730749
Failed to determine keyframeness of audio/x-opus packet
Last modified: 2014-06-02 12:02:44 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; }
This warning also happens in a normal > audiotestsrc ! opusenc ! oggmux ! oggdemux ! fakesink pipeline
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.