Adding metadata to a GStreamer pipeline containing jpegenc

50 Views Asked by At

I'm bashing my head against this problem for a while now. What I'd like to ultimately acomplish is to have a Gstreamer pipeline that streams jpeg encoded video over UDP to a different PC while adding sequential frameid metadata to it via gst_buffer_add_meta. I've been able to get the adding metadata part working with these two pipelines on the source side:

videotestsrc pattern=0 ! "CAPS" ! identity name=meta_identity ! shmsink wait-for-connection=false sync=true socket-path=/tmp/cam0

shmsrc is-live=true do-timestamp=true socket-path=/tmp/cam0" ! "CAPS" ! jpegenc ! rtpjpegpay ! udpsink

The pipeline has been split due to my reconfiguration needs, but then I realised the metadata is not making it through the shmsink. Shmsink cannot serialize GstMeta. This link also suggests to implement the gst_meta_serialize, but I'm unfortunately bound to an old GStreamer version that doesn't have this option.

With this unfortunate thing I've combined those two pipelines into one in hopes that it would solve all my problems but then the meta_identity handoff callback started to SEGFAULT when returning from the callback on g_type_get_qdata and gst_meta_api_type_has_tag calls. This only happens when I include jpegenc element.

I'm not that familiar with how GStreamer handles the GstBuffer internally and those SEGFAULTS are not pointing me to any specific direction where to start debugging. Has anyone ever dealt with such issue? Or am I completely going in a wrong direction? My only goal was to propagate the frameId (and possibly timestamp of the camera source element) over the UDP so I can match frames on both ends and measure latency (both PCs are synced with NTP).

0

There are 0 best solutions below