Why the following command doesn’t work on xavier nx ? the X86 computer system is run well
gst-launch-1.0 playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm
Hi,
It looks like https is not supported in gstreamer 1.14.5. You may try Jetpack 5.0.2.
ErrorCode::ErrorCodeType CameraH264HardwareDecoder::CreateGstDecodePipeline()
{
GstStateChangeReturn ret;
/* Create the elements */
m_gstAppSrc = gst_element_factory_make("appsrc", "dji_video_stream_src");
m_gstQueue = gst_element_factory_make("queue", "queue");
m_gstH264Parse = gst_element_factory_make("h264parse", "h264parse");
//m_gstDecode = gst_element_factory_make("omxh264dec", "decode");
m_gstDecode = gst_element_factory_make("nvv4l2decoder", "decode");
//m_gstconv = gst_element_factory_make("nvvidconv","conv");
m_gstAppSink = gst_element_factory_make("appsink", "sink");
//m_gstAppSink = gst_element_factory_make("nvoverlaysink", "sink");
//m_gstAppSink = gst_element_factory_make("nveglglessink", "sink");
/* Create the empty pipeline */
m_gstPipeline = gst_pipeline_new("dji_video_stream_decode_pipeline");
if (!m_gstPipeline || !m_gstAppSrc || !m_gstQueue || !m_gstH264Parse || !m_gstDecode ||
!m_gstAppSink) {
DERROR("Not all gstreamer elements could be created.");
return ErrorCode::SYSTEM_ERROR;
}
//gst_caps_new_simple("video/x-raw","format",G_TYPE_STRING,"RGB16");
/* Build the pipeline */
gst_bin_add_many(GST_BIN (m_gstPipeline), m_gstAppSrc, m_gstQueue, m_gstH264Parse, m_gstDecode,
m_gstAppSink, NULL);
if (gst_element_link_many(m_gstAppSrc, m_gstQueue, m_gstH264Parse, m_gstDecode, m_gstAppSink,
NULL) != TRUE) {
DERROR("Gstreamer elements could not be linked.");
gst_object_unref(m_gstPipeline);
return ErrorCode::SYSTEM_ERROR;
}
//appsrc config
g_object_set(m_gstAppSrc,
"stream-type", GST_APP_STREAM_TYPE_STREAM,
"format", GST_FORMAT_TIME,
"do-timestamp", TRUE,
"is-live", TRUE,
"block", FALSE,
NULL);
//decode disable dpb for low lantency
g_object_set(m_gstDecode, "disable-dpb", TRUE, NULL);
g_object_set(m_gstDecode, "enable-frame-type-reporting", 1, NULL);
// appsink config
/* max queue buffer numbers */
gst_app_sink_set_max_buffers(GST_APP_SINK(m_gstAppSink), 100);
/* drop old buffers when queue is filled */
gst_app_sink_set_drop(GST_APP_SINK(m_gstAppSink), true);
/* Start playing */
ret = gst_element_set_state(m_gstPipeline, GST_STATE_PLAYING);
if (ret == GST_STATE_CHANGE_FAILURE) {
DERROR("Unable to set the pipeline to the playing state.");
gst_object_unref(m_gstPipeline);
return ErrorCode::SYSTEM_ERROR;
}
// create get frame task
m_exitGetNewFrameTask = false;
m_IsGetNewFrameTaskLive = false;
OsdkOsal_TaskCreate(&m_getNewFrameTaskHandle, GetNewFrameTask, 4096, this);
return ErrorCode::SUCCESS;
}
void* GetNewFrameTask(void *arg)
{
CameraH264HardwareDecoder *s_cameraH264HardwareDecoder = (CameraH264HardwareDecoder *)arg;
GstStateChangeReturn ret;
T_Image image;
GstSample *gstImageSample;
GstBuffer *gstImageBuffer;
GstCaps *caps;
GstStructure *gstStructure;
const char *format;
GstMapInfo gstMap;
s_cameraH264HardwareDecoder->m_IsGetNewFrameTaskLive = true;
while (!s_cameraH264HardwareDecoder->m_exitGetNewFrameTask) {
gstImageSample = gst_app_sink_pull_sample(GST_APP_SINK(s_cameraH264HardwareDecoder->m_gstAppSink));
if (gstImageSample != nullptr) {
gstImageBuffer = gst_sample_get_buffer(gstImageSample);
caps = gst_sample_get_caps(gstImageSample);
gstStructure = gst_caps_get_structure(caps, 0);
if (gst_buffer_map (gstImageBuffer, &gstMap, GST_MAP_READ)){
image.width = g_value_get_int(gst_structure_get_value(gstStructure, "width"));
image.height = g_value_get_int(gst_structure_get_value(gstStructure, "height"));
format = g_value_get_string(gst_structure_get_value(gstStructure, "format"));
strcpy(image.format, format);
image.imageData = gstMap.data;
image.imageDataLen = gstMap.size;
printf("format1:%s\r\n",image.format);
printf("height1:%d\r\n",image.height);
printf("width1:%d\r\n",image.width);
printf("gstMap.size:%ld\r\n",gstMap.size);
if (s_cameraH264HardwareDecoder->m_imageCallback != nullptr) {
s_cameraH264HardwareDecoder->m_imageCallback(&image);
}
gst_buffer_unmap(gstImageBuffer, &gstMap);
} else {
DERROR("Gst buffer can't map");
}
gst_sample_unref(gstImageSample);
} else {
if (gst_app_sink_is_eos(GST_APP_SINK(s_cameraH264HardwareDecoder->m_gstAppSink))) {
DSTATUS("Get EOS for appsrc");
}
}
usleep(1000);
}
s_cameraH264HardwareDecoder->m_IsGetNewFrameTaskLive = false;
return nullptr;
}
This code gstMap.size always get wrong value,But using omxh264dec can get the correct value and decoding is no problem,Please help to see where the problem might be,thanks
Hi,
It looks to be something wrong in souphttpsrc
On Jetpack 4.6.2, we see the error:
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstSoupHT
TPSrc:source: Secure connection setup failed.
Additional debug info:
gstsouphttpsrc.c(1379): gst_soup_http_src_parse_status (): /GstPlayBin:playbin0/
GstURIDecodeBin:uridecodebin0/GstSoupHTTPSrc:source:
Unacceptable TLS certificate (6), URL: https://www.freedesktop.org/software/gstr
eamer-sdk/data/media/sintel_trailer-480p.webm, Redirect to: (NULL)
On 5.0.2, the command can be run without hitting the error.
hi, The above code is another problem I encountered. In the code, we directly insert the H264 stream, but we can’t get the correct gstmap.size with nvv4l2decoder. I don’t know where the problem is.
There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks
Sorry for the late response, have you managed to get issue resolved or still need the support? Thanks