对H20T的H264流进行硬解码,延时很大,请问这是为什么?有什么解决办法
已完成对H20T的H264流进行硬解码,延时很大,请问这是为什么?有什么解决办法
-
解码后显示的视频流延迟有多大?你是怎么调用的硬解码?是用我们DJICodecManager解码还是用安卓自带的解码器呢?你跑一下我们的Sample,看看视频流是否有延迟?https://github.com/dji-sdk/Mobile-SDK-Android -
我是使用的你们提供的Linux OSDK 硬解码代码,按照步骤进行的,参考的链接如下:https://bbs.dji.com/forum.php?mod=viewthread&tid=260759;延时估计有好几十秒;流没有延时;
-
依然没有解决这个问题,OSDK提供的硬解码pipline如下:
/* 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_gstAppSink = gst_element_factory_make("appsink", "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){cout << "Not all gstreamer elements could be created." << endl;return ErrorCode::SYSTEM_ERROR;}
/* 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){cout << "Gstreamer elements could not be linked." << endl;gst_object_unref(m_gstPipeline);return ErrorCode::SYSTEM_ERROR;}
//appsrc configg_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 lantencyg_object_set(m_gstDecode, "disable-dpb", TRUE, NULL);
// appsink config// /* max queue buffer numbers */// gst_app_sink_set_max_buffers(GST_APP_SINK(m_gstAppSink), 2);// /* drop old buffers when queue is filled */// gst_app_sink_set_drop(GST_APP_SINK(m_gstAppSink), true);g_object_set(m_gstAppSink,"max-buffers", 2,"drop", TRUE,NULL);
/* Start playing */ret = gst_element_set_state(m_gstPipeline, GST_STATE_PLAYING);if (ret == GST_STATE_CHANGE_FAILURE){cout << "Unable to set the pipeline to the playing state." << endl;gst_object_unref(m_gstPipeline);return ErrorCode::SYSTEM_ERROR;}请问如何看经过元件appsrc、queue、h264parse、omxh264dec、appsink,即经过一条完整pipline进行解码并将数据存储到appsink包含的队列中这一过程的处理帧率?是不是取解码数据时,只要经过gst_app_sink_pull_sample()从appsink中取出的图像数据不模糊、不花屏就意味着处理帧率是跟得上相机帧率的,即H20T相机30帧,解码处理的帧率也有30帧?
请先登录再写评论。
评论
11 条评论