# Node-red-contrib-ffmpeg-spawn dev

**URL:** https://discourse.nodered.org/t/node-red-contrib-ffmpeg-spawn-dev/54850
**Category:** Share Your Nodes
**Created:** [8 December 2021 02:11 UTC](https://discourse.nodered.org/t/node-red-contrib-ffmpeg-spawn-dev/54850 "2021-12-08T02:11:59Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kevinGodell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kevingodell/32/27040_2.png) [@kevinGodell](https://discourse.nodered.org/u/kevinGodell)
#### Post date: [8 December 2021 02:11 UTC](https://discourse.nodered.org/t/node-red-contrib-ffmpeg-spawn-dev/54850/1 "2021-12-08T02:11:59Z")

</div>

...continued from [Node-red-contrib-ffmpeg-spawn](https://discourse.nodered.org/t/node-red-contrib-ffmpeg-spawn/44427)

I am currently working on adding support for credentials in node-red-contrib-ffmpeg-spawn.

The situation is that many people, myself included, use ffmpeg to connect to an ip camera that has the username and password embedded in the url, such as `rtsp://username:password@192.168.1.33:554/cam/realmonitor?channel=1&subtype=1`. It bothers me a bit that I can't easily share my flows without having to painstakingly redact the url by hand and then share it.

I am toying with the option of allowing 1 SECRET to be used in the args that will be replaced by the credential, such as the pictures illustrate:

 ![Screen Shot 2021-12-07 at 7.56.54 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/b/5bd7bc61eabb34ab8e56e851c22efff705a44f71.png)  
 ![Screen Shot 2021-12-07 at 7.57.21 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/d/0d3c555d84360cc0b0fc0217c397b4a61ffd2dd5.png)

If you choose to use a secret value, the string literal `SECRET` in the args array will be replaced by the secret stored as a credential.

I think this may also help to more safely store some sensitive info when using projects, but I am not 100% sure on that. I was also considering having it as a password box instead of text to obscure it from being visible, but I DO like being able to see the secret.

Also, this does not apply for when the args are injected from an inject node. That can be managed by some external node that handles credentials.

\*updated category

---

<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: [31 December 2021 16:20 UTC](https://discourse.nodered.org/t/node-red-contrib-ffmpeg-spawn-dev/54850/2 "2021-12-31T16:20:27Z")

</div>

> [@kevinGodell](#):
>
> but I DO like being able to see the secret

That is a pitty, otherwise you could have used the Node-RED build-in credential mechanism. Then indeed your credentials are also not shared when you export yor flow, and other nodes cannot access it. But if course you cannot see the credentials.  
I have not used yet the [TypedInput](https://nodered.org/docs/api/ui/typedInput/) type "cred", so not sure what its possibilities are...  
Now I am off. Have a nice new year!!

---

<div class="post-metadata">

### Author: ![kevinGodell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kevingodell/32/27040_2.png) [@kevinGodell](https://discourse.nodered.org/u/kevinGodell)
#### Post date: [31 December 2021 16:56 UTC](https://discourse.nodered.org/t/node-red-contrib-ffmpeg-spawn-dev/54850/3 "2021-12-31T16:56:46Z")

</div>

Alas, the pity has been averted. Thanks for the concern, but it is using the credential mechanism, which comes in 2 flavors, **text** and **password**. Currently i was using it as text because it makes it convenient to see the value in the editor, while still encrypting it in the node-red credential system and excluding it when exporting flows (I think).

Of course, it would be convenient if the user could pick whether to use the password or text version, but i do not believe the type can be changed at runtime. That might be something I can do if a user sets some value in the settings.js file, which would then apply to all of the instances.

> <https://github.com/kevinGodell/node-red-contrib-ffmpeg-spawn/blob/3dba9e0f42b9b44a8fdafb3a2c26e1ba40583910/ffmpeg-spawn.js#L390>

Happy new year!

---

<div class="post-metadata">

### Author: ![kevinGodell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kevingodell/32/27040_2.png) [@kevinGodell](https://discourse.nodered.org/u/kevinGodell)
#### Post date: [31 December 2021 21:52 UTC](https://discourse.nodered.org/t/node-red-contrib-ffmpeg-spawn-dev/54850/4 "2021-12-31T21:52:17Z")

</div>

Latest version uses typedInput **cred** for better input styling.

 ![Screen Shot 2021-12-31 at 3.47.06 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/c/ac4c7c95a543bf260c0ca6be32be9f77362c46c9.png)

The type of credential can be updated via settings.js to change between **text** or **password** , based on the user's preference:

```auto
ffmpegSpawn: {
  cmdPath: require('ffmpeg-for-homebridge'),
  cmdOutputsMax: 10,
  secretType: 'text' // or 'password'
}

```

---

<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 March 2022 21:52 UTC](https://discourse.nodered.org/t/node-red-contrib-ffmpeg-spawn-dev/54850/5 "2022-03-01T21:52:41Z")

</div>

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