Gstreamer 与 gst-omx Raspberry Pi

2023-12-19

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

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

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 解码器一起使用时,我什么也没得到。

该管道运行良好(但非常慢,所以我在中间关闭了它):

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 执行相同的管道,我得到:

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 ...

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

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

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

尝试检查 gst-omx 但它没有任何检查例程。

谁能解释一下这个问题?

多谢! =D

UPDATE:

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

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 ...

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


刚刚找到解决方案:

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

gpu_mem=128

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

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Gstreamer 与 gst-omx Raspberry Pi 的相关文章

  • GStreamer Tee(多路复用器)

    我正在尝试将视频流 来自我的网络摄像头 存储到 MKV 和 FLV 文件中 这意味着我必须在 h264 编码后分割视频和音频管道 并使用不同的复用器复用每个路径 这就是我想象的它应该如何工作 gt queue gt matroskamux
  • 使用 GStreamer 将视频转换为 WebM

    文档用于GStreamer令人困惑 这仍然不是诉诸的借口StackOverflow com 但仍然 是什么GStreamer命令行将任何视频文件 任何格式 转换为 WebM WebM 音频 这是我能找到的唯一带有示例的文档 http gst
  • UWP:模拟 Windows IoT 上特定坐标的点击

    有没有办法模拟 Windows IoT 上特定坐标的点击 我尝试使用 mouse event mouse event MOUSEEVENTF LEFTDOWN x y 0 0 但是 我收到此错误 System EntryPointNotFo
  • Raspbian 的软浮动版本无法启动

    我在这里下载了 Raspbian 的硬浮动图像 http www raspberrypi org downloads http www raspberrypi org downloads 我将推荐的硬浮动映像复制到 SD 卡上 并且 Ras
  • 使用python发送消息时出现错误400

    我正在尝试使用 Gmail API 发送电子邮件 我已成功通过身份验证 并且我的计算机上有一个 client secret json 文件 我已经能够使用 Gmail API 网站上的快速入门示例获取标签列表 我已成功将范围重置为 SCOP
  • C程序中包含的头文件的默认路径是什么?

    看看我是否在任何 c 文件中写入 include header h 然后它会在当前目录中搜索该文件 但是当我写的时候 include
  • Raspberry Pi 4 上的 .Net Core 和 Raspbian?

    是否可以安装 Net Core树莓派4 with Raspbian 我发现了一些关于 Raspberry Pi 3 上的 Net Core 的说明 例如 https github com dotnet core blob master sa
  • 节点守护进程不会以 process.stdin.setRawMode(true) 启动[重复]

    这个问题在这里已经有答案了 我正在运行节点服务器守护程序 但我不断遇到此错误 当我运行 bash strip 来测试应用程序时 我得到TypeError process stdin setRawMode is not a function
  • Python VLC 实例全屏不起作用

    我对 Python 有点陌生 正在为连接运动传感器的 Raspberry Pi 开发一个应用程序 这个想法是把这个 Raspberry 放在一个房间里 在运动检测时 视频开始全屏播放 视频播放完毕后 我想让设备休眠 10 分钟 然后再次激活
  • Raspberry Pi:未设置 X11 DISPLAY 变量,但该程序执行了需要它的操作

    我正在使用 PuTTY 与 Raspberry Pi 进行套接字连接 我正在开发一个电视记分牌应用程序 我正在使用 WinSCP 来复制这些 sh文件到树莓派 当我运行脚本时 timer sh bin bash java jar home
  • 树莓派蓝牙4.0连接

    我正在尝试使用 CoreBluetooth 蓝牙 4 0 通过 iPhone 连接到 Raspberry Pi 我已经发现了该设备并使用以下代码发出连接请求 if peripheral self foundPeripheral NSLog
  • 如何提高 PySerial 读取速度

    我目前正在构建一台使用 Arduino Mega2560 作为主控制器的机器 Arduino 通过串口连接 获取命令 执行它并每 1ms 吐出一堆测量数据 我有一个运行 Python 的 Raspberry Pi 为用户提供一个漂亮的 GU
  • PYGame - ImportError:没有名为 locals Raspberry Pi 的模块

    我有以下代码 usr bin python coding iso 8859 15 import pygame random from pygame locals import pygame init clock pygame time Cl
  • 树莓派和 GitLab

    有什么办法可以运行 GitLab http gitlab org gitlab ce http gitlab org gitlab ce 和 GitLab CI http gitlab org gitlab ci http gitlab o
  • 在 Raspberry Pi 上 - 登录后自动启动终端?

    我现在正在做一个小项目 我希望 python 脚本在登录 GUI 后自动运行 我按照这里的步骤操作 https www raspberrypi org forums view https www raspberrypi org forums
  • 如何从 Linux 的 shell 中删除所有以 ._ 开头的文件?

    确实如标题所示 我已将许多文件从 Mac 复制到 Raspberry Pi 这导致了许多以前缀开头的多余文件 我想删除以以下开头的文件夹中的每个文件 我该怎么做 尝试类似的方法 cd path to directory rm rf 或者 如
  • gstreamer 中的无缝视频循环

    我正在尝试使用 gstreamer 循环播放视频 它是 python 绑定 第一次尝试是hook EOSmessage并为管道生成搜索消息 import gi gi require version Gst 1 0 from gi repos
  • opc ua客户端到服务器

    我想知道是否可以将数据从 OPC UA 客户端发送到服务器 我有一台设置了 OPC UA 服务器的 Windows 10 PC 和一些 Raspberry Pi 作为客户端 我已经编写了 Python 代码来将数据从服务器发送到客户端 现在
  • 降低Python中的浮点精度以提高性能[重复]

    这个问题在这里已经有答案了 我正在树莓派上使用 python 我使用互补滤波器从陀螺仪中获得更好的值 但它消耗了太多树莓派的电量 大约为 70 我认为可以通过降低浮点精度来提高性能 现在 结果大约有 12 位小数 这超出了我的需要 有什么办
  • VideoCapture.read() 返回过去的图像

    我在跑python3 6 with openCV on the Raspberry pi OS is Raspbian 代码的大致结构如下 The image以时间间隔 3 5 分钟 捕获 被捕获image在函数中处理并返回度量 精度的种类

随机推荐