Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flow macro #788

Open
PeteB1983 opened this issue Mar 1, 2025 · 5 comments
Open

flow macro #788

PeteB1983 opened this issue Mar 1, 2025 · 5 comments

Comments

@PeteB1983
Copy link

I have a pretty convoluted flow with repeats of the same processing.

it would make things much more straight forward if there were plugins for "goto macro x", "macro x start" and "macro x output 1/2/3/4 etc"

so in the main flow you put in "goto macro" then elsewhere you have "macro x start" with a few processes and then it returns to the outputs of the goto macro x that called it originally.

while writing this I have realised this could be achieved by having plugins to return to the output on "go to flow" if that makes sense?

@HaveAGitGat
Copy link
Owner

Yes you can do this with ‘Go To Flow’ to go back to a specific plugin in the original flow.

@PeteB1983
Copy link
Author

I assume that the 'go to flow' plugin returns to the plugin named,
I was hoping for something to return to an output on the original 'go to flow' so for instance if there are standard settings (ensure audio stream, set container, set resolution etc) this could be referenced in many locations but only laid out once.

so if I have 3 differing ffmpeg commands A, B and C, each with a 'go to flow' then if it was called from path A and ended at output 1 then that would return to the first output on go to flow path A, but if it was called from path C then the same result would return to output 1 on go to flow path C.

maybe calling it include flow would be more accurate? I suppose I might be able to do the same with flow variables? are they persistent when going to a different flow?

@Mikec78660
Copy link

You can say go to flow and name the current flow and then you say what plugin ID you want to go to. every time you add a flow plugin it is given a unique flow ID. So even if you have multiple of the same plugin in your flow you can specify which one you want o go to. The ID is just the name of the plugin when you look at them in the list on the right but once you drag one onto your flow, if you double click the plugin and look at the ID it will be something like NHRCnxF5V. it is listed at the top inside the plugin. It has like plugin enabled, name, source, version then it's unique ID.

@PeteB1983
Copy link
Author

The issue is returning to the right place, as once the included flow is complete I would want it to return to the point from which it was called, so I would need to set a variable to indicate which flow it originated from. - though you are right I would assume the variable would be retained if the call was within the same flow.

As I understand it variables are just text strings not values and can't be used other than to check if they are equal to a text string?

So for instance they can't be used in formulae or incremented by 1 or used as the name of the flow to go to?

@Mikec78660
Copy link

Ahh so you have a flow where two different paths might use a goto plugin to get to a common plugin and you would then want them to go back to the plugin just before the plugin that called the goto plugin? So you would say is the file 265, if no goto a flow to convert to 265 then go back to the plugin that asked if the file was 265 and this time it would be yes and would continue on.

Then yes setting a flow variable would probably be the best bet. Question is what is the ID of the plugin that called the gotoflow plugin. I would think it would be stored. as something like flow.ID.1 flow.ID.2 and so on going backward? But I have no idea. There might be another way to do it. What are you trying to do? Is it trying to make a file a certain size or something, so you want to check the size and then come back if it is too big or two small and change the compression and try again?

Also yes, you should be able to do math with a flow variable. you would need to use the javascript plugin and convert the string to a number or float or whatever, do the calcuation and then return it back to the string variable. I haven't done it yet but it is on my todo list. I want to be able to take the resolution and bitrate to calcualte what qp I want to encode 264 into av1 with. It seems totally doable. He says confidently :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants