# 'ffmpeg' fails on RPi-4B running Bullseye (32-bit)

**URL:** <https://discourse.nodered.org/t/ffmpeg-fails-on-rpi-4b-running-bullseye-32-bit/88359>\
**Category:** General\
**Created:** [29 May 2024 15:38 UTC](https://discourse.nodered.org/t/ffmpeg-fails-on-rpi-4b-running-bullseye-32-bit/88359 "2024-05-29T15:38:56Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [29 May 2024 15:38 UTC](https://discourse.nodered.org/t/ffmpeg-fails-on-rpi-4b-running-bullseye-32-bit/88359/1 "2024-05-29T15:38:56Z")

</div>

I had to reflash the SD card for a RPi-4B when its SSD packed-up recently.  
I decided to use Bullseye 32-bit but find that 'ffmpeg' (v4.3.6) produces an error in the command line when I try to record a video from a camera on my network.  
Here's my simple test flow.  
 ![wednesday_ffmpeg](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/9/a90dbdaf4f055fe16a37346f85b3a65e6617a168.png)

```auto
[{"id":"911feac958ad77b0","type":"tab","label":"Flow 20","disabled":false,"info":"","env":[]},{"id":"86872925ba194088","type":"function","z":"911feac958ad77b0","name":"Build ffmpeg command","func":"msg.payload = 'ffmpeg -y -i http://192.168.1.164:8081 -t 5 -c:v h264_omx -b:v 2M /home/pi/test.mp4';\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":380,"y":240,"wires":[["4e12c1dcd2464c89"]]},{"id":"4e12c1dcd2464c89","type":"exec","z":"911feac958ad77b0","command":"","addpay":"payload","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"","x":330,"y":300,"wires":[["9efce3ad8f082d8c"],["9efce3ad8f082d8c"],["9efce3ad8f082d8c"]]},{"id":"08d49f3cd12c410a","type":"inject","z":"911feac958ad77b0","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":240,"wires":[["86872925ba194088"]]},{"id":"9efce3ad8f082d8c","type":"debug","z":"911feac958ad77b0","name":"debug 20","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":500,"y":300,"wires":[]}]

```

If I run the same test flow on a RPi-4B running Buster (32-bit) with 'ffmpeg' (v4.1.11) it works fine.

Any ideas as to how I can sort out this incompatibility (?) issue?

Note:  
I've tried various ideas I found on the Internet with zero success so far.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [29 May 2024 16:12 UTC](https://discourse.nodered.org/t/ffmpeg-fails-on-rpi-4b-running-bullseye-32-bit/88359/2 "2024-05-29T16:12:35Z")

</div>

> [@dynamicdave](#):
>
> `h264_omx`

Bullseye removed the ability for hardware encoding using the legacy `MMAL`/`OMX` stack.  
try using `h264_v4l2m2m` instead (make sure you have enough vRAM)

Being apart of another project - this was a pain when bullseye landed

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [29 May 2024 17:32 UTC](https://discourse.nodered.org/t/ffmpeg-fails-on-rpi-4b-running-bullseye-32-bit/88359/3 "2024-05-29T17:32:33Z")

</div>

> [@marcus-j-davies](#):
>
> h264\_v4l2m2m

Still get an error even with your suggestion...

```auto
Command failed: ffmpeg -y -i http://192.168.1.164:8081 -t 5 -c:v h264_v4l2m2m -b:v 2M /home/pi/test.mp4
ffmpeg version 4.3.6-0+deb11u1+rpt5 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 10 (Raspbian 10.2.1-6+rpi1)

```

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [29 May 2024 17:41 UTC](https://discourse.nodered.org/t/ffmpeg-fails-on-rpi-4b-running-bullseye-32-bit/88359/4 "2024-05-29T17:41:52Z")

</div>

Have you tried `-c:v libx264`  
??

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [29 May 2024 17:44 UTC](https://discourse.nodered.org/t/ffmpeg-fails-on-rpi-4b-running-bullseye-32-bit/88359/5 "2024-05-29T17:44:19Z")

</div>

Mmm...

There is a build script I wrote that builds from source with all the components.  
but a little intensive (but hey we like that right 😉)

```auto
bash <(curl -sL https://raw.githubusercontent.com/NRCHKB/nrchkb-ffmpeg-build/2.0/build-debian.sh)

```

My build script builds ffmpeg 5+ with `h264_v4l2m2m`

[![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/d/9de0eff6f5c205fd140a16bcab6f83779e27482b.png) ](https://raw.githubusercontent.com/NRCHKB/nrchkb-ffmpeg-build/2.0/Menu1.png)

> **[GitHub - NRCHKB/nrchkb-ffmpeg-build at 2.0](https://github.com/NRCHKB/nrchkb-ffmpeg-build/tree/2.0)**
>
> 2.0

before going down that route - maybe @kevingodell has insight?

> [@krambriw](#):
>
> Have you tried `-c:v libx264`  
> ??

Which is usually fine - but uses CPU time, the fact **h264\_omx** is in use, would suggest this is to be avoided

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [29 May 2024 17:47 UTC](https://discourse.nodered.org/t/ffmpeg-fails-on-rpi-4b-running-bullseye-32-bit/88359/6 "2024-05-29T17:47:11Z")

</div>

> [@krambriw](#):
>
> -c:v libx264

Thanks Walter - that works without giving an error and produces a video.

I've edited the recording flow in HSS and can confirm it now performs the record function.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [29 May 2024 17:49 UTC](https://discourse.nodered.org/t/ffmpeg-fails-on-rpi-4b-running-bullseye-32-bit/88359/7 "2024-05-29T17:49:16Z")

</div>

Just be mindful this is a software encoder, so you might see a usage spike/heat on the die.

**EDIT**  
Ah! but if doing a single file - It will be fine.

Sorry - thought you were transcoding camera streams

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [29 May 2024 18:01 UTC](https://discourse.nodered.org/t/ffmpeg-fails-on-rpi-4b-running-bullseye-32-bit/88359/8 "2024-05-29T18:01:44Z")

</div>

Hi Marcus,  
Will your 'build' script work for Bullseye 32-bit ?

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [29 May 2024 18:05 UTC](https://discourse.nodered.org/t/ffmpeg-fails-on-rpi-4b-running-bullseye-32-bit/88359/9 "2024-05-29T18:05:52Z")

</div>

The situation were I'm using 'ffmpeg' is to capture a 5 or 10-sec stream from a camera (running Motion-Eye-OS) on my network and write it to a file.

This forms part of the HSS project.

> [@Home Surveillance System (HSS)](https://discourse.nodered.org/t/home-surveillance-system-hss/51726):
>
> David (@dynamicdave), Paul (@zenofmud and Walter (@krambriw) are pleased to announce the release of their Home Surveillance System (HSS) project based on Node-RED running on a Raspberry Pi (recommended hardware is... Raspberry Pi-3B or 4B). As can be seen from the photos below, HSS has four monitors and a main display area that can show video streams from local and/or remote cameras [walter\_2] On-the-fly recordings can …

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [29 May 2024 18:24 UTC](https://discourse.nodered.org/t/ffmpeg-fails-on-rpi-4b-running-bullseye-32-bit/88359/10 "2024-05-29T18:24:30Z")

</div>

It technically should do.

It builds FFMPEG from Source (5+)  
and installs the dev libraries from the respective OS's repository (OR builds from source if not found)

Get a spare SD card to test it before going in 😄

I mean I state on the read me 32/64 😅

Use Option 1, then 8 - Guided

---

<div class="post-metadata">

**Author:** ![Bobo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bobo/32/8401_2.png) [@Bobo](https://discourse.nodered.org/u/Bobo)\
**Post date:** [30 May 2024 03:07 UTC](https://discourse.nodered.org/t/ffmpeg-fails-on-rpi-4b-running-bullseye-32-bit/88359/11 "2024-05-30T03:07:06Z")

</div>

> [@dynamicdave](#):
>
> running Motion-Eye-OS

OT  
I moved away from MotionEyeOS because it appeared to me the project was longer being maintained, let alone new features being added. Even the RPi Zero 2 wasn't officially supported.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [30 May 2024 06:37 UTC](https://discourse.nodered.org/t/ffmpeg-fails-on-rpi-4b-running-bullseye-32-bit/88359/12 "2024-05-30T06:37:16Z")

</div>

Thanks for the feedback - you didn't say which camera firmware you moved to?

---

<div class="post-metadata">

**Author:** ![Bobo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bobo/32/8401_2.png) [@Bobo](https://discourse.nodered.org/u/Bobo)\
**Post date:** [31 May 2024 07:08 UTC](https://discourse.nodered.org/t/ffmpeg-fails-on-rpi-4b-running-bullseye-32-bit/88359/13 "2024-05-31T07:08:52Z")

</div>

A work in progress (isn't it always?).

Essentially I am using Picamera2 as the basis for some Python custom firmware running on RPi Zero 2. Included is Tensorflow Lite, as light and tight as I can make it. It's running headless so I have no need for fancy boxes around objects being displayed on a screen.

The outputs are POSTing detections to NR Server which will then send alarms and images to Telegram, email etc.

So far tests have gone well, although the RPi Zero 2 is running close to its throttling limit to produce a few frames per second, which is fine for what I want.

Cheers

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [29 August 2024 07:09 UTC](https://discourse.nodered.org/t/ffmpeg-fails-on-rpi-4b-running-bullseye-32-bit/88359/14 "2024-08-29T07:09:23Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
