<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi Nicolas,</div><div><br></div><div>><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:100%;float:none;background-color:transparent">There is no code for buffer list there, with buffer list you need to</span><br style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;overflow:visible;text-decoration:none;word-spacing:0px;white-space:normal;font-size-adjust:none;font-stretch:100%;background-color:transparent"><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:100%;float:none;background-color:transparent">
use different API. Also, before you modify a buffer, you need to ensure</span><br style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;overflow:visible;text-decoration:none;word-spacing:0px;white-space:normal;font-size-adjust:none;font-stretch:100%;background-color:transparent"><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:100%;float:none;background-color:transparent">
it's writable, making it writable will may change the GstBuffer, so you</span><br style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;overflow:visible;text-decoration:none;word-spacing:0px;white-space:normal;font-size-adjust:none;font-stretch:100%;background-color:transparent"><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:100%;float:none;background-color:transparent">
have to update that pointer.</span></div><div><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:100%;float:none;background-color:transparent"><br></span></div><div><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:100%;float:none;background-color:transparent">Thank you for the pointers.</span></div><div><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:100%;float:none;background-color:transparent"><br></span></div><div><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:100%;float:none;background-color:transparent">I have attached the modified JPEG code which handles BUFFER_LIST.<br>However, for each frame I get around 100 lists, hence, same frame_count is printed around 100 times, both in case of send_jpeg.c and recv_jpeg.c.</span></div><div><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:100%;float:none;background-color:transparent"><br></span></div><div><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:100%;float:none;background-color:transparent">And the program is also very slow, which I believe is due to attaching probe on each bufferlist.</span></div><div><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:100%;float:none;background-color:transparent"><br></span></div><div><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:100%;float:none;background-color:transparent">But my pain point is I wanted to propagate a unique frame number across UDP to identify each frame and what I have got is around 100 lists per frame, which makes this frame number useless for me. How do I make use of this frame number which I have got?</span></div><div><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:100%;float:none;background-color:transparent"><br></span></div><div><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:100%;float:none;background-color:transparent">Is my explanation clear enough to understand the purpose of sending frame number across UDP?</span></div><div><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:100%;float:none;background-color:transparent"><br></span></div><div><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:100%;float:none;background-color:transparent">Thanks,</span></div><div><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:100%;float:none;background-color:transparent">Priyanka Kataria</span></div></div></div></div><br><div class="gmail_quote"><div class="gmail_attr" dir="ltr">On Fri, Sep 27, 2019 at 7:03 PM Nicolas Dufresne <<a href="mailto:nicolas@ndufresne.ca">nicolas@ndufresne.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">Le vendredi 27 septembre 2019 à 10:49 +0530, priyanka kataria a écrit :<br>
> Hi Nicolas,<br>
> <br>
> Thank you for quick reply.<br>
> <br>
> > Consider adding an rtpjitterbuffer on the receiver, in future GST version, you'll be able to use rtpsrc/rtpsink (or the rist variant) in order to get a full feature RTP stream without complex pipeline construction.<br>
> <br>
> The actual pipeline which I use in the program has "rtpjitterbuffer", I shared a simple test pipeline.<br>
> <br>
> >For jpeg, consider configuring max-bitrate property on udpsink. As frames are spread out on a lot more packet, it tend to become bursty and may saturate the link or exhaust the udpsrc socket buffer-size.<br>
> <br>
> Point noted, will make the changes.<br>
> <br>
> >That is the method I would have used. It should work with any RTP packet, so you likely have or hit a bug.<br>
> Here, I am attaching the source code for option 3 I tried.<br>
> <br>
> "send_h264.c" and "recv_h264.c", work successfully and the frame number is appended to RTP buffer. Prints in both the probes output the correct value.<br>
> <br>
> However, the probe function (pay_src_probe) in "send_jpeg.c" never gets called.<br>
> When I change the probe type from "GST_PAD_PROBE_TYPE_BUFFER" to "GST_PAD_PROBE_TYPE_BUFFER_LIST", then it gets called, and the frame numbers appended are wrong. i.e. for each frame around 100 times this function gets called and program slows down like a sloth.<br>
<br>
There is no code for buffer list there, with buffer list you need to<br>
use different API. Also, before you modify a buffer, you need to ensure<br>
it's writable, making it writable will may change the GstBuffer, so you<br>
have to update that pointer.<br>
<br>
> <br>
> I checked the source code for "rtph264pay" and rtpjpegpay" element, both of them are creating buffer lists which I guess is to push multiple RTP packets at one go, to the next element in pipeline.<br>
> But strangely H264 works fine and JPEG fails.<br>
> <br>
> Please check if my code has some bug.<br>
> <br>
> And do you have any suggestions on KLV metadata approach?<br>
> <br>
> Thanks,<br>
> Priyanka<br>
> <br>
> On Thu, Sep 26, 2019 at 7:11 PM Nicolas Dufresne <<a href="mailto:nicolas@ndufresne.ca" target="_blank">nicolas@ndufresne.ca</a>> wrote:<br>
> > <br>
> > Le jeu. 26 sept. 2019 05 h 25, priyanka kataria <<a href="mailto:priyanka.kataria86@gmail.com" target="_blank">priyanka.kataria86@gmail.com</a>> a écrit :<br>
> > > Hello,<br>
> > > <br>
> > > I have an interesting problem:<br>
> > > Need to transfer some kind of metadata (say frame number) with each frame over UDP. Receiver on the other hand, extracts he frame numebr from each frame and maintains it for some other work.<br>
> > > <br>
> > > Sample sender and receiver pipelines:<br>
> > > Sender: gst-launch-1.0 -v filesrc location=file.h264  ! h264parse ! rtph264pay ! udpsink port=5001<br>
> > > Receiver: gst-launch-1.0 -v udpsrc port=5001 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264" ! rtph264depay ! decodebin ! autovideosink<br>
> > <br>
> > Consider adding an rtpjitterbuffer on the receiver, in future GST version, you'll be able to use rtpsrc/rtpsink (or the rist variant) in order to get a full feature RTP stream without complex pipeline construction.<br>
> > <br>
> > For jpeg, consider configuring max-bitrate property on udpsink. As frames are spread out on a lot more packet, it tend to become bursty and may saturate the link or exhaust the udpsrc socket buffer-size.<br>
> > <br>
> > <br>
> > > Things I have already tried (I am still a beginner, so some of the below things may look stupid):<br>
> > > 1. In Sender pipeline, attaching a probe on "h264parse" element and assigning incremental values to "GST_BUFFER_OFFSET". <br>
> > > But the set offset value is not reflected in the next element in the same pipeline only.<br>
> > > <br>
> > > 2. In Sender pipeline, attaching a probe on "h264parse" element and assigning incremental values to "GST_BUFFER_PTS". <br>
> > > The set PTS value is reflected in the next elements in the same pipeline, but gets lost across UDP.<br>
> > > I checked this by attaching a probe on "rtph264depay" element (src pad).<br>
> > > <br>
> > > 3. Using "gst_rtp_buffer_add_extension_twobytes_header()".<br>
> > > This method works for H264 files, but fails with MJPEG files, and my solution needs to be generic.<br>
> > > Here, I can provide more details with code if required.<br>
> > <br>
> > That is the method I would have used. It should work with any RTP packet, so you likely have or hit a bug.<br>
> > <br>
> > > 4. Last thing I am trying is to mux KLV metadata into stream and send it across UDP.<br>
> > > I refer the following link: <a href="https://www.aeronetworks.ca/2018/05/mpeg-2-transport-streams.html" target="_blank" rel="noreferrer">https://www.aeronetworks.ca/2018/05/mpeg-2-transport-streams.html</a>.<br>
> > > This doesn't work though as written in the article but gave me an overview on how to use the pipeline.<br>
> > > Now I want to create my custom my KLV metadata file which contains only frame numbers and try to mux it.<br>
> > > <br>
> > > Please help me in creating such file.<br>
> > > <br>
> > > Also please share if there are any other working approaches I should try to append metadata in each frame buffer.<br>
> > > <br>
> > > Thanks,<br>
> > > Priyanka<br>
> > > _______________________________________________<br>
> > > gstreamer-devel mailing list<br>
> > > <a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
> > > <a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank" rel="noreferrer">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
> > <br>
> > _______________________________________________<br>
> > gstreamer-devel mailing list<br>
> > <a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
> > <a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank" rel="noreferrer">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
> <br>
> _______________________________________________<br>
> gstreamer-devel mailing list<br>
> <a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank" rel="noreferrer">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank" rel="noreferrer">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></blockquote></div>