dji-sdk / Onboard-SDK

DJI Onboard SDK Official Repository
https://github.com/dji-sdk/Onboard-SDK
Other
912 stars 632 forks source link

Zenmuse Z30 + startH264Stream + Gstreamer --> no usefull Video #853

Closed mseidler1 closed 2 years ago

mseidler1 commented 2 years ago

Hello, I'm tryining to get a H264 video from the Zenmuse Z30 mounted on position 1 of the Matrice300RTK. I'm using the Manifold 2-G. The H264 stream of the camera is written to a local UDP port and mapped to an RTSP-Sever. In the attached picture you see the RTSP stream. But the video on the Manifold 2-G was showing (using gst-launch.1-0) an identical result.

By the startH264Stream only a grey wobbely artefact video is generated. I'm thinking the reason could be an resolution issue. Used resolution is 1920 x 1080 for the Z30. Must be any special codec used for this camera?

BR, Michael

P.S.: Attached some pieces of the code used. The identical code is working for the FPV camera.

I'm starting the video with:

vehicle->advancedSensing->startH264Stream(LiveView::OSDK_CAMERA_POSITION_NO_1, cam1_liveViewSampleCb, NULL);

The video stream is handed over to Gstreamer to make it available on the local UDP-Port:

cam1_pipeline = gst_pipeline_new("pipeline");
cam1_appsrc = gst_element_factory_make("appsrc", "source");
cam1_parse = gst_element_factory_make("h264parse", "parse");
cam1_decoder = gst_element_factory_make("avdec_h264", "decoder");
cam1_scale = gst_element_factory_make("videoscale", "scale");
cam1_filter1 = gst_element_factory_make("capsfilter", "filter1");
cam1_conv = gst_element_factory_make("videoconvert", "conv");
cam1_encoder = gst_element_factory_make("omxh264enc", "encoder");
cam1_filter2 = gst_element_factory_make("capsfilter", "filter2");
cam1_rtppay = gst_element_factory_make("rtph264pay", "rtppay");
cam1_udpsink = gst_element_factory_make("udpsink", "sink");

cam1_scale_caps = gst_caps_new_simple("video/x-raw",
                                 "width", G_TYPE_INT, con_width,
                                 "height", G_TYPE_INT, con_height,
                                 NULL);

cam1_omx_caps = gst_caps_new_simple("video/x-h264",
                               "stream-format", G_TYPE_STRING, "byte-stream",
                               NULL);

g_object_set(G_OBJECT(cam1_filter1), "caps", cam1_scale_caps, NULL);
g_object_set(G_OBJECT(cam1_filter2), "caps", cam1_omx_caps, NULL);
gst_caps_unref(cam1_scale_caps);
gst_caps_unref(cam1_omx_caps);

g_object_set(cam1_udpsink, "host", "127.0.0.1", NULL);
g_object_set(cam1_udpsink, "port", 5556, NULL);
g_object_set(cam1_udpsink, "sync", false, NULL);
g_object_set(cam1_udpsink, "async", false, NULL);

gst_bin_add_many(GST_BIN(cam1_pipeline), cam1_appsrc, cam1_parse, cam1_decoder, cam1_scale, cam1_filter1, cam1_conv, cam1_encoder, cam1_filter2, cam1_rtppay, cam1_udpsink, NULL);
gst_element_link_many(cam1_appsrc, cam1_parse, cam1_decoder, cam1_scale, cam1_filter1, cam1_conv, cam1_encoder, cam1_filter2, cam1_rtppay, cam1_udpsink, NULL);

dji

dji-dev commented 2 years ago

Agent comment from DJI SDK in Zendesk ticket #57574:

尊敬的开发者,感谢您联系DJI 大疆创新 由于github不是我们主要的咨询渠道,您的问题可能跟进不及时。我们建议您通过填写表单( https://djisdksupport.zendesk.com/hc/zh-cn/requests/new )向我们反馈问题。或者您也可以在论坛发帖,与其它开发者交流。论坛链接:https://djisdksupport.zendesk.com/hc/zh-cn/community/topics

Dear developer, thank you for contacting DJI. Since github is not our main consultation channel, your questions may not be followed up in time. We recommend that you fill in the form (https://djisdksupport.zendesk.com/hc/en-us/requests/new) to report problems to us. Or you can post in the forum to communicate with other developers. Forum link: https://djisdksupport.zendesk.com/hc/zh-cn/community/topics

°°°

mseidler1 commented 2 years ago

Update of Z30 was needed. Now the stream works great.