Command line exec node ffmpeg using NR in Docker

I'm struggling to run a command in exec node and I need some pointers please;

I have created a bash script and can successfully run an ffmpeg command with my script named ffmpegrun.sh as below;

However, when I run in node red as below;

I get the following errors;

debug

Can anybody assist please?

Thanks in advance

In the exec node, move what you have in the Command option to the extra input parameters and in the Command option enter bash

Thanks for coming back to me.

Hmmm it is working for me with a test script
can you try this - add a new script to the /home/pi/bin folder called test.sh with the following

#!/bin/bash
echo "Hello World"

then issue a sudo chmod u+x test.sh to make it executable. Then try this test flow:

[{"id":"9649322b.090d8","type":"inject","z":"33c087f3.e5e528","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":260,"y":220,"wires":[["b3333aab.d88508"]]},{"id":"3c8850bb.6f3bc8","type":"debug","z":"33c087f3.e5e528","name":"Standard output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":780,"y":160,"wires":[]},{"id":"b3333aab.d88508","type":"exec","z":"33c087f3.e5e528","command":"bash","addpay":false,"append":"/home/pi/bin/test.sh","useSpawn":"false","timer":"","oldrc":false,"name":"","x":500,"y":220,"wires":[["3c8850bb.6f3bc8"],["340ee91d.b9a45e"],["a5accb3e.b6f62"]]},{"id":"340ee91d.b9a45e","type":"debug","z":"33c087f3.e5e528","name":"Standard error","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":780,"y":220,"wires":[]},{"id":"a5accb3e.b6f62","type":"debug","z":"33c087f3.e5e528","name":"Return code","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":770,"y":280,"wires":[]}]

Umm, not working either my end :grimacing:

however fine, when cli input

image

what are the permissions on the /home/pi/bin directory ? maybe it's only visible to pi user.

How do I check that please?

just found permissions;
image

Tried on another pi (pi3 b+) and the test.sh worked. Differences between both is Pi4 buster and in Docker?

Just tried my original bash script on the non docker (pi3) and it also works??:unamused:

See mentioning docker at the beginning would have been helpful.

So this sounds like a docker permission issue and I’ll have to bow out now since I’ve never used docker.

Altered now

The whole point of docker is that the container file system is isolated from the main computer file system - so unless you have mounted the relevant directories so they are accessible they can't see each other. Is ffmpeg installed inside the docker container ? If not then that is also unlikely to run.

ffmpeg is installed with buster and sits outside any docker container. Node Red is inside, so I guess the issue is that the exec command is coming from inside a container?

Unless you have a need to use Docker then one solution is to remove the docker version and install directly on the Pi using the install technique from the docs
https://nodered.org/docs/getting-started/raspberrypi

1 Like

Ok, thanks for your help everyone.

Sorry for reopening this issue, but I'm also struggling with it badly.
I'm using the excellent jrottenberg/ffmpeg docker image and trying to mount it to the NR's /data directory, so it would be accessible from the exec node, like that:

I'm mounting the following docker images, to the same /data directory.

docker run -it -p 1880:1880 -v node_red_data:/data --name mynodered nodered/node-red

docker run -it -v node_red_data:/data --name myffmpeg jrottenberg/ffmpeg
REPOSITORY           TAG       IMAGE ID       CREATED         SIZE
nodered/node-red     latest    c060f9cb7fd5   11 days ago     456MB
jrottenberg/ffmpeg   latest    2100506dfbea   24 months ago   218MB```

Maybe I'm missing something here or doing it wrong, because when running in bash ('docker exec -it mynodered /bin/bash') the following command:

jrottenberg/ffmpeg -version

instead of:

docker run jrottenberg/ffmpeg -version

I get nothing. Thoughts? thanks!