# Error executing ffmpeg from exec node : ffmpeg: command not found

**URL:** <https://discourse.nodered.org/t/error-executing-ffmpeg-from-exec-node-ffmpeg-command-not-found/45052>\
**Category:** General\
**Created:** [2 May 2021 10:28 UTC](https://discourse.nodered.org/t/error-executing-ffmpeg-from-exec-node-ffmpeg-command-not-found/45052 "2021-05-02T10:28:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vks007](https://avatars.discourse-cdn.com/v4/letter/v/6bbea6/32.png) [@vks007](https://discourse.nodered.org/u/vks007)\
**Post date:** [2 May 2021 10:28 UTC](https://discourse.nodered.org/t/error-executing-ffmpeg-from-exec-node-ffmpeg-command-not-found/45052/1 "2021-05-02T10:28:16Z")

</div>

Hi, My aim here is to capture a video using ffmpeg command from a rtsp camera.  
I am having trouble executing the ffmpeg command via the exec node in node-red.  
Command I am trying to run is:

```auto
ffmpeg -i rtsp://my_username:my_password@192.168.X.X:554/stream1 -r 10 -t 30 -codec copy -an /media/video_20210502-150501.mp4

```

I am able to run this well from the terminal. The filename in the command is a dynamic string appended by the exec node.  
The error I get is error 127 as:

```auto
Command failed: ffmpeg -i rtsp://my_username:my_password@192.168.X.X:554/stream1 -r 10 -t 30 -codec copy -an /media/video_20210502-150501.mp4
/bin/bash: line 1: ffmpeg: command not found

```

I am sure this is nothing to do with access to the path as I am able to write test file via node red into the same folder.

It may be something to do with the fact that I am running node-red as a docker container and as a addon in home assistant. It does not seem to have access to the command. Can somebody please give me hints on how can i go about solving this?

 ![image_2021-05-02_155805](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/0/00bf25ad1d7db5bff0d07119e7002516ba9313f7.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [2 May 2021 10:42 UTC](https://discourse.nodered.org/t/error-executing-ffmpeg-from-exec-node-ffmpeg-command-not-found/45052/2 "2021-05-02T10:42:11Z")

</div>

> [@vks007](#):
>
> `/bin/bash: line 1: ffmpeg: command not found`

When running from an exec node the PATH environment variable will be the same as when you are logged in in a terminal. You probably need to specify the full path to ffmpeg. Run  
`which ffmpeg`  
which will return something like (but not necessarily the same as) `/usr/bin/ffmpeg`, then in the exec node use `usr/bin/ffmpeg` instead of just ffmpeg

**[Edit]** That assumes you are not running node-red in a container such as Docker, in which case you will probably need to install ffmpeg in the container.

**[Further Edit]** I have just read your question properly, and see you are running in a container, in which case I think you need ffmpeg installed there. You will likely have to ask in an HA forum for how to do that (or ditch HA and use node-red natively, which is what most here do).

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [2 May 2021 10:50 UTC](https://discourse.nodered.org/t/error-executing-ffmpeg-from-exec-node-ffmpeg-command-not-found/45052/3 "2021-05-02T10:50:14Z")

</div>

> [@vks007](#):
>
> I am having trouble executing the ffmpeg command via the exec node

BTW when using _ **ffmpeg** _ and/or _ **rtsp** _ in Node-RED, you definately should have a look at the various [nodes](https://github.com/kevinGodell?tab=repositories) that @kevinGodell has developed recently (e.g. this [discussion](https://discourse.nodered.org/t/node-red-contrib-ffmpeg-spawn/44427)).

---

<div class="post-metadata">

**Author:** ![vks007](https://avatars.discourse-cdn.com/v4/letter/v/6bbea6/32.png) [@vks007](https://discourse.nodered.org/u/vks007)\
**Post date:** [2 May 2021 12:07 UTC](https://discourse.nodered.org/t/error-executing-ffmpeg-from-exec-node-ffmpeg-command-not-found/45052/4 "2021-05-02T12:07:18Z")

</div>

Great , thanks for pointing the obvious to me. I should have realized that myself.

---

<div class="post-metadata">

**Author:** ![vks007](https://avatars.discourse-cdn.com/v4/letter/v/6bbea6/32.png) [@vks007](https://discourse.nodered.org/u/vks007)\
**Post date:** [2 May 2021 12:08 UTC](https://discourse.nodered.org/t/error-executing-ffmpeg-from-exec-node-ffmpeg-command-not-found/45052/5 "2021-05-02T12:08:31Z")

</div>

Thanks for the pointers, I will see them now.

---

<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:** [1 July 2021 12:08 UTC](https://discourse.nodered.org/t/error-executing-ffmpeg-from-exec-node-ffmpeg-command-not-found/45052/6 "2021-07-01T12:08:44Z")

</div>

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