homebridge/homebridge-raspbian-image

h264_omx can't be used with HomeBridge image

valkjsaaa opened this issue · 2 comments

Describe The Bug:

FFMpeg throws an Error when using h264_omx
To Reproduce:

run the following command in shell

ffmpeg -re -f video4linux2 -video_size 1920x1080 -i /dev/video0 -c:v h264_omx -f rtsp -rtsp_transport tcp rtsp://localhost:8554/live.stream 

Expected behavior:

It should stream to the RTSP server.

Logs:

➜  ~  ffmpeg -re -f video4linux2 -video_size 1920x1080 -i /dev/video0 -c:v h264_omx -f rtsp -rtsp_transport tcp rtsp://localhost:8554/live.stream 
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
  configuration: --pkgconfigdir=/build/workspace/lib/pkgconfig --prefix=/build/workspace --pkg-config-flags=--static --extra-cflags=-I/build/workspace/include --extra-ldflags=-L/build/workspace/lib --extra-libs='-lpthread -lm' --enable-static --disable-debug --disable-shared --disable-ffplay --disable-doc --enable-openssl --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libvpx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-runtime-cpudetect --enable-libfdk-aac --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-decoder=h264 --enable-network --enable-protocol=tcp --enable-libspeex --enable-demuxer=rtsp --enable-omx-rpi --enable-mmal --enable-indev=alsa --enable-outdev=alsa
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 10363.538080, bitrate: 165888 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 165888 kb/s, 5 fps, 5 tbr, 1000k tbn, 1000k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_omx))
Press [q] to stop, [?] for help
[h264_omx @ 0x2c08ab0] /opt/vc/lib/libbcm_host.so not found
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!

Screenshots:

Environment:

  • Homebridge Raspberry Pi Image Version: 1.0.30
  • Node.js Version: v16.14.0
  • NPM Version: 8.5.1
  • Homebridge Version: 1.4.0
  • Homebridge Config UI X Plugin Version: v4.43.0

Sadly, h264_omx is not supported anymore on the new Raspbian Bullseye.
See here: https://forums.raspberrypi.com/viewtopic.php?t=323351

Maybe you could try "h264_v4l2m2m" as suggested in the linked topic.

oznu commented

Thanks @crassmike - I removed the "omx" support from the README.