我正在尝试使用h264_omx
在 RPI 上进行编码,但是我收到此错误:
[h264_omx @ 0x68500890] libOMX_Core.so not found
[h264_omx @ 0x68500890] libOmxCore.so not found
[libx264 @ 0x68502040] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x68502040] profile Constrained Baseline, level 3.1, 4:2:0, 8-bit
然而:
- 我从启用 omx 的源代码构建 ffmpeg;下面是我遵循的步骤:
sudo apt-get remove ffmpeg
sudo apt-get install cmake libomxil-bellagio0 libomxil-bellagio-dev
git clone https://github.com/raspberrypi/userland.git
cd userland
./buildme
wget https://ffmpeg.org/releases/ffmpeg-6.0.tar.xz
tar -xf ffmpeg-6.0.tar.xz && cd ffmpeg-6.0
./configure --enable-omx --enable-omx-rpi
make && sudo make install
- 如果我
omx
从终端测试编码器,在相同的 RPI 上
ffmpeg -i giphy.gif -c:v h264_omx giphy.mp4 -y
它起作用了。我得到了这个:
ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 10 (Raspbian 10.2.1-6+rpi1)
configuration: --enable-omx --enable-omx-rpi
libavutil 58. 2.100 / 58. 2.100
libavcodec 60. 3.100 / 60. 3.100
libavformat 60. 3.100 / 60. 3.100
libavdevice 60. 1.100 / 60. 1.100
libavfilter 9. 3.100 / 9. 3.100
libswscale 7. 1.100 / 7. 1.100
libswresample 4. 10.100 / 4. 10.100
Input #0, gif, from 'giphy.gif':
Duration: 00:00:02.19, start: 0.000000, bitrate: 6756 kb/s
Stream #0:0: Video: gif, bgra, 800x600, 33.33 fps, 33.33 tbr, 100 tbn
Stream mapping:
Stream #0:0 -> #0:0 (gif (native) -> h264 (h264_omx))
Press [q] to stop, [?] for help
[h264_omx @ 0x2012100] Using OMX.broadcom.video_encode
Output #0, mp4, to 'giphy.mp4':
Metadata:
encoder : Lavf60.3.100
Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(tv, progressive), 800x600, q=2-31, 200 kb/s, 33.33 fps, 12800 tbn
Metadata:
encoder : Lavc60.3.100 h264_omx
frame= 31 fps=0.0 q=-0.0 Lsize= 24kB time=00:00:00.90 bitrate= 221.5kbits/s speed=1.05x
- 如果我查找丢失的文件(
libOMX_Core.so
和libOmxCore.so
),我无法在任何地方找到它们;但是,我不知道它们是否应该在某个地方,或者是 aiortc 正在寻找错误的文件。这是我有的:
ls /opt/vc/lib/
libbcm_host.so libbrcmOpenVG.so libdebug_sym.so libEGL.so libGLESv2_static.a libmmal_components.so libmmal_util.so libOpenVG.so libvcilcs.a libWFC.so
libbrcmEGL.so libbrcmWFC.so libdebug_sym_static.a libEGL_static.a libkhrn_client.a libmmal_core.so libmmal_vc_client.so libvchiq_arm.so libvcos.so pkgconfig
libbrcmGLESv2.so libcontainers.so libdtovl.so libGLESv2.so libkhrn_static.a libmmal.so libopenmaxil.so libvchostif.a libvcsm.so plugins
任何帮助将不胜感激!