带有 gst-omx 树莓派的 Gstreamer [英] Gstreamer with gst-omx Raspberry Pi

查看:121
本文介绍了带有 gst-omx 树莓派的 Gstreamer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照本教程使用 gst-omx 编译了 gstreamer:http://www.onepitwopi.com/raspberry-pi/gstreamer-1-2-on-the-raspberry-pi/

I compiled the gstreamer with gst-omx following this tutorial: http://www.onepitwopi.com/raspberry-pi/gstreamer-1-2-on-the-raspberry-pi/

一切都很顺利,最后当我运行 gst-inspect-1.0 |我得到了 grep omx:

Everything went fine and in the end when i ran gst-inspect-1.0 | grep omx I got:

omx:  omxmpeg2videodec: OpenMAX MPEG2 Video Decoder
omx:  omxmpeg4videodec: OpenMAX MPEG4 Video Decoder
omx:  omxh263dec: OpenMAX H.263 Video Decoder
omx:  omxh264dec: OpenMAX H.264 Video Decoder
omx:  omxtheoradec: OpenMAX Theora Video Decoder
omx:  omxvp8dec: OpenMAX VP8 Video Decoder
omx:  omxmjpegdec: OpenMAX MJPEG Video Decoder
omx:  omxvc1dec: OpenMAX WMV Video Decoder
omx:  omxh264enc: OpenMAX H.264 Video Encoder
omx:  omxanalogaudiosink: OpenMAX Analog Audio Sink
omx:  omxhdmiaudiosink: OpenMAX HDMI Audio Sink

一切看起来都很好,但是当我尝试将 gst-launch-1.0 与 omx 解码器一起使用时,我什么也没得到.

Everything seems fine but when I try to use gst-launch-1.0 with the omx decoder I get nothing.

这个管道运行良好(但真的很慢所以我在中间关闭了它):

This pipeline runs fine(but really slow so I closed it in the middle):

pi@raspberrypi ~ $ gst-launch-1.0 filesrc location=./h264_720p_hp_5.1_6mbps_ac3_planet.mp4 ! qtdemux ! h264parse ! avdec_h264 ! eglglessink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(Gst    EGLDisplay)NULL;
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
WARNING: from element /GstPipeline:pipeline0/GstEglGlesSink:eglglessink0: A lot of buffers are being dropped.
Additional debug info:
gstbasesink.c(2791): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstEglGlesSink:eglglessink0:
There may be a timestamping problem, or this computer is too slow.
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:07.915424268
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

然后我用 omx 尝试相同的管道,我得到了这个:

Then I try the same pipeline with omx I get this:

pi@raspberrypi ~ $ gst-launch-1.0 -v filesrc location=h264_720p_hp_5.1_6mbps_ac3_planet.mp4 ! qtdemux ! h264parse ! omxh264dec ! eglglessink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)5.1, profile=(string)high, codec_data=(buffer)01640033ffe1001867640033ac34e2805005ba10001974f004c4b408f18318a801008468eebce5531cc305d2628d13080214868783a1c0d04e12142c0ac0da02fe10042ad35e9e850b748c778a1410088b172105449ca3050e204448b20a4d8a081827090809848541dc4290a43164215a201900cae8340f81e86f03300b6017002ac05981d61a07802a8400a902087404700bc010506e036404b811805902e07203e0087ff85b, width=(int)1280, height=(int)720, framerate=(fraction)24000/1001, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, level=(string)5.1, profile=(string)high, width=(int)1280, height=(int)720, framerate=(fraction)24000/1001, pixel-aspect-ratio=(fraction)1/1, parsed=(boolean)true
/GstPipeline:pipeline0/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0.GstPad:sink: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, level=(string)5.1, profile=(string)high, width=(int)1280, height=(int)720, framerate=(fraction)24000/1001, pixel-aspect-ratio=(fraction)1/1, parsed=(boolean)true
/GstPipeline:pipeline0/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt709, framerate=(fraction)24000/1001
/GstPipeline:pipeline0/GstEglGlesSink:eglglessink0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt709, framerate=(fraction)24000/1001
ERROR: from element /GstPipeline:pipeline0/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0: Could not configure supporting library.
Additional debug info:
gstomxvideodec.c(1505): gst_omx_video_dec_loop (): /GstPipeline:pipeline0/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0:
Unable to reconfigure output port
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
/GstPipeline:pipeline0/GstEglGlesSink:eglglessink0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstQTDemux:qtdemux0.GstPad:video_0: caps = NULL
/GstPipeline:pipeline0/GstQTDemux:qtdemux0.GstPad:audio_0: caps = NULL
Freeing pipeline ...

我认为这是这个错误最重要的部分:

I think this is the most important part of this error:

ERROR: from element /GstPipeline:pipeline0/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0: Could not configure supporting library.

但找不到任何对此错误的引用...

but couldn't find any reference to this error...

试图检查 gst-omx 但它没有任何检查例程.

Tried to make check the gst-omx but it doesn't have any check routine.

有人能解释一下这件事吗?

Can anyone shed some light in this matter?

非常感谢!=D

更新:

奇怪的是,如果我在没有 hdmi 电缆的情况下启动我的 rpi 并通过 ssh 执行我的管道它工作(但我没有看到任何图像,因为 hdmi 电缆已关闭)

Strangely, if I started my rpi without the hdmi cable and executed my pipeline via ssh it worked(but I didn't see any image because the hdmi cable was off)

pi@raspberrypi ~ $ gst-launch-1.0 -v filesrc location=h264_720p_hp_5.1_6mbps_ac3_planet.mp4 ! qtdemux ! h264parse ! omxh264dec ! eglglessink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)5.1, profile=(string)high, codec_data=(buffer)01640033ffe1001867640033ac34e2805005ba10001974f004c4b408f18318a801008468eebce5531cc305d2628d13080214868783a1c0d04e12142c0ac0da02fe10042ad35e9e850b748c778a1410088b172105449ca3050e204448b20a4d8a081827090809848541dc4290a43164215a201900cae8340f81e86f03300b6017002ac05981d61a07802a8400a902087404700bc010506e036404b811805902e07203e0087ff85b, width=(int)1280, height=(int)720, framerate=(fraction)24000/1001, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, level=(string)5.1, profile=(string)high, width=(int)1280, height=(int)720, framerate=(fraction)24000/1001, pixel-aspect-ratio=(fraction)1/1, parsed=(boolean)true
/GstPipeline:pipeline0/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0.GstPad:sink: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, level=(string)5.1, profile=(string)high, width=(int)1280, height=(int)720, framerate=(fraction)24000/1001, pixel-aspect-ratio=(fraction)1/1, parsed=(boolean)true
/GstPipeline:pipeline0/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt709, framerate=(fraction)24000/1001
/GstPipeline:pipeline0/GstEglGlesSink:eglglessink0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt709, framerate=(fraction)24000/1001
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:01:52.821428472
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

这是否意味着问题出在 eglglessink 上?

Does this mean that the problem is in the eglglessink?

推荐答案

刚刚找到解决方案:

我忘记增加gpu的内存,所以我的720p视频解码没有足够的内存来运行.简单的解决方法就是添加

I forgot to increase the memory of the gpu, so my 720p video decoding didn't have enough memory to run. The easy fix is just to add

gpu_mem=128

到/boot/config.txt 并重新启动树莓派.毕竟,它与 eglglessink 相关 ;D

to /boot/config.txt and reboot the raspberry. It was, after all, related to eglglessink ;D

这篇关于带有 gst-omx 树莓派的 Gstreamer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆