|
lubuntu 16.04 下 gstreamer 软解 h264 的问题
发表于 2017-9-28 11:00:24
浏览:9120
|
回复:3
打印
只看该作者
[复制链接]
楼主
用的gstreamer1.8.3,以下是相关配置:
source = gst_element_factory_make ("filesrc", "file-source");
parse = gst_element_factory_make ("h264parse"/*"vaapiparse_h264"*/, "vaapiparse");
decoder = gst_element_factory_make ("avdec_h264", "decoder");
sink = gst_element_factory_make ("xvimagesink", "sink");
g_object_set (G_OBJECT (vdp->source), "location", DATA_FIFO, NULL);
g_object_set (G_OBJECT (vdp->source), "blocksize", TOTAL_DATA_LEN, NULL);
g_object_set (G_OBJECT (vdp->sink), "sync", 0, NULL);
//g_object_set (G_OBJECT (vdp->sink), "display", 2, NULL); //va/glx display
//g_object_set (G_OBJECT (vdp->sink), "fullscreen", 1, NULL);
以下是跑了两帧数据的打印信息:
----- file ./h264_1920x1080/1.h264 [133260]---------
gstavviddec.c --- frame 0 to call gst_ffmpegviddec_handle_frame, size = 133262
gstavviddec.c --- frame 0 to call gst_ffmpegviddec_frame, size = 133262
gstavviddec.c --- frame 0 to call gst_ffmpegviddec_video_frame, size = 133262
gst_ffmpegviddec_video_frame --- 1362 --- len < 0 or data is NULL, goto beach!
gsth264parse.c --- frame 0 to call gst_h264_parse_handle_frame, size = 133260
gstbaseparse.c --- frame 0 to call gst_base_parse_handle_buffer, skipped = 915316, flushed = 133260
----- file ./h264_1920x1080/2.h264 [131296]---------
gstavviddec.c --- frame 1 to call gst_ffmpegviddec_handle_frame, size = 131298
gstavviddec.c --- frame 1 to call gst_ffmpegviddec_frame, size = 131298
gstavviddec.c --- frame 1 to call gst_ffmpegviddec_video_frame, size = 131298
gsth264parse.c --- frame 1 to call gst_h264_parse_handle_frame, size = 131296
gstbaseparse.c --- frame 1 to call gst_base_parse_handle_buffer, skipped = 917280, flushed = 131296
解码器自己下了源码包:gst-libav-1.8.3.tar.xz,gstavviddec.c 里面加了一些打印信息。
解析器自己下了源码包:gst-plugins-bad-1.8.3.tar.xz,改了 gsth264parse.c 里面 gst_h264_parse_handle_frame 函数的处理,加了打印。
gstreamer-1.8.3.tar.xz 的 gstbaseparse.c 里面加了打印。
现在的问题就是不管跑多少帧,第一帧都会打印这个: gst_ffmpegviddec_video_frame --- 1362 --- len < 0 or data is NULL, goto beach!,所以只跑一帧的话不会有任何显示。在实际应用中会出现卡在最后一帧,只有下一帧来了才会恢复正常,见楼下图。当然也不确定是不是这个原因,才接触编解码不久,希望各位前辈们能指点一下,先谢谢了。 |
|