如何在树莓派 4B 上启用对 H.264 编码的硬件支持

MSD*_*aul 6 ffmpeg h.264 hardware-acceleration raspberry-pi4

我正在尝试在树莓派 4B 型号上启用对 H264 编码的硬件支持。编译 FFmpeg 源以启用配置

sudo ./configure --arch=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree
Run Code Online (Sandbox Code Playgroud)

点击链接,https://github.com/legotheboss/YouTube-files/wiki/( RPi)-Compile-FFmpeg-with-the-OpenMAX-H.264-GPU-acceleration

但是在正确构建和安装 ffmpeg 并正确配置这些配置后执行编码命令时,我收到以下错误

[h264_omx @ 0x156b6e0] Using OMX.broadcom.video_encode
[h264_omx @ 0x156b6e0] OMX error 80001000
[h264_omx @ 0x156b6e0] err 80001018 (-2147479528) on line 561
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
Run Code Online (Sandbox Code Playgroud)

使用的命令:

ffmpeg -i /media/pi/pic_1_org.png -c:v h264_omx -c:a copy -b:v 1500k outputfile.mp4
Run Code Online (Sandbox Code Playgroud)

我只想使用 H.264 编码器将单个 4K 图像编码为 .mp4 文件。请让我知道如何解决这个问题?

Mar*_*ann 5

Raspberry Pi 4 上的硬件 H.264 编码器仅支持 1920x1080 或更低的分辨率。所以没有硬件支持4k编码。

  • 我想我不明白你的问题 (3认同)