I needed to switch my project to Qt5 and tried using setMedia and gst:pipeline but that wasn't working for me either. Right now, the pipeline below works as it connects to the camera I need it to and opens the gstreamer output. However, it opens it in a new window and not the Qt Video Widget I am using. I know autovideosink ignores the window overlay, but I tried other sinks and just got a black screen. How could I get this to work? I tried glimagesink which worked for the videotestsrc but it did not work for this.
w->pipeline = gst_parse_launch(
"udpsrc port=8000 ! application/x-rtp, encoding-name=H264, payload=109 ! rtph264depay ! h264parse ! queue !
avdec_h264 ! videoconvert ! autovideosink", NULL);
/* [4] Set video overlay */
gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(w->pipeline), w->getVideoWinID());
/* [5] Run the pipeline */
qDebug() << "------------------------------ Starting pipeline ------------------------------";
GstStateChangeReturn sret = gst_element_set_state(w->pipeline, GST_STATE_PLAYING);
if (sret == GST_STATE_CHANGE_FAILURE)
{
gst_element_set_state(w->pipeline, GST_STATE_NULL);
gst_object_unref(w->pipeline);
}