How to put {{}} in MAKE without understunding as a variable

What are you trying to achieve?

I need to create a mp4 file video given an image or images and a mp3 audio file.
I’m using the API.RENDI API : Rendi - FFmpeg as a Service Dashboard

Steps taken so far

This is the POST call that is working FINE in POSTMAN:

POST /v1/run-ffmpeg-command?= HTTP/1.1
Host: api.rendi.dev
X-API-KEY: xxxxxxxxxxxxxxxxxxx/dNdcsrcQQA7yARfg==
Content-Type: application/json
Content-Length: 543

{
“input_files”: {
“in_img_1”: “https://storage.rendi.dev/sample/bbb-splash.png”,
“in_img_2”: “https://storage.rendi.dev/sample/rodents.png”,
“in_audio_1”: “https://drive.google.com/uc?id=xxxxxxxxxxxxxx1X3jrxxEgCxiUsNtsucfWhpbaVABsIYq3MP&export=download
},
“output_files”: {
“out_1”: “output.mp4”
},
“ffmpeg_command”: “-loop 1 -t 5 -i {{in_img_1}} -loop 1 -t 5 -i {{in_img_2}} -i {{in_audio_1}} -filter_complex [0:v][1:v]concat=n=2:v=1:a=0,format=yuv420p[v] -map [v] -map 2:a -c:v libx264 -c:a aac -shortest {{out_1}}”
}

The problem in MAKE comes in the “ffmpeg_command”. In the {{in_img_1}} {{in_img_2}} {{in_audio_1} and {{out_1}}}… variables.
The API seems to need to get as a plain text but when I try to write in MAKE it replace them, like they were variables. So I tried all the solutions that ChatGPT gave me, but none works well. I tried to create a “setVariable” Module, escaping the ‘{’ symbol using }, also with double{{}} but nothing works…

I just need to send the request with the text like {{in_img1}}, without any replacement.

Do you know how can I change the default behavior of MAKE? or to scape somehow the text?

Thanks in advance,
Alejandro

Welcome to the Make community!

You can use the built-in function replace

e.g.:

Screenshot_2025-02-26_070228

Output:

Screenshot_2025-02-26_070243

Module Export - quick import into your scenario

Screenshot_2025-02-26_070219

You can copy and paste this module export into your scenario. This will import the modules (with fields/settings/filters) shown in my screenshots above.

  1. Move your mouse over the line of code below. Copy the JSON by clicking the copy button on the right of the code, which looks like this:

  2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the editor.

  3. Click on each imported module and re-save it for validation. There may be some errors prompting you to remap some variables and connections.

JSON module export — paste this directly in your scenario

{"subflows":[{"flow":[{"id":1,"module":"util:SetVariable2","version":1,"parameters":{},"mapper":{"name":"ffmpeg_command","scope":"roundtrip","value":"{{replace(\"-loop 1 -t 5 -i #in_img_1# -loop 1 -t 5 -i #in_img_2# -i #in_audio_1# -filter_complex [0:v][1:v]concat=n=2:v=1:a=0,format=yuv420p[v] -map [v] -map 2:a -c:v libx264 -c:a aac -shortest #out_1#\"; \"/#([^#]+)#/g\"; \"{{$1}}\")}}"},"metadata":{"designer":{"x":1742,"y":23,"name":"Set ffmpeg_command"}}}]}],"metadata":{"version":1}}

Note: Did you know you can reduce the size of blueprints and module export code like the above, using the Make Blueprint Scrubber?

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

1 Like

This is the regular expression I used in the function above:

Screenshot_2025-02-26_080222

For more information, see regex101: build, test, and debug regex

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

3 Likes

Thank you very much! Your solution works perfect! I notice that someone asked time ago something similar and you gave the solution as well with the replace command.
image

Thanks again Samliew! :slight_smile:

1 Like

No problem, glad I could help!

1. If anyone has a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

  • others can save time when catching up with the latest activity here, and
  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

1 Like