Video freezes for few seconds and buffers being dropped error

classic Classic list List threaded Threaded
4 messages Options
JSP
Reply | Threaded
Open this post in threaded view
|

Video freezes for few seconds and buffers being dropped error

JSP
Hi experts,
I have the following pipeline,

appsrc = gst_element_factory_make ("appsrc", "source");
  packer = gst_element_factory_make ("rtph264pay", "packer");
  videosink = gst_element_factory_make ("udpsink", "videosink");

  /* setup */

  g_object_set (G_OBJECT (appsrc), "caps",
  gst_caps_new_simple ("video/x-h264",
                                     "stream-format", G_TYPE_STRING, "byte-stream",
                                         "alignment" ,G_TYPE_STRING,"nal",
                                         "level",G_TYPE_STRING,"2",
                                         "profile",G_TYPE_STRING,"high",
                                         "width", G_TYPE_INT, 720,
                                     "height", G_TYPE_INT, 576,
                                         "pixel-aspect-ratio",GST_TYPE_FRACTION,1,1,
                                     "framerate", GST_TYPE_FRACTION, 30, 1,
                                     NULL), NULL);


In receiver side,

gst-launch-1.0 -v udpsrc multicast-group=239.192.1.6 auto-multicast=true  port=5004 ! "application/x-rtp, media=video, clock-rate=90000, encoding-name=H264, packetization-mode=(string)1, profile-level-id=(string)640014, a-framerate=(string)25, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! ximagesink

I am getting the video in receiver side, but it freezes for few seconds and recovers. Sometimes receiver is crashing and sometimes the following error also occurs.

WARNING: from element /GstPipeline:pipeline0/GstXImageSink:ximagesink0: A lot of buffers are being dropped.
Additional debug info:
gstbasesink.c(2854): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstXImageSink:ximagesink0:
There may be a timestamping problem, or this computer is too slow.

what is the issue with this sender and receiver pipeline?

How to find the caps of rtph264pay element?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Video freezes for few seconds and buffers being dropped error

Arjen Veenhuizen
First of all, your framerate does not match between server and client (30/1 vs 25/1). You should also add an rtpjitterbuffer between src and depayloader, e.g.
udpsrc - rtpjitterbuffer - rtph264depay ! decodebin ! queue ! videoconvert ! ximagesink

Optionally, for debugging only, you could put sync=false on ximagesink. That will take away the stuttering (but is not a proper fix for your problem).
JSP
Reply | Threaded
Open this post in threaded view
|

Re: Video freezes for few seconds and buffers being dropped error

JSP
Hi Arjen,
Thanks for your reply.

I have tried both of your suggestion and corrected the frame rate also. Still I am getting same issue. With jitterbuffer, the video seems very slow and blurred and it freezes for few seconds and recovers.

Any help?

One more question,
How to get the caps forrtph264pay? I have tried to add a probe, but facing error.

pad = gst_element_get_static_pad (packer, "packer");
        gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, (GstPadProbeCallback) cb_have_data, NULL, NULL);
  gst_object_unref (pad);

get static pad returns null. I dont know the reason. Any help?

Thanks,
JSP
Reply | Threaded
Open this post in threaded view
|

Re: Video freezes for few seconds and buffers being dropped error

Arjen Veenhuizen
You should add an notify::caps event listener on the src-pad to get the proper caps. In python, it would read something like:
elementH264Parse.get_static_pad("src").connect("notify::caps", self.cbH264ParseNotifyCaps)

def cbH264ParseNotifyCaps(self, argPad, argCaps):
	neg_caps = argPad.get_current_caps()
	print 'RTP output caps: "%s"' % (neg_caps.to_string())

It is still weird that you get incorrect playback. What is your bitrate?